/* Public retirement check-up. Design tokens are copied from styles.css so the page matches the advisor app. */
:root {
  --bg: #f6f9fa;
  --bg-elevated: #fff;
  --bg-inset: #eef3f6;
  --text: #0d192d;
  --text-2: #3b4d61;
  --text-3: #5f7185;
  --line: #e0e8ee;
  --line-strong: #c9d5df;
  --accent: #0088cf;
  --accent-strong: #0074b1;          /* button fill: white text stays above 4.5:1 */
  --accent-strong-hover: #00629a;
  --accent-ink: #fff;
  --accent-text: #006ea8;
  --accent-soft: #0088cf14;
  --navy: #0a1f5c;
  --ok-text: #17734b;
  --warn-text: #9a5a14;
  --danger: #c4323c;
  --masthead: linear-gradient(165deg, #0a1f5c 0%, #0c2c56 55%, #15444d 100%);
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --font-ui: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --card-shadow: 0 0 0 1px var(--line), 0 1px 2px #0a1f5c0d;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.015em; }
p { margin: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.print-only { display: none; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 10px 14px; border-radius: var(--r-md); background: var(--bg-elevated); color: var(--text); font-weight: 600; box-shadow: var(--card-shadow); }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* ── Masthead ─────────────────────────────────────────── */
.masthead { background: var(--masthead); color: #eef4f9; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.firm { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; font-size: 15.5px; color: #fff; }
.firm-mark { width: 32px; height: 32px; display: grid; place-items: center; flex-shrink: 0; border-radius: var(--r-md); background: var(--accent-strong); color: var(--accent-ink); font: 700 14px/1 var(--font-mono); }
.firm-name { min-width: 0; overflow-wrap: anywhere; }
.masthead-tag { flex-shrink: 0; font: 500 11px/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: #b4c6d6; }

/* ── Intro and steps ──────────────────────────────────── */
#main { padding-top: 28px; padding-bottom: 40px; }
.intro { display: grid; gap: 12px; margin-bottom: 22px; }
.intro h1 { font-size: 32px; font-weight: 600; letter-spacing: -.025em; color: var(--navy); }
.lede { max-width: 64ch; font-size: 16.5px; color: var(--text-2); }
.badge { justify-self: start; display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font: 600 10.5px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--bg-elevated); box-shadow: 0 0 0 1px var(--line); font-size: 14px; color: var(--text-3); }
.step-num { width: 26px; height: 26px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--bg-inset); color: var(--text-2); font: 600 12px/1 var(--font-mono); }
.steps li[aria-current="step"] { color: var(--text); font-weight: 600; box-shadow: 0 0 0 2px var(--accent); }
.steps li[aria-current="step"] .step-num { background: var(--accent-strong); color: var(--accent-ink); }
.steps li.done { color: var(--text-2); }
.steps li.done .step-num { background: #17734b1a; color: var(--ok-text); }

/* ── Cards, buttons, messages ─────────────────────────── */
.card { min-width: 0; padding: 22px 24px; border-radius: var(--r-lg); background: var(--bg-elevated); box-shadow: var(--card-shadow); }
.step { scroll-margin-top: 12px; }
.step > h2 { font-size: 22px; font-weight: 600; color: var(--navy); }
.step-sub { margin-top: 6px; color: var(--text-2); font-size: 15px; }
.card-title { margin-bottom: 14px; font: 500 11px/1.3 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.card-body { display: grid; gap: 12px; }
.muted { color: var(--text-2); font-size: 14.5px; }
.fine { color: var(--text-3); font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-md); cursor: pointer; font: 600 12px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; text-align: center; transition: background-color .15s, box-shadow .15s, transform .1s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn-primary { background: var(--accent-strong); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong-hover); }
.btn-ghost { background: var(--bg-elevated); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-inset); }
.actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 20px; }

.msg:empty { margin: 0 !important; padding: 0 !important; border: 0 !important; }
.msg { margin-top: 14px; font-size: 14.5px; color: var(--text-2); }
.msg-error { padding: 12px 14px; border-left: 3px solid var(--danger); border-radius: var(--r-sm); background: #c4323c0f; color: var(--text); }
.msg-error ul { margin: 6px 0 0; padding-left: 18px; }
.msg-error a { color: var(--danger); font-weight: 500; }
.msg-title { font-weight: 600; color: var(--danger); }
#planErrors, #contactErrors { margin: 16px 0 4px; }

/* ── Step 1: quiz ─────────────────────────────────────── */
.progress { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; margin: 18px 0 20px; }
.seg { height: 6px; border-radius: 3px; background: var(--bg-inset); }
.seg.done { background: var(--accent); opacity: .45; }
.seg.current { background: var(--accent); }
.question { min-width: 0; margin: 0; padding: 0; border: 0; }
.question legend { display: grid; gap: 6px; width: 100%; margin-bottom: 14px; padding: 0; }
.q-count { font: 500 11px/1.3 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.q-text { font-size: 19px; font-weight: 600; line-height: 1.35; color: var(--text); }
.options { display: grid; gap: 8px; }
.option { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-elevated); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; font-size: 15.5px; transition: background-color .12s, box-shadow .12s; }
.option:hover { background: var(--bg-inset); }
.option input { width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--accent-strong); }
.option:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
@supports selector(:has(*)) {
  .option:has(input:focus-visible) { outline: 2px solid var(--accent-text); outline-offset: 2px; }
  .option input:focus-visible { outline: none; }
}

/* ── Step 2: form ─────────────────────────────────────── */
.group { min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }
.group legend { width: 100%; margin-bottom: 12px; padding: 0 0 8px; border-bottom: 1px solid var(--line); font: 500 11px/1.3 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 14.5px; font-weight: 600; color: var(--text); }
.optional { font-weight: 400; color: var(--text-3); }
.field input:not([type="checkbox"]), .field textarea { width: 100%; min-width: 0; height: 46px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); outline: none; background: var(--bg-elevated); font-size: 16px; font-variant-numeric: tabular-nums; transition: border-color .12s, box-shadow .12s; }
.field textarea { height: auto; min-height: 92px; padding: 10px 14px; line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: var(--danger) !important; }
.money { position: relative; }
.money > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.money input { padding-left: 28px !important; }
.hint { font-size: 13px; line-height: 1.45; color: var(--text-3); }
.hint-row { display: flex; justify-content: space-between; gap: 12px; }
.hint-row span:last-child { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.field-error { font-size: 13.5px; font-weight: 500; line-height: 1.45; color: var(--danger); }
.field-error:empty { display: none; }

/* ── Step 3: results ──────────────────────────────────── */
.results-head { display: grid; gap: 10px; margin-bottom: 16px; }
.results-head h2 { font-size: 26px; font-weight: 600; color: var(--navy); }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: 1 / -1; }
.profile-label { font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--navy); }
.score { display: grid; gap: 6px; }
.score-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; font-size: 14.5px; }
.score-head span { display: grid; font-weight: 600; }
.score-head small { font-weight: 400; font-size: 12.5px; color: var(--text-3); }
.score-head strong { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.meter, .bar { position: relative; display: block; height: 8px; overflow: hidden; border-radius: 4px; background: var(--bg-inset); }
.meter-fill, .bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); }
.alloc { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.alloc-row { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) 3.2em; align-items: center; gap: 12px; font-size: 14.5px; }
.alloc-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.rate { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.rate-value { font-size: 52px; font-weight: 600; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--navy); }
.tier { padding: 4px 10px; border-radius: 999px; font: 600 11px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.tier.strong { background: #17734b14; color: var(--ok-text); }
.tier.mid { background: #d7832f1f; color: var(--warn-text); }
.tier.low { background: #c4323c14; color: var(--danger); }
.chart { margin: 20px 0 0; }
.chart-box { width: 100%; min-height: 180px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid line { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--text-3); font: 11px var(--font-ui); font-variant-numeric: tabular-nums; }
.chart-band { fill: var(--accent); fill-opacity: .2; stroke: none; }
.chart-median { fill: none; stroke: var(--navy); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart-retire line { stroke: var(--text-3); stroke-width: 1.25; stroke-dasharray: 4 4; }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.chart-legend span:not(.key) { margin-right: 8px; }
.key { display: inline-block; flex-shrink: 0; width: 18px; }
.key-band { height: 10px; border-radius: 2px; background: var(--accent); opacity: .3; }
.key-median { height: 0; border-top: 2.5px solid var(--navy); }
.key-retire { height: 0; border-top: 1.5px dashed var(--text-3); }
.chart-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; }
.chart-summary div { padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-inset); }
.chart-summary dt { font: 500 10.5px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.chart-summary dd { margin: 4px 0 0; font-size: 14.5px; }

.discuss { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: point; }
.discuss li { position: relative; display: grid; gap: 4px; padding-left: 40px; counter-increment: point; }
.discuss li::before { content: counter(point); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font: 600 13px/1 var(--font-mono); }
.discuss strong { font-size: 15.5px; }
.discuss p { color: var(--text-2); font-size: 14.5px; }

.results-actions { justify-content: flex-start; margin: 18px 0 22px; }
.contact { display: grid; gap: 10px; margin-bottom: 16px; }
.contact-title { font-size: 20px; font-weight: 600; color: var(--navy); }
.contact .grid { margin-top: 6px; }
.contact form > .field { margin-top: 16px; }
.contact .actions { justify-content: flex-start; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--accent-strong); }
.check label { cursor: pointer; }
/* Honeypot: off-screen for people, still present for bots. */
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.thanks { display: grid; gap: 6px; padding: 14px 16px; border-left: 3px solid var(--ok-text); border-radius: var(--r-sm); background: #17734b0f; }
.thanks h4 { font-size: 17px; color: var(--ok-text); }
.unavailable { padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg-inset); color: var(--text); font-weight: 500; }
.contact-direct { margin-bottom: 16px; font-weight: 500; }

.disclosures { display: grid; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.disclosures .card-title { margin-bottom: 2px; }
.firm-disclosure { white-space: pre-line; }
.disclosures details { margin-top: 4px; }
.disclosures summary { cursor: pointer; font-weight: 600; color: var(--accent-text); }
.disclosures ul { margin: 8px 0 0; padding-left: 18px; }
.disclosures li + li { margin-top: 4px; }
.noscript { margin-bottom: 16px; }

.foot { padding-bottom: 32px; font-size: 13px; color: var(--text-3); }

/* ── Small screens ────────────────────────────────────── */
@media (max-width: 720px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  #main { padding-top: 22px; }
  .intro h1 { font-size: 27px; }
  .lede { font-size: 15.5px; }
  .masthead-tag { display: none; }
  .card { padding: 18px 16px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .steps li { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 4px; font-size: 12.5px; text-align: center; }
  .q-text { font-size: 17.5px; }
  .rate-value { font-size: 44px; }
  .chart-summary { grid-template-columns: minmax(0, 1fr); }
  .alloc-row { grid-template-columns: minmax(0, 1fr) 3.2em; gap: 4px 12px; }
  .alloc-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .actions .btn { flex: 1 1 auto; }
  .results-actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ── Print: results only ──────────────────────────────── */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .masthead { background: none; color: var(--text); border-bottom: 1px solid #b8c4ce; }
  .firm { color: var(--text); }
  .masthead-tag { display: block; color: var(--text-3); }
  .wrap { max-width: none; padding: 0; }
  #main { padding: 12px 0 0; }
  .skip, .intro, .steps, .actions, .contact, .contact-direct, #step-quiz, #step-plan, .foot, noscript { display: none !important; }
  .print-only { display: block; color: var(--text-3); font-size: 10pt; }
  .card { padding: 12px 14px; box-shadow: none; border: 1px solid #ccd6de; break-inside: avoid; }
  .results-grid { gap: 10px; }
  .disclosures { margin-top: 10px; }
  .disclosures details > summary { list-style: none; }
  .badge, .tier, .seg, .bar-fill, .meter-fill, .chart-band, .key, .chart-summary div, .discuss li::before, .firm-mark { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
