/* ==========================================================================
   Retirement quiz layer (retirement-quiz.html)
   design-refs: awesome-design-md/mercury, awesome-design-md/intercom
   Extends the shared v2 tokens in styles.css (owned by another lane; not edited):
   one raised white card over the sky hero, large light numerals for live values,
   hairline number rows, mono eyebrows, navy night CTA band.
   ========================================================================== */

.quiz-hero { padding-bottom: clamp(6rem, 4.5rem + 5vw, 9.5rem); }
.quiz-hero h1 { max-width: 14ch; }
.quiz-hero .lede { max-width: 44ch; }

.quiz-section { position: relative; z-index: 1; margin-top: clamp(-6rem, -2rem - 4vw, -3rem); padding-bottom: var(--section); }
.quiz-section [hidden] { display: none !important; }

.quiz-shell, .results-shell {
  max-width: 780px; margin-inline: auto; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-xl);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 34px 70px -40px rgba(7, 26, 51, 0.38);
  padding: clamp(1.4rem, 0.9rem + 2.4vw, 3rem);
  scroll-margin-top: 96px;
}
.results-shell { max-width: 1040px; }
.quiz-results { scroll-margin-top: 96px; }

/* Intro */
.quiz-promise { font-size: var(--step-1); line-height: 1.55; color: var(--ink); max-width: 54ch; margin-bottom: var(--s-6); }
.quiz-chips { list-style: none; margin: 0 0 var(--s-6); padding: 0; display: grid; gap: var(--s-2); }
@media (min-width: 640px) { .quiz-chips { grid-template-columns: 1fr 1fr; } }
.quiz-chips li { display: flex; gap: var(--s-3); align-items: baseline; padding: 0.7rem 0.9rem; background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r-md); font-size: 0.94rem; line-height: 1.45; color: var(--ink); }
.quiz-chips li::before { content: ''; flex: 0 0 6px; width: 6px; height: 6px; background: var(--navy); transform: translateY(-2px); }
.quiz-start { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--hairline); }
.quiz-start .btn { min-height: 52px; padding-inline: 1.6rem; }
.quiz-start-note { margin: 0; font-size: var(--step--1); color: var(--muted); max-width: 42ch; }
.quiz-noscript { margin-top: var(--s-5); }

/* Progress */
.q-progress { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); margin-bottom: var(--s-3); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.q-progress__est { color: var(--muted); }
.q-bar { height: 4px; background: var(--hairline); border-radius: var(--r-pill); overflow: hidden; margin-bottom: var(--s-6); }
.q-bar span { display: block; height: 100%; width: 0; background: var(--navy); border-radius: inherit; transition: width 0.4s var(--ease); }

/* Question */
.q-title { font-size: var(--step-3); line-height: 1.12; margin-bottom: var(--s-3); max-width: 24ch; }
.q-title:focus, #results-title:focus, .quiz-email__success:focus { outline: none; }
.q-why { color: var(--body); font-size: 0.98rem; line-height: 1.6; max-width: 58ch; margin-bottom: var(--s-6); }
.q-why__label { display: block; margin-bottom: var(--s-1); font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }

.q-number { padding: var(--s-5); background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.q-value { margin: 0 0 var(--s-2); font-size: var(--step-4); font-weight: 400; letter-spacing: -0.04em; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.q-range { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; }
.q-range::-webkit-slider-runnable-track { height: 6px; border-radius: var(--r-pill); background: linear-gradient(to right, var(--navy) 0, var(--navy) var(--pct, 50%), var(--silver) var(--pct, 50%), var(--silver) 100%); }
.q-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--navy); box-shadow: 0 2px 10px rgba(0, 30, 70, 0.25); transition: transform 0.15s var(--ease); }
.q-range:active::-webkit-slider-thumb { transform: scale(1.08); }
.q-range::-moz-range-track { height: 6px; border-radius: var(--r-pill); background: var(--silver); }
.q-range::-moz-range-progress { height: 6px; border-radius: var(--r-pill); background: var(--navy); }
.q-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--navy); box-shadow: 0 2px 10px rgba(0, 30, 70, 0.25); }
.q-range:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: var(--r-sm); }
.q-scale { display: flex; justify-content: space-between; gap: var(--s-4); font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); margin-bottom: var(--s-4); }
.q-type { gap: var(--s-2); }
.q-type .hint { margin: 0; }
.q-input-wrap { position: relative; max-width: 280px; }
.q-input-wrap input { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.q-input-wrap--money input { padding-left: 1.75rem; }
.q-prefix { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.q-error { margin: var(--s-4) 0 0; color: var(--error); font-weight: 500; font-size: 0.95rem; }

.q-check { display: inline-flex; align-items: center; gap: var(--s-3); min-height: 44px; margin-top: var(--s-4); font-weight: 500; color: var(--ink); cursor: pointer; }
.q-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--navy); cursor: pointer; }

