/* =========================================================
   Performance Lead Magnet — Frontend styles
   Dark theme inspired by Alchimy brand
   ========================================================= */

.plm-container {
    --plm-bg: #0e0e10;
    --plm-surface: #13131600;
    --plm-surface-2: #1a1a1d;
    --plm-border: rgba(255, 255, 255, 0.08);
    --plm-border-strong: rgba(255, 255, 255, 0.14);
    --plm-text: #ffffff;
    --plm-text-muted: #a1a1aa;
    --plm-text-soft: #d4d4d8;
    --plm-accent-blue: #7dd3fc;
    --plm-accent-purple: #a78bfa;
    --plm-error: #f87171;
    --plm-error-bg: rgba(248, 113, 113, 0.08);
    --plm-gradient-button: linear-gradient(135deg, #c4b5fd 0%, #e9d5ff 45%, #fbcfe8 100%);
    --plm-gradient-button-hover: linear-gradient(135deg, #b4a3fa 0%, #ddc4f7 45%, #f8bce0 100%);
    --plm-gradient-progress: linear-gradient(90deg, #67e8f9 0%, #a78bfa 55%, #f0abfc 100%);
    --plm-gradient-headline: linear-gradient(90deg, #7dd3fc 0%, #a78bfa 60%, #c4b5fd 100%);
    --plm-radius: 24px;
    --plm-radius-input: 12px;
    --plm-radius-pill: 999px;

    font-family: area-normal, sans-serif;
    max-width: 920px;
    margin: 48px auto;
    margin-left: 0;
    color: var(--plm-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
}

.plm-card {
    position: relative;
    background: var(--plm-surface);
    border: 1px solid var(--plm-border);
    border-radius: var(--plm-radius);
    padding: 56px 56px 48px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 30px 80px -20px rgba(0, 0, 0, 0.55);
}

@media (max-width: 640px) {
    .plm-container { margin: 24px auto; }
    .plm-card { padding: 32px 24px; border-radius: 20px; }
}

/* ----------------- Section label (eyebrow) ----------------- */
.plm-eyebrow {
    display: block;
    color: var(--plm-accent-blue);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 22px;
}

/* ----------------- Headings ----------------- */
.plm-headline {
    font-size: 32px;
    line-height: 38px;
    font-weight: 600;
    color: var(--plm-text);
    margin: 0 0 40px 0;
    /* letter-spacing: -0.01em; */
    max-width: 22ch;
}

.plm-header {
    text-align: center;
    margin-bottom: 36px;
}

.plm-header h2 {
    font-size: 32px;
    font-weight: 500;
    color: var(--plm-text);
    margin: 0 0 12px 0;
    letter-spacing: -0.01em;
}

.plm-header p {
    font-size: 15px;
    color: var(--plm-text-muted);
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .plm-headline { font-size: 28px; margin-bottom: 28px; }
    .plm-header h2 { font-size: 24px; }
}

/* ----------------- Three reasons grid ----------------- */
.plm-reasons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.plm-reason__icon {
    width: 28px;
    height: 28px;
    color: var(--plm-accent-purple);
    margin-bottom: 18px;
}

.plm-reason__icon svg {
    width: 100%;
    height: 100%;
    display: block;
    stroke: currentColor;
    fill: none;
}

.plm-reason__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--plm-text);
    margin: 0 0 12px 0;
    line-height: 1.35;
}

.plm-reason__text {
    font-size: 14px;
    color: var(--plm-text-muted);
    margin: 0;
    line-height: 1.55;
}

@media (max-width: 720px) {
    .plm-reasons { grid-template-columns: 1fr; gap: 28px; margin-bottom: 32px; }
}

/* ----------------- Divider ----------------- */
.plm-divider {
    height: 1px;
    background: var(--plm-border);
    border: 0;
    margin: 0 0 28px 0;
}

/* ----------------- Form fields ----------------- */
.plm-input-group {
    margin-bottom: 16px;
    text-align: left;
}

.plm-input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--plm-text-soft);
    font-size: 13px;
}

.plm-input-group input[type="url"],
.plm-input-group input[type="text"],
.plm-input-group input[type="email"],
.plm-input-group input[type="tel"] {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid var(--plm-border);
    border-radius: var(--plm-radius-input);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
    background: var(--plm-surface-2);
    color: var(--plm-text);
}

.plm-input-group input::placeholder {
    color: #52525b;
}

.plm-input-group input:focus {
    border-color: var(--plm-accent-purple);
    outline: none;
    background: #1f1f23;
    box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.12);
}

/* Inline row : URL field + button (step 1) */
.plm-inline-row {
    display: flex;
    
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.plm-inline-row .plm-input-group {
    flex: 1;
    margin-bottom: 0;
}

.plm-inline-row .plm-input-group input {
    height: 100%;
}

.plm-inline-row .plm-btn {
    flex: 0 0 auto;
    width: auto;
    align-self: stretch;
    margin-top: 26px; /* aligns with input under label */
}
.plm-btn::after {
    display:none;
}

@media (max-width: 720px) {
    .plm-inline-row { flex-direction: column; }
    .plm-inline-row .plm-btn { margin-top: 0; width: 100%; }
}

/* ----------------- Checkbox ----------------- */
.plm-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--plm-text-muted);
    line-height: 1.5;
}

