/* =========================================================
   WelcomeLab styles — the post-payment moment.

   Design philosophy:
     - This page should feel like a deep breath. The user
       just authorized money. Their nervous system is on
       alert. Calm, confident, clean — not noisy.
     - The orb behind the headline is the ONE celebratory
       flourish. Soft mint glow, fades in once, settles.
       No confetti, no fireworks.
     - One pulse on entry, then quiet. Same vocabulary as
       the verdict block in Concept Lab. Continuity matters.
     - Generous spacing. The page is mostly white space,
       reading as "important moment, room to think" rather
       than "feature dump."
     - All tokens reference design-system.css — if those
       fall through, hard-coded fallbacks keep things safe.
   ========================================================= */


/* =========================================================
   1. SHELL — calm container, vertical rhythm
   ========================================================= */
.wl-celebrate,
.wl-waiting,
.wl-timeout,
.wl-key-reveal,
.wl-next,
.wl-thanks {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 24px;
}

.wl-celebrate {
    position: relative;
    text-align: center;
    padding-top: 72px;
    padding-bottom: 56px;
    /* Entrance — deeper than usual, this is THE moment */
    animation:
        wlCelebrateIn 700ms cubic-bezier(0.16, 1, 0.3, 1) both,
        wlCelebratePulse 2400ms cubic-bezier(0.16, 1, 0.3, 1) 1000ms 1;
}


/* =========================================================
   2. ORB — the soft celebration glow behind the headline
   One radial gradient. Fades in. Quiet after.
   ========================================================= */
.wl-celebrate-orb {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -20%);
    width: 640px;
    height: 640px;
    pointer-events: none;
    background: radial-gradient(
        circle at center,
        rgba(110, 231, 183, 0.18) 0%,
        rgba(110, 231, 183, 0.10) 25%,
        rgba(110, 231, 183, 0.04) 45%,
        transparent 65%
    );
    opacity: 0;
    animation: wlOrbIn 1200ms cubic-bezier(0.16, 1, 0.3, 1) 200ms forwards;
    z-index: 0;
}
.wl-waiting-orb {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -20%);
    width: 480px;
    height: 480px;
    pointer-events: none;
    background: radial-gradient(
        circle at center,
        rgba(56, 189, 248, 0.12) 0%,
        rgba(56, 189, 248, 0.06) 30%,
        transparent 60%
    );
    opacity: 0;
    animation:
        wlOrbIn 1200ms cubic-bezier(0.16, 1, 0.3, 1) 200ms forwards,
        wlOrbBreathe 4s cubic-bezier(0.65, 0, 0.35, 1) 1400ms infinite;
    z-index: 0;
}


/* =========================================================
   3. EYEBROWS — the small uppercase signal labels
   ========================================================= */