.q-choices { display: grid; gap: var(--s-3); margin: 0; padding: 0; border: 0; min-width: 0; }
@media (min-width: 640px) { .q-choices--grid { grid-template-columns: 1fr 1fr; } }
.q-choice { position: relative; display: flex; align-items: center; gap: var(--s-4); min-height: 58px; padding: 0.85rem 1.1rem; background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--r-md); color: var(--ink); font-weight: 450; line-height: 1.35; cursor: pointer; transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease); }
.q-choice:hover { border-color: var(--navy); }
.q-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.q-choice__mark { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--muted); background: var(--surface); transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.q-choice input:checked + .q-choice__mark { border-color: var(--navy); box-shadow: inset 0 0 0 5px var(--surface), inset 0 0 0 11px var(--navy); }
.q-choice:has(input:checked) { border-color: var(--navy); background: var(--navy-tint); }
.q-choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.q-choice input:focus-visible + .q-choice__mark { box-shadow: 0 0 0 3px rgba(0, 66, 126, 0.3); }
.q-choice input:checked:focus-visible + .q-choice__mark { box-shadow: inset 0 0 0 5px var(--surface), inset 0 0 0 11px var(--navy), 0 0 0 3px rgba(0, 66, 126, 0.3); }
.q-reveal { margin: 0 0 var(--s-2); }
.q-subnote { margin: calc(var(--s-1) * -1) 0 var(--s-2); padding: var(--s-3) var(--s-4); background: var(--mist); border-radius: var(--r-sm); font-size: 0.9rem; line-height: 1.5; color: var(--ink); }

.q-nav { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--hairline); }
.q-nav #q-next { margin-left: auto; min-width: 9.5rem; }
.btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }
.btn[aria-disabled='true']:hover { background: var(--navy); }

/* Results */
.results-top { display: grid; gap: var(--s-6); }
@media (min-width: 860px) { .results-top { grid-template-columns: 320px minmax(0, 1fr); gap: var(--s-7); align-items: center; } }
.score-card { padding: var(--s-6) var(--s-5) var(--s-5); background: var(--sky-card); border-radius: var(--r-lg); text-align: center; }
.score-card__label { margin: 0 0 var(--s-3); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink); }
.dial { position: relative; max-width: 260px; margin-inline: auto; }
.dial svg { width: 100%; height: auto; overflow: visible; }
.dial__track, .dial__value { fill: none; stroke-width: 16; stroke-linecap: round; }
.dial__track { stroke: rgba(17, 24, 39, 0.12); }
.dial__value { stroke: var(--navy); stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.1s var(--ease); }
.dial__num { position: absolute; left: 0; right: 0; bottom: 2%; display: grid; justify-items: center; }
.dial__score { font-size: clamp(3rem, 2.4rem + 2vw, 4.1rem); font-weight: 450; letter-spacing: -0.05em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.dial__of { margin-top: var(--s-1); font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.band-pill { display: inline-flex; align-items: center; gap: var(--s-2); margin: var(--s-4) 0 0; padding: 0.4rem 0.95rem; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-pill); font-weight: 500; font-size: 0.97rem; color: var(--ink); }
.band-pill::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--navy); }
.band-pill--on_track::before { background: var(--success); }
.band-pill--gap::before { background: #9a5b00; }
.band-pill--talk::before { background: #8c2f2f; }
.band-scale { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.band-scale li { display: grid; gap: 6px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.02em; color: var(--muted); }
.band-scale li::before { content: ''; height: 4px; border-radius: var(--r-pill); background: rgba(17, 24, 39, 0.14); }
.band-scale li.is-active { color: var(--ink); font-weight: 500; }
.band-scale li.is-active::before { background: var(--navy); }

.results-summary h2 { font-size: var(--step-4); line-height: 1.06; max-width: 18ch; margin-bottom: var(--s-5); }
.results-summary p { color: var(--body); font-size: var(--step-0); line-height: 1.65; max-width: 60ch; }
.results-summary p:first-of-type { margin-top: 0; }
.quiz-change { background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }

.r-block { margin-top: var(--s-7); }
.r-block h3 { font-size: var(--step-2); margin-bottom: var(--s-4); }
.r-intro { color: var(--muted); margin-bottom: var(--s-4); }

.num-list { margin: 0; border-top: 1px solid var(--hairline-strong); }
.num-row { display: grid; gap: var(--s-1); padding-block: var(--s-4); border-bottom: 1px solid var(--hairline); }
.num-row dt { color: var(--body); font-size: 0.98rem; }
.num-row dd { margin: 0; display: grid; gap: 2px; }
.num-val { font-size: var(--step-2); font-weight: 500; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.num-sub { font-size: 0.9rem; color: var(--muted); }
@media (min-width: 760px) {
  .num-row { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: var(--s-6); align-items: baseline; }
  .num-row dd { text-align: right; }
}

.how { margin-top: var(--s-6); background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r-md); }
.how summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 56px; padding: 0 var(--s-5); list-style: none; cursor: pointer; font-weight: 500; color: var(--ink); border-radius: var(--r-md); }
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: '+'; font-family: var(--font-mono); font-size: 1.2rem; color: var(--navy); }
.how[open] summary::after { content: '−'; }
.how__body { padding: 0 var(--s-5) var(--s-5); max-width: none; font-size: 1rem; line-height: 1.65; }
.how__body ol { padding-left: 1.25em; }

.r-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.r-lines li { padding: var(--s-4) var(--s-5); background: var(--mist); border-left: 3px solid var(--navy); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink); line-height: 1.6; }

