:root {
  color-scheme: light;
  --ink: #17313b;
  --muted: #60747c;
  --navy: #123a4a;
  --navy-2: #1d5364;
  --sea: #278776;
  --sea-soft: #dff3ec;
  --sky: #e8f2f6;
  --gold: #e9a846;
  --paper: #ffffff;
  --ground: #edf3f4;
  --line: #d5e0e3;
  --danger: #a54337;
  --shadow: 0 18px 50px rgba(26, 64, 76, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font-size: 16px; line-height: 1.65; }
a { color: inherit; }
button, input { font: inherit; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 20; background: var(--paper); padding: .75rem 1rem; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.site-header { min-height: 74px; padding: .75rem clamp(1rem, 4vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--navy); color: white; }
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.3); border-radius: 14px 14px 14px 5px; background: linear-gradient(145deg, var(--sea), var(--navy-2)); font-family: Georgia, serif; font-size: 1.45rem; }
.brand strong, .brand small { display: block; line-height: 1.25; }
.brand strong { font-family: Georgia, serif; font-size: 1.25rem; letter-spacing: .02em; }
.brand small { opacity: .72; font-size: .75rem; }
.header-contact { display: flex; gap: .55rem; align-items: center; font-size: .875rem; }
.header-contact a { text-decoration: none; }
.header-contact a:hover { text-decoration: underline; }

