:root {
  --navy: #102a43;
  --navy-2: #173f5f;
  --blue: #2878b8;
  --sky: #eaf4fb;
  --mint: #25a18e;
  --cream: #f8f6f0;
  --ink: #172b3a;
  --muted: #667a89;
  --line: #dbe4ea;
  --white: #fff;
  --danger: #bb3e3e;
  --shadow: 0 18px 50px rgba(16, 42, 67, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: #f3f6f8; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 286px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 286px; padding: 28px 22px; display: flex; flex-direction: column; color: white; background: var(--navy); z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--mint); font-weight: 900; letter-spacing: -.05em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .08em; }
.brand small { margin-top: 2px; color: #aac2d2; font-size: 10px; letter-spacing: .03em; }

.progress-card { margin: 28px 0 18px; padding: 16px; border-radius: 14px; background: rgba(255,255,255,.08); }
.progress-card__top { display: flex; justify-content: space-between; font-size: 12px; }
.progress-track { height: 5px; margin: 12px 0 9px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.14); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--mint); transition: width .25s ease; }
.progress-card small { color: #9eb8c9; font-size: 10px; }
.section-nav { flex: 1; overflow-y: auto; padding-right: 3px; }
.nav-item { width: 100%; min-height: 39px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 9px; color: #b9ccda; background: transparent; text-align: left; font-size: 12px; }
.nav-item:hover, .nav-item.is-active { color: white; background: rgba(255,255,255,.09); }
.nav-item__number { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; font-size: 9px; }
.nav-item.is-complete .nav-item__number { border-color: var(--mint); color: white; background: var(--mint); }
.sidebar-footer { padding-top: 16px; display: grid; gap: 8px; border-top: 1px solid rgba(255,255,255,.1); }

.main { grid-column: 2; min-width: 0; }
.topbar { min-height: 86px; padding: 17px 38px; display: flex; align-items: center; gap: 18px; position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.topbar h1 { margin: 2px 0 0; font-size: 22px; letter-spacing: -.03em; }
.eyebrow { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.local-badge { color: var(--muted); font-size: 11px; }
.local-badge i { width: 7px; height: 7px; margin-right: 6px; display: inline-block; border-radius: 50%; background: var(--mint); }
.menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.content { width: min(1060px, calc(100% - 56px)); margin: 0 auto; padding: 38px 0 90px; }

.form-page { display: none; animation: enter .25s ease both; }
.form-page.is-active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.hero { min-height: 430px; padding: 52px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 50px; align-items: center; overflow: hidden; position: relative; border-radius: 26px; color: white; background: var(--navy); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; width: 340px; height: 340px; right: -150px; top: -140px; border: 70px solid rgba(255,255,255,.04); border-radius: 50%; }
.hero-copy, .hero-panel { position: relative; z-index: 1; }
.hero-kicker { color: #81d6c8; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero h2 { max-width: 590px; margin: 16px 0; font-family: Georgia, serif; font-size: clamp(42px, 5vw, 66px); line-height: .99; letter-spacing: -.055em; }
.hero-copy > p { max-width: 530px; color: #c1d1dc; font-size: 15px; line-height: 1.7; }
.hero-actions { margin-top: 28px; display: flex; align-items: center; gap: 22px; }
.text-button { padding: 0; border: 0; color: white; background: none; font-size: 12px; }
.hero-panel { padding: 26px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(255,255,255,.06); }
.panel-label { color: #81d6c8; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.hero-panel h3 { margin: 8px 0 18px; font-size: 20px; }
.ready-list { margin: 0; padding: 0; list-style: none; }
.ready-list li { padding: 11px 0; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.08); color: #dbe6ec; font-size: 12px; }
.ready-list span { color: #81d6c8; font-size: 9px; font-weight: 800; }
.time-note { margin: 16px 0 0; color: #9eb8c9; font-size: 10px; }
.level-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.level-grid article { padding: 17px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.level { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; font-weight: 900; font-size: 12px; }
.bronze { background: #a86f4c; } .silver { background: #8493a1; } .gold { background: #c89c2d; }
.level-grid strong, .level-grid p { display: block; margin: 0; }
.level-grid strong { font-size: 12px; }
.level-grid p { margin-top: 3px; color: var(--muted); font-size: 10px; }

.section-heading { margin-bottom: 24px; display: flex; align-items: flex-start; gap: 16px; }
.section-heading > span { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 12px; color: var(--blue); background: var(--sky); font-size: 12px; font-weight: 900; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 34px; letter-spacing: -.035em; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.form-card { margin-bottom: 18px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 10px 30px rgba(16,42,67,.045); }
.card-title { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
.card-title h3 { margin: 5px 0 0; font-size: 18px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field-grid--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.field--wide { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; color: var(--ink); font-size: 11px; font-weight: 700; }
.field span b, .question b { color: var(--danger); }
.field span em { margin-left: 6px; color: var(--muted); font-style: normal; font-size: 9px; font-weight: 400; }
.field input, .field textarea { width: 100%; padding: 12px 13px; border: 1px solid #cdd9e1; border-radius: 9px; outline: none; color: var(--ink); background: #fbfcfd; font-weight: 400; transition: .18s ease; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40,120,184,.1); background: white; }
.field input.is-invalid, .field textarea.is-invalid { border-color: var(--danger); }
.top-gap { margin-top: 20px; }

.choice-grid { display: grid; gap: 16px; }
.choice-grid--levels { grid-template-columns: repeat(3, 1fr); }
.choice-card { min-height: 230px; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; position: relative; border: 2px solid transparent; border-radius: var(--radius); background: white; box-shadow: var(--shadow); text-align: center; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card:has(input:checked) { border-color: var(--blue); background: #f8fcff; }
.choice-card:has(input:checked)::after { content: "✓"; width: 24px; height: 24px; display: grid; place-items: center; position: absolute; top: 14px; right: 14px; border-radius: 50%; color: white; background: var(--blue); font-size: 12px; }
.choice-card .level { width: 48px; height: 48px; }
.choice-card strong { font-size: 16px; }
.choice-card small { color: var(--muted); }
.choice-card i { margin-top: 8px; color: var(--blue); font-style: normal; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.info-callout { margin-top: 18px; padding: 18px 22px; display: flex; gap: 22px; border-radius: 13px; background: var(--sky); }
.info-callout strong { flex: 0 0 120px; font-size: 11px; text-transform: uppercase; color: var(--blue); }
.info-callout p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.check-tile, .pill, .confirm { position: relative; cursor: pointer; }
.check-tile input, .pill input { position: absolute; opacity: 0; }
.check-tile span { min-height: 48px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 11px; background: #fbfcfd; }
.check-tile span::before { content: ""; width: 17px; height: 17px; flex: 0 0 17px; border: 1.5px solid #aac0ce; border-radius: 5px; }
.check-tile input:checked + span { color: var(--navy); border-color: #93c6e9; background: var(--sky); }
.check-tile input:checked + span::before { content: "✓"; display: grid; place-items: center; color: white; border-color: var(--blue); background: var(--blue); font-size: 10px; }
.pill-options { display: flex; flex-wrap: wrap; gap: 10px; }
.pill span { padding: 11px 16px; display: block; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: #fbfcfd; font-size: 11px; }
.pill input:checked + span { color: white; border-color: var(--blue); background: var(--blue); }
.evidence-list { display: grid; }
.evidence-row { padding: 14px 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.evidence-row:last-child { border-bottom: 0; }
.evidence-row strong { display: block; font-size: 12px; }
.evidence-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.segmented { padding: 3px; display: flex; border-radius: 9px; background: #eef2f5; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { padding: 7px 10px; display: block; border-radius: 7px; color: var(--muted); font-size: 9px; cursor: pointer; }
.segmented input:checked + span { color: var(--navy); background: white; box-shadow: 0 2px 7px rgba(16,42,67,.12); }

.project-card { overflow: hidden; }
.project-number { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--navy); font-weight: 900; }
.evidence-checks { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.evidence-checks > span { display: block; margin-bottom: 10px; font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.question { margin: 0; padding: 0; border: 0; }
.question legend { margin-bottom: 12px; font-size: 12px; font-weight: 700; }
.question label { margin-right: 18px; color: var(--muted); font-size: 12px; }
.question input { accent-color: var(--blue); }
.question-stack .question { padding: 18px 0; border-bottom: 1px solid var(--line); }
.question-stack .question:first-child { padding-top: 0; }
.question-stack .question:last-child { padding-bottom: 0; border-bottom: 0; }
.reference-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.declaration p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.confirm { margin-top: 22px; padding: 16px; display: flex; align-items: center; gap: 10px; border-radius: 10px; background: var(--sky); font-size: 12px; font-weight: 700; }
.confirm input { width: 18px; height: 18px; accent-color: var(--blue); }

.review-layout { display: grid; gap: 18px; }
.review-summary { padding: 28px; display: flex; align-items: center; gap: 28px; border-radius: var(--radius); color: white; background: var(--navy); }
.score-ring { width: 110px; height: 110px; flex: 0 0 110px; display: grid; place-content: center; border: 8px solid rgba(255,255,255,.13); border-top-color: var(--mint); border-radius: 50%; text-align: center; }
.score-ring strong { font-size: 27px; }
.score-ring span { color: #a9c0ce; font-size: 9px; text-transform: uppercase; }
.review-summary h3 { margin: 7px 0; font-size: 23px; }
.review-summary p { margin: 0; color: #b9ccda; font-size: 12px; }
.review-checklist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.review-item { padding: 11px 13px; display: flex; align-items: center; gap: 10px; border-radius: 9px; background: #f5f7f9; font-size: 11px; }
.review-item i { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; color: white; background: #aab8c2; font-size: 9px; font-style: normal; }
.review-item.is-complete i { background: var(--mint); }
.review-actions { display: flex; gap: 12px; }
.privacy-note { margin: 0; color: var(--muted); font-size: 10px; text-align: center; }

.form-footer { margin-top: 28px; padding-top: 22px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.form-footer span { color: var(--muted); font-size: 10px; }
.button { min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 9px; font-size: 11px; font-weight: 800; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { color: white; background: var(--blue); }
.button--accent { color: var(--navy); background: #81d6c8; }
.button--outline { color: var(--navy); border-color: #bdccd6; background: white; }
.button--ghost { color: white; border-color: rgba(255,255,255,.18); background: transparent; }
.button--light { color: #b9ccda; background: rgba(255,255,255,.06); }
.button--full { width: 100%; }
.toast { padding: 11px 16px; position: fixed; right: 22px; bottom: 22px; z-index: 50; border-radius: 9px; color: white; background: var(--navy); box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.is-open { transform: none; box-shadow: 20px 0 50px rgba(0,0,0,.18); }
  .main { width: 100%; }
  .menu-button { display: block; }
  .hero { grid-template-columns: 1fr; }
  .hero-panel { display: none; }
  .field-grid--five { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
  .topbar { padding: 13px 16px; }
  .topbar h1 { font-size: 17px; }
  .local-badge { display: none; }
  .content { width: min(100% - 28px, 1060px); padding-top: 24px; }
  .hero { padding: 34px 26px; min-height: 480px; }
  .hero h2 { font-size: 43px; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .level-grid, .choice-grid--levels, .reference-grid { grid-template-columns: 1fr; }
  .level-grid { display: none; }
  .field-grid, .field-grid--five { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: repeat(2, 1fr); }
  .section-heading h2 { font-size: 28px; }
  .form-card { padding: 21px; }
  .info-callout, .review-summary { align-items: flex-start; flex-direction: column; }
  .review-checklist { grid-template-columns: 1fr; }
  .review-actions { flex-direction: column; }
  .evidence-row { grid-template-columns: 1fr; }
  .form-footer { gap: 8px; }
  .form-footer span { display: none; }
}

@media print {
  body { background: white; }
  .sidebar, .topbar, .form-footer, .review-actions, .toast { display: none !important; }
  .main { grid-column: auto; }
  .content { width: 100%; padding: 0; }
  .form-page { display: block !important; page-break-after: always; }
  .form-page[data-section="welcome"] { display: none !important; }
  .form-page[data-section="review"] { page-break-after: auto; }
  .form-card, .choice-card { box-shadow: none; break-inside: avoid; }
  input, textarea { border: 0 !important; background: transparent !important; }
}