.r-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; border-top: 1px solid var(--hairline-strong); }
.r-steps li { counter-increment: step; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: var(--s-3); padding-block: var(--s-4); border-bottom: 1px solid var(--hairline); color: var(--ink); line-height: 1.6; }
.r-steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--navy); line-height: 2; }
.r-step__body { min-width: 0; }

.whatif-chips { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.whatif-chip { min-height: 44px; padding: 0.55rem 1.15rem; background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); font: 500 0.95rem/1.2 var(--font-sans); color: var(--ink); cursor: pointer; transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease); }
.whatif-chip:hover { border-color: var(--navy); color: var(--navy); }
.whatif-chip[aria-pressed='true'] { border-color: var(--navy); background: var(--navy); color: #fff; }
.whatif-out { margin: var(--s-4) 0 0; color: var(--ink); max-width: 62ch; }
.whatif-out:empty { display: none; }

.quiz-cta { margin-top: var(--s-8); display: grid; gap: var(--s-5); align-items: center; padding: clamp(1.5rem, 1rem + 2.5vw, 2.75rem); border-radius: var(--r-lg); }
@media (min-width: 720px) { .quiz-cta { grid-template-columns: auto minmax(0, 1fr); gap: var(--s-6); } }
.quiz-cta__photo { width: 104px; height: 104px; object-fit: cover; object-position: center 20%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.75); background: var(--navy-deep); }
.quiz-cta h3 { font-size: var(--step-3); margin: 0 0 var(--s-5); max-width: 22ch; }
.quiz-cta .eyebrow { margin-bottom: var(--s-3); }
.quiz-cta .btn { white-space: normal; }
.quiz-cta__note { margin: var(--s-4) 0 0; color: var(--on-dark-soft); font-size: 0.95rem; }

.quiz-email { margin-top: var(--s-6); }
.quiz-email .eyebrow { margin-bottom: var(--s-2); }
.quiz-email__title { font-size: var(--step-2); margin: 0; }
.quiz-email__phone { max-width: 420px; }
.quiz-email__actions { display: grid; gap: var(--s-3); justify-items: start; }
.quiz-email__actions .form-privacy { max-width: 72ch; }
.quiz-email__status { margin: 0; color: var(--ink); font-size: 0.95rem; }
.quiz-email__status:empty { display: none; }
.field-error { margin: 0; color: var(--error); font-size: 0.9rem; font-weight: 500; }
.quiz-email__success { margin-top: var(--s-6); padding: var(--s-5); background: #e8f2ec; border-left: 3px solid var(--success); border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--ink); }
.quiz-email__success p { margin: 0; }

.quiz-compliance { margin-top: var(--s-7); padding: var(--s-5) var(--s-6); background: var(--paper-deep); border-radius: var(--r-md); font-size: 0.92rem; line-height: 1.65; color: var(--body); }
.quiz-compliance h3 { font-size: var(--step-1); margin-bottom: var(--s-3); }
.quiz-compliance p { max-width: 92ch; }
.quiz-compliance p:last-child { margin-bottom: 0; }

/* Review-only self test panel (shown with the selftest hook) */
.quiz-selftest { max-width: 1040px; margin: 0 auto var(--s-5); padding: var(--s-4) var(--s-5); background: var(--surface); border: 2px dashed var(--navy); border-radius: var(--r-md); }
.quiz-selftest__title { margin: 0 0 var(--s-3); font-weight: 600; color: var(--ink); }
.selftest-list { list-style: none; margin: 0; padding: 0; columns: 3 280px; column-gap: var(--s-5); font-family: var(--font-mono); font-size: 0.7rem; line-height: 1.5; color: var(--success); }
.selftest-list li { break-inside: avoid; }
.selftest-list .is-fail { color: var(--error); font-weight: 600; }

@media (max-width: 480px) {
  .q-number { padding: var(--s-4); }
  .q-nav #q-next { min-width: 0; flex: 1 1 auto; }
  .quiz-compliance { padding: var(--s-4); }
}

@media print {
  .quiz-shell, .whatif-chips, .quiz-email, .quiz-change { display: none !important; }
  .quiz-cta { background: #fff; color: #000; }
}