.plm-checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 1px 0 0 0;
    border: 1px solid var(--plm-border-strong);
    border-radius: 6px;
    background: var(--plm-surface-2);
    cursor: pointer;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
}

.plm-checkbox-group input[type="checkbox"]:checked {
    background: var(--plm-surface-2);
    border-color: var(--plm-accent-purple);
}

.plm-checkbox-group input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border-right: 2px solid #c4b5fd;
    border-bottom: 2px solid #c4b5fd;
    transform: rotate(45deg);
}

.plm-checkbox-group label { cursor: pointer; }

/* ----------------- Buttons ----------------- */
.plm-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 16px 28px;
    border: none;
    border-radius: var(--plm-radius-pill);
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    color: #1a1a1f;
    background: var(--plm-gradient-button);
    transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
    box-shadow: 0 8px 24px -8px rgba(196, 181, 253, 0.5);
}

.plm-btn:hover {
    background: var(--plm-gradient-button-hover);
    transform: translateY(-1px);
    box-shadow: 0 12px 32px -8px rgba(196, 181, 253, 0.65);
}

.plm-btn:active { transform: translateY(0); }

.plm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    filter: saturate(0.7);
}

.plm-btn-arrow {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.plm-btn-arrow svg { width: 100%; height: 100%; display: block; }

/* legacy aliases preserved so existing JS / classes keep working */
.plm-btn-primary,
.plm-btn-success {
    background: var(--plm-gradient-button);
    color: #1a1a1f;
}

.plm-btn-primary:hover,
.plm-btn-success:hover {
    background: var(--plm-gradient-button-hover);
}

/* ----------------- Spinner ----------------- */
.plm-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(26, 26, 31, 0.25);
    border-radius: 50%;
    border-top-color: #1a1a1f;
    animation: plm-spin 0.9s linear infinite;
    margin-left: 4px;
}

@keyframes plm-spin {
    to { transform: rotate(360deg); }
}

/* ----------------- Error message ----------------- */
.plm-error-msg {
    color: var(--plm-error);
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
    padding: 12px 16px;
    background: var(--plm-error-bg);
    border: 1px solid rgba(248, 113, 113, 0.18);
    border-radius: 10px;
}

/* ----------------- Progress bar (step 2 loading) ----------------- */
.plm-progress-container {
    text-align: center;
    padding: 8px 0 28px;
}

.plm-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 22px;
}

.plm-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--plm-gradient-progress);
    transition: width 0.4s ease;
    border-radius: 999px;
}

#plm-loading-text {
    font-weight: 500;
    color: var(--plm-text);
    font-size: 15px;
    margin: 0;
}

/* ----------------- Step 2 lead form wrapper ----------------- */
#plm-lead-form-wrapper {
    border-top: 1px solid var(--plm-border);
    padding-top: 32px;
    margin-top: 32px;
}

#plm-lead-form-wrapper h3 {
    font-size: 24px;
    font-weight: 500;
    color: var(--plm-text);
    margin: 0 0 8px 0;
    letter-spacing: -0.01em;
}

#plm-lead-form-wrapper > p {
    color: var(--plm-text-muted);
    font-size: 14px;
    margin: 0 0 22px 0;
}

/* Lead form: checkbox + button on same row */
.plm-lead-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 8px;
}

.plm-lead-actions .plm-checkbox-group {
    flex: 1;
    margin: 0;
}

.plm-lead-actions .plm-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 14px 26px;
}

@media (max-width: 720px) {
    .plm-lead-actions { flex-direction: column; align-items: stretch; }
    .plm-lead-actions .plm-btn { width: 100%; }
}

/* ----------------- Step 3 (success) ----------------- */
#plm-step-3 {
    text-align: center;
    padding: 12px 0 8px;
}

.plm-success-headline {
    font-size: 64px;
    line-height: 1.05;
    font-weight: 500;
    margin: 36px 0 24px 0;
    letter-spacing: -0.02em;
    background: var(--plm-gradient-headline);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

#plm-step-3 .plm-success-message {
    color: var(--plm-text-soft);
    font-size: 15px;
    line-height: 1.6;
    margin: 0 auto 48px;
    max-width: 52ch;
}

.plm-success-cta {
    margin-top: 36px;
}

.plm-success-cta__label {
    font-size: 16px;
    font-weight: 600;
    color: var(--plm-text);
    margin: 0 0 20px 0;
}

.plm-success-cta .plm-btn {
    display: inline-flex;
    width: auto;
    padding: 14px 30px;
}

@media (max-width: 640px) {
    .plm-success-headline { font-size: 44px; }
}

/* ----------------- Step transitions ----------------- */
.plm-step {
    animation: plm-fade-in 0.45s ease forwards;
}

@keyframes plm-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
