:root {
  --ink: #0d2a34;
  --muted: #5a6b72;
  --green: #207a6c;
  --green-dark: #195e53;
  --mint: #cdf0ea;
  --mint-soft: #eaf7f5;
  --paper: #f2f6f7;
  --white: #ffffff;
  --line: #d6e0e3;
  --navy: #0d2a34;
  --danger: #a23131;
  --shadow: 0 24px 70px rgba(13, 42, 52, .12);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { min-width: 320px; color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(circle at 85% 12%, rgba(201, 245, 238, .7), transparent 28rem), var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.quiz-header { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid rgba(13, 42, 52, .1); background: rgba(255,255,255,.94); padding: 0 clamp(1rem, 4vw, 3.5rem); backdrop-filter: blur(14px); }
.quiz-cobrand { display: inline-flex; align-items: center; gap: .8rem; min-width: 0; }
.quiz-brand { display: inline-flex; align-items: center; }
.quiz-brand img { display: block; width: 190px; height: auto; }
.secure-label { display: inline-flex; align-items: center; gap: .5rem; color: var(--green-dark); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.secure-label span { color: #32bda7; font-size: .72rem; }
.progress-track { position: sticky; top: 0; z-index: 20; height: 5px; background: #dfe7e6; }
.progress-track span { display: block; width: 5%; height: 100%; background: linear-gradient(90deg, #32bda7, var(--green)); transition: width .3s ease; }

.quiz-layout { width: min(1180px, calc(100% - 2rem)); min-height: calc(100vh - 77px); display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.5rem; align-items: start; margin: 0 auto; padding: clamp(1.5rem, 4vw, 4rem) 0; }
.quiz-card { min-height: 690px; overflow: hidden; border: 1px solid rgba(13, 42, 52, .11); border-radius: var(--radius); background: rgba(255,255,255,.97); box-shadow: var(--shadow); }
.quiz-card-topline { min-height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 1rem clamp(1.2rem, 4vw, 3.5rem) 0; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.quiz-card-topline p { margin: 0; }
.save-note { border: 0; background: transparent; padding: .35rem 0; color: var(--green-dark); cursor: pointer; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.save-note:hover { text-decoration: underline; }

.quiz-step { min-height: 540px; padding: clamp(1.5rem, 4vw, 3.2rem) clamp(1.2rem, 5vw, 4.5rem) 2rem; }
.step-heading { max-width: 680px; margin-bottom: 2rem; }
.step-eyebrow, .rail-eyebrow { margin: 0 0 .65rem; color: var(--green); font-size: .72rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.step-heading h1 { max-width: 690px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.1rem, 5vw, 3.75rem); font-weight: 500; letter-spacing: -.045em; line-height: 1.02; outline: 0; }
.step-note { max-width: 650px; margin: 1rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 0; border: 0; padding: 0; }
.choice-group { grid-column: 1 / -1; margin: .7rem 0 -.1rem; color: #526461; font-size: .68rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.choice-group:first-of-type { margin-top: 0; }
.choice-card { position: relative; min-height: 86px; display: flex; align-items: flex-start; gap: .8rem; border: 2px solid var(--line); border-radius: 16px; background: var(--white); padding: 1rem; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease; }
.choice-card:hover { border-color: #8bc9bf; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(13, 42, 52, .07); }
.choice-card:has(input:focus-visible) { outline: 3px solid rgba(50, 189, 167, .22); outline-offset: 2px; }
.choice-card:has(input:checked) { border-color: var(--green); background: var(--mint-soft); box-shadow: inset 0 0 0 1px var(--green); }
.choice-card input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice-control { width: 21px; height: 21px; flex: 0 0 21px; display: grid; place-items: center; border: 2px solid #9baaa8; border-radius: 50%; margin-top: .1rem; background: #fff; }
.choice-card:has(input:checked) .choice-control { border: 6px solid var(--green); }
.choice-copy { display: grid; gap: .3rem; padding-right: 1.1rem; }
.choice-badge { width: max-content; max-width: 100%; border-radius: 999px; background: var(--green); padding: .3rem .55rem; color: #fff; font-size: .58rem; font-weight: 900; letter-spacing: .07em; line-height: 1; text-transform: uppercase; }
.choice-copy strong { font-size: .94rem; line-height: 1.25; }
.choice-copy small { color: var(--muted); font-size: .77rem; line-height: 1.35; }
.choice-arrow { position: absolute; right: .9rem; top: 50%; color: #9baaa8; transform: translateY(-50%); }
.choice-card:has(input:checked) .choice-arrow { color: var(--green); }
.purpose-grid .choice-card { min-height: 78px; }
.purpose-grid .choice-card-featured { grid-column: 1 / -1; min-height: 98px; align-items: center; border-color: #7fc8bc; background: linear-gradient(135deg, #e6f8f5, #fff); box-shadow: 0 10px 25px rgba(50, 189, 167, .1); }
.purpose-grid .choice-card-featured .choice-control { border-color: var(--green); }
.purpose-grid .choice-card-featured .choice-copy strong { font-size: 1.08rem; }

.range-panel { max-width: 700px; border: 1px solid #cfe0dd; border-radius: 22px; background: linear-gradient(145deg, #effaf8, #fff); padding: clamp(1.4rem, 4vw, 2.4rem); }
.range-value { display: block; margin-bottom: 1.6rem; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 9vw, 5rem); letter-spacing: -.055em; line-height: 1; }
.range-input { --range-progress: 20%; width: 100%; height: 10px; appearance: none; border-radius: 999px; background: linear-gradient(90deg, var(--green) 0 var(--range-progress), #d5e1df var(--range-progress) 100%); cursor: pointer; }
.range-input::-webkit-slider-thumb { width: 30px; height: 30px; appearance: none; border: 7px solid var(--green); border-radius: 50%; background: #fff; box-shadow: 0 3px 10px rgba(13, 42, 52, .22); }
.range-input::-moz-range-thumb { width: 18px; height: 18px; border: 7px solid var(--green); border-radius: 50%; background: #fff; box-shadow: 0 3px 10px rgba(13, 42, 52, .22); }
.range-labels { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; color: var(--muted); font-size: .75rem; font-weight: 700; }
.income-helper { margin: 1.6rem 0 0; border-top: 1px solid #d7e9e6; padding-top: 1rem; color: var(--muted); font-size: .86rem; }
.income-helper strong { color: var(--ink); }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field-wide { grid-column: 1 / -1; }
.field-wrap { display: grid; gap: .45rem; color: var(--ink); font-size: .73rem; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.field-label { min-height: 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem; line-height: 1; }
.field-label > span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.verify-status { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .62rem; font-weight: 700; line-height: 1; letter-spacing: normal; white-space: nowrap; text-transform: none; }
.verify-status::before { flex: 0 0 auto; box-sizing: border-box; }
.verify-status.is-loading::before { width: .7rem; height: .7rem; border: 2px solid #bdd1ce; border-top-color: var(--green); border-radius: 50%; content: ""; animation: verify-spin .7s linear infinite; }
.verify-status.is-valid { color: var(--green-dark); }
.verify-status.is-valid::before { content: "✓"; font-weight: 900; }
.verify-status.is-invalid { color: #b42318; }
.verify-status.is-invalid::before { content: "✕"; font-weight: 900; }
@keyframes verify-spin { to { transform: rotate(360deg); } }
.field-wrap input { width: 100%; min-height: 54px; border: 1.5px solid #cdd7d5; border-radius: 13px; background: #fff; padding: .8rem .9rem; color: var(--ink); font-size: 1rem; font-weight: 500; letter-spacing: normal; text-transform: none; outline: 0; }
.field-wrap input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(50, 189, 167, .1); }
.field-wrap input:invalid:not(:placeholder-shown) { border-color: #bf7777; }
.field-wrap input[aria-invalid="true"] { border-color: #b42318; box-shadow: 0 0 0 3px rgba(180,35,24,.08); }
.field-error { min-height: 1em; color: #b42318; font-size: .68rem; font-weight: 700; letter-spacing: normal; line-height: 1.3; text-transform: none; }
.pac-container { z-index: 1000; border: 1px solid #cdd7d5; border-radius: 10px; font-family: inherit; box-shadow: 0 12px 30px rgba(13, 42, 52, .14); }
.expense-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 1rem; align-items: start; }
.expense-fields { gap: .75rem; }
.money-input { position: relative; display: block; }
.money-input b { position: absolute; left: .9rem; top: 50%; color: var(--muted); font-size: 1rem; transform: translateY(-50%); }
.money-input input { padding-left: 2rem; }
.breathing-room { min-height: 210px; display: flex; flex-direction: column; justify-content: center; border-radius: 18px; background: var(--navy); padding: 1.35rem; color: #fff; }
.breathing-room span { color: #bde9e2; font-size: .72rem; font-weight: 800; line-height: 1.4; text-transform: uppercase; }
.breathing-room strong { margin: .7rem 0; font-family: Georgia, "Times New Roman", serif; font-size: 2.45rem; font-weight: 500; letter-spacing: -.04em; }
.breathing-room strong.negative { color: #ffb9b9; }
.breathing-room small { color: #c7d8d5; font-size: .72rem; line-height: 1.45; }

.review-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-bottom: 1rem; }
.review-summary div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.review-summary div { min-height: 70px; display: grid; gap: .3rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: .8rem 1rem; }
.review-summary span { color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.review-summary strong { overflow-wrap: anywhere; font-size: .88rem; }
.consent-panel { border: 1px solid #ccd6d4; border-radius: 15px; background: var(--paper); padding: 1rem 1.1rem; color: #4f5f5c; font-size: .77rem; line-height: 1.55; }
.consent-panel p { margin: 0; }
.consent-panel a { color: var(--green-dark); font-weight: 850; }
.risk-note { margin: .8rem 0 0; color: #6c7a78; font-size: .7rem; line-height: 1.5; }
.econsent-badge { display: block; width: auto; height: 37px; margin: .75rem auto 0; }
.submit-error { border: 1px solid #e4baba; border-radius: 11px; background: #fff0f0; padding: .8rem; color: var(--danger); font-size: .82rem; font-weight: 700; }

.quiz-actions { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: space-between; gap: .8rem; border-top: 1px solid #e0e5e4; background: rgba(255,255,255,.97); padding: 1rem clamp(1.2rem, 5vw, 4.5rem) 1.2rem; backdrop-filter: blur(12px); }
.quiz-actions button { min-height: 50px; border-radius: 13px; padding: .75rem 1.25rem; cursor: pointer; font-weight: 850; }
.back-button { border: 1px solid #cad4d2; background: #fff; color: var(--ink); }
.back-button:disabled { opacity: 0; pointer-events: none; }
.continue-button { min-width: 190px; margin-left: auto; border: 0; background: linear-gradient(135deg, #207a6c, #195e53); color: #fff; box-shadow: 0 9px 20px rgba(5, 107, 91, .2); }
.continue-button:hover { background: var(--green-dark); }
.continue-button:focus-visible, .back-button:focus-visible, .save-note:focus-visible { outline: 3px solid rgba(50, 189, 167, .26); outline-offset: 3px; }
.continue-button:disabled { opacity: .65; cursor: wait; }

.path-rail { position: sticky; top: 2rem; overflow: hidden; border-radius: var(--radius); background: var(--navy); padding: 2rem; color: #fff; box-shadow: var(--shadow); }
.path-rail .rail-eyebrow { color: #32bda7; }
.path-rail h2 { margin: 0 0 1.5rem; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 500; letter-spacing: -.035em; line-height: 1.08; }
.path-list { display: grid; gap: .65rem; }
.path-list article { display: grid; grid-template-columns: 32px 1fr; gap: .7rem; align-items: start; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: .8rem; color: #9fb7b3; transition: background .2s ease, color .2s ease, border .2s ease; }
.path-list article > span { color: #6e8b86; font-size: .68rem; font-weight: 900; }
.path-list article div { display: grid; gap: .25rem; }
.path-list article strong { font-size: .86rem; }
.path-list article small { color: inherit; font-size: .7rem; line-height: 1.35; }
.path-list article.path-active { border-color: rgba(50, 189, 167, .52); background: rgba(50, 189, 167, .13); color: #fff; }
.path-list article.path-active > span { color: #32bda7; }
.rail-trust { display: flex; gap: .75rem; margin-top: 1.4rem; border-top: 1px solid rgba(255,255,255,.14); padding-top: 1.3rem; }
.rail-trust > span { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border-radius: 50%; background: #32bda7; color: var(--navy); font-size: .78rem; font-weight: 900; }
.rail-trust p { margin: 0; color: #bdcecb; font-size: .74rem; line-height: 1.45; }
.rail-trust strong { color: #fff; }

.quiz-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid rgba(13, 42, 52, .1); padding: 1.5rem max(1rem, calc((100% - 1180px) / 2)); color: var(--muted); font-size: .72rem; }
.quiz-footer p { margin: 0; }
.quiz-footer nav { display: flex; gap: 1rem; }
.quiz-footer a:hover { color: var(--green); }

.step-shake { animation: shake .25s ease; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

@media (max-width: 900px) {
  .quiz-layout { grid-template-columns: 1fr; width: min(760px, calc(100% - 1.5rem)); padding-top: 1rem; }
  .path-rail { position: static; order: -1; padding: 1rem 1.2rem; }
  .path-rail h2, .rail-trust { display: none; }
  .path-rail .rail-eyebrow { margin-bottom: .7rem; }
  .path-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .path-list article { min-height: 60px; display: flex; align-items: center; justify-content: center; padding: .6rem; text-align: center; }
  .path-list article > span, .path-list article small { display: none; }
  .path-list article strong { font-size: .72rem; }
}

@media (max-width: 600px) {
  body { padding-bottom: 82px; background: #fff; }
  .quiz-header { height: 59px; padding: 0 .9rem; }
  .quiz-brand img { width: 148px; }
  .quiz-cobrand { gap: .45rem; }
  .secure-label { font-size: .61rem; letter-spacing: .045em; }
  .progress-track { height: 4px; }
  .quiz-layout { width: 100%; min-height: calc(100vh - 63px); display: block; padding: 0; }
  .path-rail { border-radius: 0; box-shadow: none; padding: .7rem .8rem; }
  .path-rail .rail-eyebrow { display: none; }
  .path-list { gap: .35rem; }
  .path-list article { min-height: 36px; border-radius: 9px; padding: .35rem; }
  .path-list article strong { font-size: .59rem; line-height: 1.15; }
  .quiz-card { min-height: auto; overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
  .quiz-card-topline { min-height: 38px; padding: .75rem 1rem 0; font-size: .61rem; }
  .save-note { font-size: .61rem; }
  .quiz-step { min-height: auto; padding: 1.1rem 1rem 1.5rem; }
  .step-heading { margin-bottom: 1.2rem; }
  .step-eyebrow { margin-bottom: .45rem; font-size: .61rem; }
  .step-heading h1 { font-size: clamp(2rem, 10vw, 2.65rem); }
  .step-note { margin-top: .7rem; font-size: .86rem; line-height: 1.45; }
  .choice-grid { grid-template-columns: 1fr; gap: .55rem; }
  .choice-group { margin: .55rem 0 -.15rem; font-size: .58rem; }
  .choice-card, .purpose-grid .choice-card { min-height: 67px; align-items: center; border-radius: 13px; padding: .72rem .8rem; }
  .choice-control { width: 19px; height: 19px; flex-basis: 19px; }
  .choice-copy { gap: .15rem; }
  .choice-copy strong { font-size: .83rem; }
  .choice-copy small { font-size: .68rem; }
  .range-panel { border-radius: 17px; padding: 1.25rem 1rem; }
  .range-value { margin-bottom: 1.4rem; font-size: 3.4rem; }
  .range-labels { font-size: .64rem; }
  .field-grid, .expense-layout { grid-template-columns: 1fr; gap: .75rem; }
  .field-wide { grid-column: auto; }
  .field-wrap { font-size: .64rem; }
  .field-wrap input { min-height: 48px; border-radius: 11px; font-size: .93rem; }
  .breathing-room { min-height: 120px; padding: 1rem; }
  .breathing-room strong { margin: .35rem 0; font-size: 2rem; }
  .review-summary { grid-template-columns: 1fr 1fr; gap: .45rem; }
  .review-summary div { min-height: 60px; padding: .65rem .7rem; }
  .review-summary span { font-size: .56rem; }
  .review-summary strong { font-size: .72rem; }
  .consent-panel { border-radius: 12px; padding: .8rem; font-size: .68rem; line-height: 1.5; }
  .risk-note { font-size: .62rem; }
  .econsent-badge { height: 30px; }
  .quiz-actions { position: fixed; right: 0; bottom: 0; left: 0; z-index: 50; min-height: 76px; align-items: center; background: rgba(255,255,255,.98); padding: .7rem max(.8rem, env(safe-area-inset-right)) max(.7rem, env(safe-area-inset-bottom)) max(.8rem, env(safe-area-inset-left)); box-shadow: 0 -10px 30px rgba(13, 42, 52, .1); }
  .quiz-actions button { min-height: 49px; border-radius: 12px; }
  .continue-button { min-width: 0; flex: 1; }
  .back-button { width: 82px; }
  .quiz-footer { display: grid; justify-items: center; padding: 1.3rem 1rem; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