.wl-eyebrow,
.wl-next-eyebrow,
.wl-thanks-eyebrow,
.wl-key-eyebrow {
    position: relative;
    z-index: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.wl-eyebrow {
    color: var(--mb-mint, #6ee7b7);
    text-shadow: 0 0 24px rgba(110, 231, 183, 0.45);
}
.wl-next-eyebrow {
    color: var(--mb-blue, #38bdf8);
    text-shadow: 0 0 24px rgba(56, 189, 248, 0.32);
}
.wl-thanks-eyebrow {
    color: var(--mb-fg-muted, rgba(226, 232, 240, 0.55));
    letter-spacing: 0.16em;
}
.wl-key-eyebrow {
    color: var(--mb-mint, #6ee7b7);
    margin-bottom: 8px;
}


/* =========================================================
   4. HEADLINES — the moment-stamping words
   ========================================================= */
.wl-headline {
    position: relative;
    z-index: 1;
    font-size: 46px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 0 0 20px;
    color: var(--mb-fg-primary, #e2e8f0);
    background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.78) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.wl-headline-accent {
    /* Mint with a soft luminance — premium, not loud */
    background: linear-gradient(135deg, #7df1c4 0%, #6ee7b7 50%, #34d399 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(110, 231, 183, 0.4);
}
.wl-headline-secondary {
    position: relative;
    z-index: 1;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    color: var(--mb-fg-primary, #e2e8f0);
}


/* =========================================================
   5. LEAD COPY — the breathing-room paragraph
   ========================================================= */
.wl-lead {
    position: relative;
    z-index: 1;
    font-size: 16px;
    line-height: 1.6;
    color: var(--mb-fg-secondary, rgba(226, 232, 240, 0.78));
    margin: 0 0 36px;
}


/* =========================================================
   6. STATS ROW — three pills under the headline
   ========================================================= */
.wl-stats {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    padding: 16px 28px;
    background: rgba(110, 231, 183, 0.04);
    border: 1px solid rgba(110, 231, 183, 0.18);
    border-radius: 14px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 12px 32px -16px rgba(110, 231, 183, 0.18);
}
.wl-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}
.wl-stat-label {
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--mb-fg-muted, rgba(226, 232, 240, 0.55));
}
.wl-stat-val {
    font-size: 17px;
    font-weight: 600;
    color: var(--mb-fg-primary, #e2e8f0);
    letter-spacing: -0.01em;
}
.wl-stat-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--mb-mint, #6ee7b7);
}
.wl-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mb-mint, #6ee7b7);
    box-shadow: 0 0 12px rgba(110, 231, 183, 0.6);
    animation: wlPulseDot 2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}


/* =========================================================
   7. KEY REVEAL — the one-shot API key block
   ========================================================= */
.wl-key-reveal {
    margin: 56px auto;
    padding: 24px;
    background: rgba(110, 231, 183, 0.04);
    border: 1px solid rgba(110, 231, 183, 0.22);
    border-radius: 14px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 12px 32px -16px rgba(0, 0, 0, 0.6);
    animation: wlStaggerIn 600ms cubic-bezier(0.16, 1, 0.3, 1) 600ms both;
}
.wl-key-head { margin-bottom: 16px; }
.wl-key-help {
    font-size: 13px;
    line-height: 1.55;
    color: var(--mb-fg-secondary, rgba(226, 232, 240, 0.78));
    margin: 0;
}
.wl-key-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.wl-key-value {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--mb-mint, #6ee7b7);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: nowrap;
    user-select: all;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3);
}
.wl-copy-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    min-height: 44px;
    background: linear-gradient(180deg, #7df1c4 0%, #6ee7b7 100%);
    color: #06120e;
    border: 0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.4) inset,
        0 -1px 0 rgba(0, 0, 0, 0.1) inset,
        0 4px 12px -2px rgba(110, 231, 183, 0.32);
    transition:
        transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.wl-copy-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 -1px 0 rgba(0, 0, 0, 0.1) inset,
        0 6px 16px -2px rgba(110, 231, 183, 0.45);
}
.wl-copy-btn:active { transform: translateY(0); transition-duration: 80ms; }
.wl-copy-btn svg { width: 14px; height: 14px; }
.wl-copy-icon-default { display: inline-block; }
.wl-copy-icon-done { display: none; }
.wl-copy-btn.wl-copy-done {
    background: linear-gradient(180deg, #7df1c4 0%, #34d399 100%);
}
.wl-copy-btn.wl-copy-done .wl-copy-icon-default { display: none; }
.wl-copy-btn.wl-copy-done .wl-copy-icon-done { display: inline-block; }


/* =========================================================
   8. NEXT-STEP SECTION — one mint CTA, one secondary
   ========================================================= */
.wl-next {
    margin: 56px auto 48px;
    padding: 32px 28px;
    background: rgba(255, 255, 255, 0.022);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 24px 48px -24px rgba(0, 0, 0, 0.6);
    text-align: center;
    animation: wlStaggerIn 600ms cubic-bezier(0.16, 1, 0.3, 1) 800ms both;
}
.wl-next-title {
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 14px;
    color: var(--mb-fg-primary, #e2e8f0);
    letter-spacing: -0.02em;
}
.wl-next-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--mb-fg-secondary, rgba(226, 232, 240, 0.78));
    margin: 0 0 24px;
}
.wl-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    background: linear-gradient(180deg, #7df1c4 0%, #6ee7b7 100%);
    color: #06120e;
    border: 0;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.4) inset,
        0 -1px 0 rgba(0, 0, 0, 0.1) inset,
        0 4px 12px -2px rgba(110, 231, 183, 0.32),
        0 8px 24px -8px rgba(110, 231, 183, 0.4);
    transition:
        transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.wl-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.32) 50%, transparent 65%);
    transform: translateX(-100%);
    transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.wl-cta:hover {
    transform: translateY(-2px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 -1px 0 rgba(0, 0, 0, 0.1) inset,
        0 6px 16px -2px rgba(110, 231, 183, 0.45),
        0 12px 32px -8px rgba(110, 231, 183, 0.5);
}
.wl-cta:hover::before { transform: translateX(100%); }
.wl-cta:active { transform: translateY(0); }
.wl-cta svg {
    width: 18px;
    height: 18px;
    transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.wl-cta:hover svg { transform: translateX(3px); }

.wl-cta-secondary {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 18px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--mb-fg-secondary, rgba(226, 232, 240, 0.78));
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition:
        background 180ms cubic-bezier(0.16, 1, 0.3, 1),
        border-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
        color 180ms cubic-bezier(0.16, 1, 0.3, 1),
        transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.wl-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--mb-fg-primary, #e2e8f0);
    transform: translateY(-1px);
}
.wl-next .wl-cta + .wl-cta-secondary { display: block; }


/* =========================================================
   9. THANKS — three lines, intentional, human
   ========================================================= */
.wl-thanks {
    text-align: center;
    padding: 32px 24px 64px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 32px;
    animation: wlStaggerIn 600ms cubic-bezier(0.16, 1, 0.3, 1) 1000ms both;
}
.wl-thanks-line {
    font-size: 14px;
    line-height: 1.7;
    color: var(--mb-fg-secondary, rgba(226, 232, 240, 0.78));
    margin: 0 0 12px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}
.wl-thanks-line:last-child { margin-bottom: 0; }
.wl-thanks-final {
    color: var(--mb-mint, #6ee7b7);
    font-weight: 500;
    margin-top: 18px !important;
    text-shadow: 0 0 24px rgba(110, 231, 183, 0.25);
}


/* =========================================================
   10. WAITING + TIMEOUT states
   ========================================================= */
.wl-waiting {
    position: relative;
    text-align: center;
    padding: 80px 24px;
    animation: wlFadeIn 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.wl-spinner {
    display: inline-flex;
    gap: 6px;
    margin: 24px 0 16px;
}
.wl-spinner span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mb-mint, #6ee7b7);
    box-shadow: 0 0 8px rgba(110, 231, 183, 0.6);
    animation: wlSpinnerDot 1.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.wl-spinner span:nth-child(2) { animation-delay: 0.2s; }
.wl-spinner span:nth-child(3) { animation-delay: 0.4s; }
.wl-waiting-attempt {
    color: var(--mb-fg-muted, rgba(226, 232, 240, 0.5));
    font-size: 11px;
    letter-spacing: 0.04em;
    margin: 0;
}

.wl-timeout {
    text-align: center;
    padding: 64px 24px;
    animation: wlFadeIn 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.wl-timeout-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 24px;
    color: var(--mb-fg-muted, rgba(226, 232, 240, 0.5));
}
.wl-timeout-icon svg { width: 100%; height: 100%; }
.wl-timeout-help {
    font-size: 13px;
    line-height: 1.6;
    color: var(--mb-fg-muted, rgba(226, 232, 240, 0.65));
    margin: 0 0 28px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}
.wl-timeout-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.wl-link {
    color: var(--mb-mint, #6ee7b7);
    text-decoration: none;
    border-bottom: 1px solid rgba(110, 231, 183, 0.4);
    transition: border-color 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.wl-link:hover { border-color: var(--mb-mint, #6ee7b7); }


/* =========================================================
   11. KEYFRAMES
   ========================================================= */
@keyframes wlCelebrateIn {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.985);
        filter: blur(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes wlCelebratePulse {
    0%, 100% { /* base shadow handled by parent */ }
    35% {
        text-shadow: 0 0 60px rgba(110, 231, 183, 0.5);
    }
}

@keyframes wlOrbIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes wlOrbBreathe {
    0%, 100% { opacity: 1; transform: translate(-50%, -20%) scale(1); }
    50%      { opacity: 0.7; transform: translate(-50%, -20%) scale(1.05); }
}

@keyframes wlStaggerIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wlFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes wlPulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.9); }
}

@keyframes wlSpinnerDot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30%           { opacity: 1; transform: scale(1.1); }
}


/* =========================================================
   12. REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .wl-celebrate,
    .wl-celebrate-orb,
    .wl-waiting-orb,
    .wl-key-reveal,
    .wl-next,
    .wl-thanks,
    .wl-waiting,
    .wl-timeout,
    .wl-pulse-dot,
    .wl-spinner span {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
    }
    .wl-celebrate-orb,
    .wl-waiting-orb {
        opacity: 1;
    }
}


/* =========================================================
   13. MOBILE
   ========================================================= */
@media (max-width: 640px) {
    .wl-celebrate { padding-top: 48px; padding-bottom: 32px; }
    .wl-headline { font-size: 32px; }
    .wl-headline-secondary { font-size: 24px; }
    .wl-lead { font-size: 14px; margin-bottom: 28px; }

    .wl-stats {
        gap: 16px;
        padding: 14px 18px;
    }
    .wl-stat-val { font-size: 14px; }

    .wl-next { padding: 24px 20px; margin: 40px auto; }
    .wl-next-title { font-size: 22px; }

    .wl-key-reveal { padding: 20px; margin: 40px auto; }
    .wl-key-row { flex-direction: column; }
    .wl-copy-btn { justify-content: center; padding: 10px 14px; }

    .wl-celebrate-orb { width: 420px; height: 420px; }
    .wl-waiting-orb   { width: 320px; height: 320px; }
}
