/* ============================================================================
   onboarding.html — 4-step baseline wizard (/onboarding)
   Extracted from the inline <style> block (dissection refactor).
   base.css (loaded later via bars.html) wins all specificity ties.
   ========================================================================== */

:root {
    /* base.css :root already provides --accent/--accent-glow/--bg-body/
       --bg-surface/--bg-surface-2/--border/--text-primary/--text-secondary/
       --success/--error (it loads later and wins the tie), so this page's
       duplicates were dropped. --font is page-only. */
    --font: var(--global-font-main, 'Outfit', sans-serif);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

/* ─── SCREENS ─── */
/* base.css .screen supplies position:absolute/inset:0/opacity:0/pointer-events:none
   (its display:flex already won the tie over this rule's former display:none).
   NOTE: the fadeUp fill keeps inactive screens at opacity:1 — pre-existing
   quirk, kept byte-stable. */
.screen {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    animation: fadeUp 0.5s ease both;
}

/* Load-bearing: beats base.css .screen's display:flex for the active step. */
.screen.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── CARD ─── */
/* Page .card (and its 480px media override) dropped: every property it set
   (background/border/radius/padding/shadow/blur) loses the tie to base.css
   .card, which owns the card chrome at all widths. */

/* ─── PROGRESS BAR ─── */
.progress-track {
    height: 4px;
    background: var(--bg-surface-2);
    border-radius: 99px;
    margin-bottom: 32px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── TYPOGRAPHY ─── */
.step-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 12px;
}

h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 12px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
}

/* ─── ROLE CARDS ─── */
.role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.role-card {
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--bg-surface-2);
}

.role-card:hover {
    border-color: var(--accent);
    background: var(--bg-surface);
}

.role-card.selected {
    border-color: var(--accent);
    background: oklch(from var(--accent) l c h / 0.08);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.role-card .icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.role-card .title {
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.role-card .desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ─── AGE INPUT ─── */
.age-input-wrap {
    margin-bottom: 28px;
}

.age-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: block;
}

.age-stepper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.age-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: var(--bg-surface-2);
    font-size: 1.6rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.age-btn:hover {
    border-color: var(--accent);
    background: var(--bg-surface);
}

.age-val {
    font-size: 2.8rem;
    font-weight: 900;
    min-width: 72px;
    text-align: center;
    letter-spacing: -0.04em;
}

/* ─── BUTTONS ─── */
/* Markup uses bare .btn-primary/.btn-ghost (no .btn). base.css wins the ties
   (background/color/box-shadow + its own :hover), so the effective drift here
   is sizing/typography: width, padding, radius, font, letter-spacing. */
.btn-primary {
    width: 100%;
    padding: 18px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 18px;
    font-weight: 800;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 24px var(--accent-glow);
    letter-spacing: -0.02em;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--accent-glow);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    display: block;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    transition: color 0.2s;
    background: none;
    border: none;
    width: 100%;
}

.btn-ghost:hover {
    color: var(--text-primary);
}

/* ─── INFO PILLS ─── */
.info-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ─── N-BACK GAME EMBED ─── */
#game-embed {
    background: var(--bg-surface-2);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.grid-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 240px;
}

.grid-cell {
    aspect-ratio: 1;
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    transition: all 0.15s ease;
}

.grid-cell.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: scale(1.05);
}

.game-controls {
    display: flex;
    gap: 10px;
    width: 100%;
}

.btn-match {
    flex: 1;
    padding: 16px;
    border-radius: 16px;
    border: 2px solid var(--border);
    background: var(--bg-surface);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.btn-match:hover {
    border-color: var(--accent);
}

.btn-match.correct {
    background: oklch(65% 0.2 145 / 0.15);
    border-color: var(--success);
    color: var(--success);
}

.btn-match.wrong {
    background: oklch(58% 0.22 25 / 0.15);
    border-color: var(--error);
    color: var(--error);
}

.hud-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.hud-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-track-game {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill-game {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width 0.3s ease;
}

/* ─── RESULTS ─── */
.result-hero {
    text-align: center;
    padding: 24px;
    background: var(--bg-surface-2);
    border-radius: 20px;
    margin-bottom: 24px;
}

.percentile-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--accent) var(--pct, 0%), var(--bg-surface) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    position: relative;
}

.percentile-ring::before {
    content: '';
    position: absolute;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--bg-surface-2);
}

.percentile-num {
    position: relative;
    z-index: 1;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
}

.percentile-unit {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.insight-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.insight-box strong {
    color: var(--text-primary);
}

.real-world-box {
    background: oklch(from var(--accent) l c h / 0.06);
    border: 1px solid oklch(from var(--accent) l c h / 0.2);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.real-world-box .rw-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-bottom: 6px;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.breakdown-item {
    background: var(--bg-surface-2);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.breakdown-item .bi-val {
    font-size: 1.4rem;
    font-weight: 800;
}

.breakdown-item .bi-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 2px;
}

/* ─── TOMORROW CARD ─── */
.tomorrow-card {
    border: 2px solid var(--accent);
    border-radius: 20px;
    padding: 20px;
    background: oklch(from var(--accent) l c h / 0.05);
    margin-bottom: 24px;
}

.tomorrow-card .tc-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-bottom: 8px;
}

.tomorrow-card .tc-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.tomorrow-card .tc-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
