:root {
    --ap-primary: #1e1b4b;
    --ap-secondary: #6366f1;
    --ap-ink: #0f172a;
    --ap-muted: #475569;
    --ap-line: #e5e7eb;
    --ap-surface: #ffffff;
    --ap-canvas: #f8fafc;
    --ap-success: #16a34a;
    --pico-font-family: Inter, system-ui, sans-serif;
    --pico-primary: var(--ap-primary);
    --pico-primary-hover: #312e81;
    --pico-primary-focus: rgba(99, 102, 241, .2);
    --pico-primary-inverse: #fff;
    --pico-border-radius: 12px;
}

body {
    min-width: 320px;
    color: var(--ap-ink);
    background: radial-gradient(circle at 86% 9%, #e0e7ff 0, transparent 25rem), var(--ap-canvas);
}

.plan-section { scroll-margin-top: 1.5rem; }

.onboarding-shell { min-height: 100vh; display: flex; flex-direction: column; }
.onboarding-header { display: flex; align-items: center; justify-content: space-between; padding-block: 1.5rem; }
.wordmark { display: inline-flex; align-items: center; gap: .65rem; color: var(--ap-ink); font-family: "Space Grotesk", sans-serif; font-size: 1.1rem; font-weight: 700; text-decoration: none; }
.wordmark-logo { width: 2.2rem; height: 2.2rem; object-fit: contain; }
.logout-form { margin: 0; }
.logout-form button { width: auto; margin: 0; padding: .5rem .85rem; color: var(--ap-muted); background: transparent; border: 1px solid var(--ap-line); font-size: .8rem; font-weight: 600; }
.logout-form button:hover { color: var(--ap-primary); border-color: #c7d2fe; background: #eef2ff; }
.header-context, .fine-print, .secure-note { color: var(--ap-muted); font-size: .8rem; }
.onboarding-main { flex: 1; display: grid; align-items: center; padding-block: clamp(2rem, 8vh, 6rem); }
.onboarding-footer { padding-block: 1.5rem; color: var(--ap-muted); font-size: .75rem; }
h1, h2 { color: var(--ap-ink); font-family: "Space Grotesk", Inter, sans-serif; letter-spacing: -.035em; }
h1 { margin-bottom: 1.25rem; font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: .98; }
h2 { margin-bottom: .75rem; font-size: clamp(1.65rem, 3vw, 2.3rem); }
.eyebrow, .step-label { margin-bottom: .85rem; color: var(--ap-secondary); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.hero-grid, .setup-layout, .signup-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(20rem, .75fr); gap: clamp(2.5rem, 8vw, 8rem); align-items: center; }
.hero-copy h1 span { color: var(--ap-secondary); }
.hero-lede, .setup-intro > p, .completion-card > p { max-width: 38rem; color: var(--ap-muted); font-size: 1.1rem; line-height: 1.65; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2.5rem; }
.feature-grid div { border-top: 1px solid var(--ap-line); padding-top: 1rem; }
.feature-grid strong, .feature-grid span { display: block; }
.feature-grid strong { font-size: .9rem; }
.feature-grid span { margin-top: .3rem; color: var(--ap-muted); font-size: .82rem; line-height: 1.4; }
.queue-preview { max-width: 31rem; margin-top: 2.5rem; overflow: hidden; color: #e2e8f0; background: #11183b; border: 1px solid #2b376f; border-radius: 14px; box-shadow: 0 16px 34px rgba(15, 23, 42, .18); }
.queue-preview-head { display: flex; justify-content: space-between; align-items: center; padding: .85rem 1rem; color: #fff; border-bottom: 1px solid #2b376f; font-size: .78rem; font-weight: 600; }
.queue-preview-head b { padding: .2rem .45rem; color: #bbf7d0; background: rgba(34, 197, 94, .18); border-radius: 99px; font-size: .65rem; letter-spacing: .04em; text-transform: uppercase; }
.queue-row { display: grid; grid-template-columns: .45rem 1fr auto; gap: .65rem; align-items: center; padding: .72rem 1rem; border-bottom: 1px solid rgba(148, 163, 184, .14); font-size: .76rem; }
.queue-row:last-child { border-bottom: 0; }
.queue-row i { width: .4rem; height: .4rem; border-radius: 50%; background: #60a5fa; }
.queue-row:nth-child(3) i { background: #4ade80; }
.queue-row:nth-child(4) i { background: #c4b5fd; }
.queue-row small { color: #a5b4fc; font-size: .68rem; }
.trial-card, .form-card, .completion-card { margin: 0; padding: clamp(1.5rem, 4vw, 2.5rem); background: var(--ap-surface); border: 1px solid var(--ap-line); border-radius: 16px; box-shadow: 0 18px 45px rgba(15, 23, 42, .09); }
.trial-card h2 { margin-top: 0; }
.trial-card > p:not(.fine-print), .card-lede { color: var(--ap-muted); line-height: 1.6; }
.primary-action { width: 100%; margin-block: 1.25rem 0; border: 0; background: var(--ap-primary); font-weight: 700; }
.primary-action:hover { background: #312e81; }
.primary-action span { float: right; font-size: 1.2rem; line-height: .9; }
.setup-intro h1 { max-width: 28rem; font-size: clamp(2.3rem, 4vw, 3.8rem); }
.setup-steps { display: grid; gap: 1.15rem; padding: 0; margin: 2.5rem 0 0; list-style: none; }
.setup-steps li { display: flex; gap: .8rem; align-items: flex-start; color: #94a3b8; }
.setup-steps li > span { display: grid; width: 1.75rem; height: 1.75rem; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: .75rem; font-weight: 700; }
.setup-steps li.is-current { color: var(--ap-primary); }
.setup-steps strong, .setup-steps small { display: block; }
.setup-steps strong { font-size: .9rem; }
.setup-steps small { margin-top: .1rem; color: var(--ap-muted); font-size: .78rem; }
.form-card label { margin-top: 1.25rem; color: var(--ap-ink); font-size: .9rem; font-weight: 600; }
.form-card input, .form-card select { margin-top: .4rem; }
.field-error { display: block; min-height: 1.15rem; margin-top: .3rem; color: #dc2626; }
.field-hint { display: block; margin-top: .3rem; color: var(--ap-muted); font-size: .82rem; }
.alert-error { margin-top: 1.25rem; padding: .85rem 1rem; color: #991b1b; background: #fef2f2; border-left: 3px solid #dc2626; border-radius: 4px; font-size: .9rem; }
.secure-note { margin: 1.25rem 0 0; }
.secure-note span { color: var(--ap-success); font-weight: 700; }
.completion-card { max-width: 39rem; text-align: center; margin-inline: auto; }
.completion-card > p { margin-inline: auto; }
.completion-icon { display: grid; width: 3.5rem; height: 3.5rem; place-items: center; margin: 0 auto 1.5rem; color: #fff; background: var(--ap-success); border-radius: 50%; font-size: 1.6rem; font-weight: 700; }
.error-card { max-width: 34rem; }
.error-icon { display: grid; width: 3.5rem; height: 3.5rem; place-items: center; margin: 0 auto 1.5rem; color: #9f1239; background: #ffe4e6; border: 1px solid #fecdd3; border-radius: 50%; font-size: 1.6rem; font-weight: 700; }
.error-reference { margin: 1.5rem 0 0; color: var(--ap-muted); font-size: .75rem; }
.error-reference code { color: var(--ap-ink); background: #f1f5f9; }
.selected-plan-card { margin: 0; padding: clamp(1.5rem, 4vw, 2.5rem); background: radial-gradient(circle at top right, rgba(99, 102, 241, .15), transparent 44%), var(--ap-surface); border: 1px solid #c7d2fe; border-radius: 16px; box-shadow: 0 18px 45px rgba(15, 23, 42, .09); }
.selected-plan-card p { color: var(--ap-muted); line-height: 1.6; }
.selected-plan-card strong { color: var(--ap-ink); }
.secondary-link { display: block; margin-top: 1rem; color: var(--ap-primary); text-align: center; font-size: .85rem; font-weight: 600; }
.plan-section { margin-top: 5rem; }
.plan-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.75rem; }
.plan-section-heading h2 { margin: 0; }
.plan-section-heading > p { max-width: 25rem; margin: 0; color: var(--ap-muted); font-size: .9rem; }
.plan-grid { display: grid; grid-template-columns: repeat(5, minmax(12rem, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.plan-card { display: flex; min-width: 12rem; flex-direction: column; padding: 1.25rem; background: var(--ap-surface); border: 1px solid var(--ap-line); border-radius: 14px; }
.plan-card-available { border-color: #a5b4fc; box-shadow: 0 10px 24px rgba(79, 70, 229, .1); }
.plan-card-selected { background: linear-gradient(180deg, #fff 0%, #f5f7ff 100%); border-color: var(--ap-secondary); box-shadow: 0 14px 30px rgba(79, 70, 229, .16); }
.plan-card-heading { display: flex; align-items: start; justify-content: space-between; gap: .5rem; }
.plan-card h3 { margin: 0; color: var(--ap-ink); font-family: "Space Grotesk", sans-serif; font-size: 1.05rem; }
.availability-badge { padding: .2rem .35rem; color: #166534; background: #dcfce7; border-radius: 99px; font-size: .6rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.availability-muted { color: #64748b; background: #f1f5f9; }
.availability-selected { color: #fff; background: var(--ap-secondary); }
.plan-price { margin: 1.25rem 0 .2rem; color: var(--ap-ink); font-family: "Space Grotesk", sans-serif; font-size: 1.8rem; font-weight: 700; }
.plan-price small { color: var(--ap-muted); font-family: Inter, sans-serif; font-size: .72rem; font-weight: 500; }
.plan-allowance { min-height: 2.8rem; margin: 0; color: var(--ap-muted); font-size: .72rem; line-height: 1.45; }
.plan-card ul { flex: 1; padding: 0; margin: 1rem 0; list-style: none; }
.plan-card li { position: relative; padding: 0 0 .55rem 1rem; color: var(--ap-muted); font-size: .75rem; line-height: 1.35; }
.plan-card li::before { position: absolute; left: 0; color: var(--ap-secondary); content: "✓"; }
.plan-action { display: block; padding-top: .75rem; color: var(--ap-primary); border-top: 1px solid var(--ap-line); font-size: .8rem; font-weight: 700; text-decoration: none; }
.plan-action:hover { color: var(--ap-secondary); }
.plan-action-disabled { color: #94a3b8; cursor: not-allowed; }
.plan-action-selected { color: var(--ap-secondary); }

@media (max-width: 720px) {
    .header-context { display: none; }
    .hero-grid, .setup-layout, .signup-hero { grid-template-columns: 1fr; }
    .setup-intro { order: 1; }
    .form-card { order: 2; }
    .feature-grid { gap: 1rem; }
    .plan-section { margin-top: 3rem; }
    .plan-section-heading { display: block; }
    .plan-section-heading > p { margin-top: .75rem; }
}