.prototype-note { padding: .55rem 1rem; text-align: center; background: #fff4d9; color: #62440f; border-bottom: 1px solid #efd69a; font-size: .875rem; }
.accessibility-bar { min-height: 46px; padding: .45rem clamp(1rem, 4vw, 3rem); display: flex; justify-content: flex-end; align-items: center; gap: .5rem; color: var(--muted); background: white; border-bottom: 1px solid var(--line); font-size: .82rem; font-weight: 700; }
.accessibility-bar button { min-height: 34px; padding: .35rem .65rem; color: var(--navy); background: var(--sky); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.accessibility-bar button[aria-pressed="true"] { color: white; background: var(--navy); border-color: var(--navy); }
.accessibility-bar button:focus-visible { outline: 3px solid rgba(39,135,118,.35); outline-offset: 2px; }

.app-shell { width: min(1180px, calc(100% - 2rem)); margin: 2rem auto 3rem; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.step-sidebar { position: sticky; top: 1.25rem; padding: 1.2rem; background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.92); border-radius: 18px; box-shadow: 0 8px 28px rgba(26,64,76,.08); backdrop-filter: blur(12px); }
.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: .82rem; font-weight: 650; }
.progress-track { height: 6px; margin: .6rem 0 1rem; overflow: hidden; border-radius: 99px; background: var(--line); }
.progress-track span { display: block; height: 100%; width: 11%; background: linear-gradient(90deg, var(--sea), var(--gold)); border-radius: inherit; transition: width .25s ease; }
#step-nav { display: grid; gap: .25rem; }
.nav-step { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .55rem .65rem; text-align: left; color: var(--muted); background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.nav-step:hover { background: var(--sky); color: var(--ink); }
.nav-step[aria-current="step"] { color: var(--navy); background: var(--sea-soft); font-weight: 700; }
.nav-step span { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); font-size: .73rem; }
.nav-step[aria-current="step"] span { color: white; background: var(--sea); border-color: var(--sea); }
.revision { margin: 1rem .65rem 0; color: var(--muted); font-size: .75rem; }

.form-card { min-height: 670px; overflow: hidden; background: var(--paper); border: 1px solid rgba(255,255,255,.9); border-radius: 22px; box-shadow: var(--shadow); }
#step-content { padding: clamp(1.5rem, 5vw, 3.75rem); min-height: 575px; }
.step { display: none; max-width: 780px; animation: rise .22s ease; }
.step.is-active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.eyebrow { margin: 0 0 .45rem; color: var(--sea); font-size: .78rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; }
h1, h2 { margin: 0 0 1rem; font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
h1 { max-width: 650px; font-size: clamp(2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.65rem); }
h3 { margin: 1.7rem 0 .55rem; font-size: 1.05rem; }
p { margin: .5rem 0 1rem; }
.lead { max-width: 700px; color: #405b64; font-size: 1.1rem; }
ul { margin: .65rem 0 1rem; padding-left: 1.25rem; }
li { margin: .38rem 0; padding-left: .2rem; }
.muted { color: var(--muted); font-size: .9rem; }

.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem; margin: 2rem 0; }
.summary-grid article { padding: 1rem; border-radius: 14px; background: var(--sky); border: 1px solid #d8e8ed; }
.summary-grid span, .emergency-card span { display: block; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.summary-grid strong { display: block; margin: .15rem 0; color: var(--navy); }
.summary-grid p { margin: 0; color: var(--muted); font-size: .88rem; }
.callout, .choice-note, .risk-card { padding: 1rem 1.1rem; margin: 1.25rem 0; border-radius: 14px; }
.callout { background: #fff8e9; border-left: 4px solid var(--gold); }
.choice-note { background: var(--sea-soft); border-left: 4px solid var(--sea); }
.risk-card { background: #fff4f1; border: 1px solid #f1d3cc; }
.callout p, .risk-card p { margin-bottom: 0; }
.check-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .55rem; margin-top: .8rem; }
.check-list span { position: relative; padding: .7rem .75rem .7rem 2.1rem; background: var(--sky); border-radius: 10px; font-size: .92rem; }
.check-list span::before { content: "✓"; position: absolute; left: .75rem; color: var(--sea); font-weight: 900; }
.fee-table { overflow: hidden; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: 13px; }
.fee-table div { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; }
.fee-table div + div { border-top: 1px solid var(--line); }
.fee-table strong { color: var(--navy); }
.emergency-card { padding: 1rem 1.2rem; margin: 1.25rem 0; color: white; background: var(--navy); border-radius: 14px; }
.emergency-card span { color: #9fd6ca; }
.emergency-card strong { display: block; margin: .25rem 0; font-size: 1.12rem; }
.emergency-card p { margin-bottom: 0; opacity: .78; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.25rem; }

.acknowledgments { display: grid; gap: .65rem; margin: 1.4rem 0; }
.acknowledgments label, .final-check { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.acknowledgments label:has(input:checked), .final-check:has(input:checked) { background: var(--sea-soft); border-color: #8bc8b9; }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin-top: .15rem; accent-color: var(--sea); }
.signature-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: .85rem; margin: 1.4rem 0; }
.signature-grid label { color: var(--muted); font-size: .82rem; font-weight: 750; }
.signature-field { grid-column: 1 / -1; }
.signature-grid input { display: block; width: 100%; margin-top: .35rem; padding: .78rem .85rem; color: var(--ink); background: white; border: 1px solid #b9cbd0; border-radius: 10px; }
.signature-grid input:focus { outline: 3px solid rgba(39,135,118,.18); border-color: var(--sea); }
.privacy-reminder { padding: .8rem 1rem; margin-top: 1rem; color: var(--muted); background: #f5f8f9; border-radius: 10px; font-size: .85rem; }
.validation-message { margin-top: 1rem; color: var(--danger); font-weight: 700; }

.form-actions { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1.5rem, 5vw, 3.75rem); border-top: 1px solid var(--line); background: #fbfcfc; }
.button { min-width: 118px; min-height: 44px; padding: .7rem 1rem; border: 0; border-radius: 11px; font-weight: 750; cursor: pointer; transition: transform .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(39,135,118,.3); outline-offset: 2px; }
.button.primary { margin-left: auto; color: white; background: var(--navy); }
.button.primary:hover { background: var(--navy-2); }
.button.secondary { color: var(--navy); background: var(--sky); }
.button[hidden] { display: none; }

body.large-text { font-size: 19px; }
body.large-text .app-shell { width: min(1260px, calc(100% - 2rem)); grid-template-columns: 275px minmax(0, 1fr); }
body.high-contrast {
  --ink: #000000;
  --muted: #202020;
  --navy: #001f2b;
  --navy-2: #00384a;
  --sea: #006b55;
  --sea-soft: #d8fff1;
  --sky: #edf9ff;
  --gold: #9b5d00;
  --paper: #ffffff;
  --ground: #ffffff;
  --line: #333333;
}
body.high-contrast .form-card, body.high-contrast .step-sidebar { border: 2px solid #000; box-shadow: none; }
body.high-contrast a { text-decoration: underline; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }

.success-state { min-height: 670px; padding: clamp(2rem, 7vw, 5rem); text-align: center; }
.success-icon { display: grid; place-items: center; width: 70px; height: 70px; margin: 0 auto 1.25rem; color: white; background: var(--sea); border-radius: 50%; font-size: 2rem; }
.success-state h2 { max-width: 600px; margin-inline: auto; }
.success-state > p { max-width: 650px; margin-inline: auto; }
.success-details { max-width: 560px; margin: 1.5rem auto; padding: 1rem; text-align: left; background: var(--sky); border-radius: 12px; }
.success-actions { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; }

@media (max-width: 850px) {
  .app-shell { grid-template-columns: 1fr; margin-top: 1rem; }
  .step-sidebar { position: static; padding: .9rem; }
  #step-nav { display: flex; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: thin; }
  .nav-step { flex: 0 0 auto; width: auto; white-space: nowrap; }
  .revision { display: none; }
}

@media (max-width: 590px) {
  body { font-size: 15px; }
  .site-header { align-items: flex-start; }
  .header-contact { display: grid; gap: 0; text-align: right; }
  .header-contact > span { display: none; }
  .prototype-note { text-align: left; }
  .accessibility-bar { justify-content: flex-start; overflow-x: auto; }
  .accessibility-bar > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .app-shell { width: min(100% - 1rem, 1180px); }
  .form-card { border-radius: 16px; }
  #step-content { padding: 1.35rem; min-height: 560px; }
  .summary-grid, .check-list, .two-col, .signature-grid { grid-template-columns: 1fr; }
  .signature-field { grid-column: auto; }
  .form-actions { padding: .85rem 1.2rem; }
  .button { min-width: 100px; }
}

@media print {
  body { background: white; }
  .site-header, .prototype-note, .accessibility-bar, .step-sidebar, .form-actions, .success-actions { display: none !important; }
  .app-shell { display: block; width: 100%; margin: 0; }
  .form-card { min-height: 0; box-shadow: none; border: 0; }
  #consent-form { display: none !important; }
  .success-state { display: block !important; min-height: 0; padding: 1rem; }
  .success-icon { width: 42px; height: 42px; font-size: 1.2rem; }
}

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