:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #213b29;
  background: #ebf6ee;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --page: #ebf6ee;
  --surface: #ffffff;
  --text: #213b29;
  --muted: #56665b;
  --accent: #008d21;
  --action: #006e1a;
  --action-hover: #005615;
  --line: #d3e1d6;
  --input-line: #84998a;
  --error: #a42b24;
  --error-background: #fff5f3;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 24px; }
body { margin: 0; font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--action); text-underline-offset: 3px; }
button, input, select, textarea, [tabindex] { scroll-margin-top: 24px; }
:focus-visible { outline: 3px solid #006e1a; outline-offset: 4px; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 12px 18px;
  border: 1px solid var(--action);
  border-radius: 6px;
  background: white;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.page { width: min(100% - 48px, 936px); margin-inline: auto; padding-block: 40px 24px; }
.brand-banner { overflow: hidden; border-radius: 10px; background: #9cd2a8; }
.brand-banner img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 1; object-fit: contain; }
.page-introduction { padding: 32px 0 0; }
.eyebrow { margin: 0 0 5px; color: var(--action); font-size: 14px; font-weight: 650; letter-spacing: 0.035em; }
h1 { margin: 0; font-size: clamp(28px, 4.5vw, 36px); font-weight: 680; line-height: 1.15; letter-spacing: -0.035em; }
.page-introduction > p:last-child { margin: 12px 0 0; max-width: 640px; color: var(--muted); line-height: 1.6; }
.progress-navigation { padding-block: 30px 26px; }
#stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; margin: 0; list-style: none; }
.step-indicator { display: flex; align-items: center; gap: 10px; min-width: 0; position: relative; color: #526759; font-size: 14px; font-weight: 550; }
.step-indicator:not(:last-child)::after { content: ""; flex: 1; min-width: 8px; height: 1px; background: #bdd4c3; margin-inline: 4px 14px; }
.step-number { display: grid; place-items: center; flex: 0 0 31px; height: 31px; border: 1px solid #91ae9a; border-radius: 50%; background: var(--page); font-size: 13px; font-weight: 650; }
.step-label { white-space: nowrap; }
.step-indicator[aria-current="step"], .step-indicator.is-active { color: var(--action); font-weight: 700; }
.step-indicator[aria-current="step"] .step-number, .step-indicator.is-active .step-number { border-color: var(--action); background: var(--action); color: white; }
.step-indicator.complete .step-number, .step-indicator.completed .step-number, .step-indicator.is-complete .step-number { border-color: var(--action); color: var(--action); background: #d5ecd9; }

.form-shell { padding: 36px 40px 25px; border: 1px solid #d4e3d8; border-radius: 12px; background: var(--surface); }
.section-heading { margin: 0 0 8px; font-size: 25px; font-weight: 670; letter-spacing: -0.025em; line-height: 1.25; }
.section-heading:focus, .success-panel:focus { outline: none; }
.section-description { margin: 0 0 28px; max-width: 650px; color: var(--muted); line-height: 1.6; }
.section-description + .section-description { margin-top: -16px; }
.required-note { color: var(--muted); font-size: 13px; }
.guardian-card, .child-card { margin: 0 0 24px; padding: 24px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.card-title { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 660; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.card-heading > div { min-width: 0; }
.card-heading p { margin: 5px 0 0; font-size: 14px; color: var(--muted); }
legend.card-title { padding-inline: 7px; margin-left: -7px; }
.field-grid { display: grid; gap: 22px 20px; }
.field-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field-label, .field > label:not(.checkbox-field) { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 610; color: var(--text); }
.field-label .required, .required { color: var(--error); }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 47px;
  padding: 11px 13px;
  border: 1px solid var(--input-line);
  border-radius: 5px;
  color: var(--text);
  background: white;
  line-height: 1.4;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input::placeholder, textarea::placeholder { color: #68746c; opacity: 1; }
textarea { min-height: 104px; resize: vertical; }
select { padding-right: 32px; }
input[type="date"] { min-height: 47px; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { outline: 2px solid var(--action); outline-offset: 2px; border-color: var(--action); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); background: #fffafa; }
input:disabled, select:disabled, textarea:disabled { background: #f1f4f2; color: #55695b; opacity: 1; }
input[readonly], textarea[readonly] { background: #f4f7f4; }
input[data-manual-contact] { background: white; }
.field-hint { display: block; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.field-error { display: block; margin: 7px 0 0; color: var(--error); font-size: 13px; font-weight: 550; line-height: 1.45; }
.field-error:empty, .field-hint:empty { display: none; }
.checkbox-field { display: flex; align-items: flex-start; gap: 11px; margin: 20px 0; font-size: 15px; line-height: 1.55; cursor: pointer; }
.checkbox-field input { flex: 0 0 20px; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--action); }
.checkbox-field label { cursor: pointer; }
.child-card > .field-grid + .field-grid, .child-card .school-fields { margin-top: 22px; }
.subsection-heading { grid-column: 1 / -1; margin: 8px 0 -6px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 660; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 46px; padding: 11px 21px; border: 1px solid transparent; border-radius: 5px; font-size: 15px; font-weight: 650; line-height: 1.4; text-decoration: none; transition: background-color 120ms ease, border-color 120ms ease; }
.button-primary { color: #fff; background: var(--action); border-color: var(--action); }
.button-primary:hover:not(:disabled) { background: var(--action-hover); border-color: var(--action-hover); }
.button-secondary { color: var(--action); background: white; border-color: #9bb5a3; }
.button-secondary:hover:not(:disabled) { background: #edf6ef; border-color: var(--action); }
.button-quiet, .edit-button { color: var(--action); background: transparent; border-color: transparent; }
.button-quiet:hover:not(:disabled), .edit-button:hover:not(:disabled) { background: #edf6ef; }
.button:disabled { opacity: 0.58; }
.add-button { margin: 0 0 26px; }
.card-heading .button-quiet { flex-shrink: 0; min-height: 40px; padding: 8px 10px; font-size: 13px; }
.edit-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 10px; border: 1px solid transparent; border-radius: 5px; font-size: 14px; font-weight: 650; }
.form-navigation { display: flex; align-items: center; gap: 18px; padding-top: 26px; margin-top: 30px; border-top: 1px solid var(--line); }
#step-caption { margin-inline: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
#next-button { margin-left: auto; min-width: 142px; }
#save-note { margin: 22px 0 0; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; }
.page-footer { padding-top: 22px; color: #596f60; text-align: center; font-size: 12px; }
.page-footer p { margin: 0; }

.notice, #storage-warning { margin: 0 0 24px; padding: 16px 18px; border: 1px solid #d4c68f; border-radius: 6px; color: #66501b; background: #fffbed; font-size: 14px; line-height: 1.6; }
#error-summary { margin: 0 0 26px; padding: 18px 20px; border: 1px solid #dcb4af; border-left: 4px solid var(--error); border-radius: 5px; background: var(--error-background); color: #842b25; font-size: 14px; line-height: 1.6; }
#error-summary p { margin: 0; }
#error-summary h2, #error-summary h3 { margin: 0 0 7px; font-size: 16px; }
#error-summary ul { padding-left: 20px; margin: 8px 0 0; }
#error-summary a { color: #842b25; }
.review-section { margin: 0 0 24px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; }
.review-section .card-heading { margin-bottom: 18px; }
.review-section h3 { margin: 0; font-size: 18px; font-weight: 660; overflow-wrap: anywhere; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; margin: 0; }
.review-item { min-width: 0; }
.review-item dt { margin: 0 0 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.review-item dd { margin: 0; color: var(--text); font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-section > p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
#submission-results:empty { display: none; }
#submission-results { margin-top: 24px; }
.result-card { margin-top: 12px; padding: 18px 20px; border: 1px solid var(--line); border-left: 4px solid #789a81; border-radius: 6px; background: #f5f8f5; overflow-wrap: anywhere; }
.result-card h3, .result-card h4 { margin: 0 0 6px; font-size: 16px; }
.result-card p { margin: 5px 0 0; font-size: 14px; line-height: 1.6; }
.result-card.confirmed { border-color: #b6d5bf; border-left-color: var(--action); background: #f0f8f2; }
.result-card.uncertain { border-color: #dac994; border-left-color: #92701c; background: #fffbed; }
.result-card.rejected { border-color: #dcb4af; border-left-color: var(--error); background: var(--error-background); }
.result-card.sending { border-color: #b5cbbb; border-left-color: var(--action); }
.result-card .button { margin-top: 12px; }
.success-panel { padding: 10px 0 20px; }
.success-panel h2 { margin: 0 0 14px; font-size: 29px; font-weight: 670; line-height: 1.2; letter-spacing: -0.03em; color: var(--action); }
.success-panel p { margin: 10px 0 0; max-width: 650px; color: var(--muted); line-height: 1.7; }
.success-panel .button { margin-top: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .page { width: min(100% - 32px, 936px); padding-top: 24px; }
  .form-shell { padding: 30px 24px 23px; }
  .step-indicator { gap: 7px; font-size: 12px; }
  .step-indicator:not(:last-child)::after { margin-inline: 0 9px; }
  .step-number { flex-basis: 27px; height: 27px; font-size: 12px; }
  .guardian-card, .child-card, .review-section { padding: 20px; }
}

@media (max-width: 560px) {
  html { scroll-padding-top: 16px; }
  .page { width: calc(100% - 24px); padding-top: 14px; }
  .brand-banner { border-radius: 6px; }
  .page-introduction { padding: 25px 7px 0; }
  h1 { font-size: 30px; }
  .page-introduction > p:last-child { font-size: 15px; }
  .eyebrow { font-size: 12px; }
  .progress-navigation { padding: 25px 0 23px; }
  .step-indicator { flex-direction: column; gap: 7px; font-size: 11px; line-height: 1.3; }
  .step-number { flex: 0 0 29px; width: 29px; height: 29px; }
  .step-indicator:not(:last-child)::after { position: absolute; top: 14px; left: calc(50% + 22px); right: calc(-50% + 22px); margin: 0; width: auto; min-width: 0; }
  .form-shell { padding: 25px 18px 22px; border-radius: 9px; }
  .section-heading { font-size: 23px; }
  .section-description { font-size: 14px; margin-bottom: 23px; }
  .guardian-card, .child-card, .review-section { padding: 20px 16px; margin-bottom: 20px; }
  .field-grid.two-columns, .review-grid { grid-template-columns: minmax(0, 1fr); }
  .field-grid { gap: 21px; }
  .field-label, .field > label:not(.checkbox-field) { line-height: 1.5; }
  .card-heading { gap: 8px; margin-bottom: 21px; align-items: flex-start; }
  .card-heading .button-quiet, .card-heading .edit-button { margin: -7px -7px 0 0; }
  .guardian-card .card-heading { flex-direction: column; gap: 5px; }
  .guardian-card .card-heading .button-quiet { margin: 0 0 -5px -10px; }
  .card-title, .review-section h3 { font-size: 17px; }
  .checkbox-field { font-size: 14px; }
  .add-button { width: 100%; }
  .form-navigation { flex-wrap: wrap; gap: 14px; margin-top: 25px; padding-top: 22px; }
  #step-caption { order: 3; width: 100%; text-align: center; }
  #next-button { flex: 1; min-width: 0; }
  #back-button { min-width: 88px; }
  .button { padding-inline: 17px; }
  #save-note { margin-top: 18px; font-size: 12px; }
  #error-summary, .notice, #storage-warning { padding: 14px 15px; }
  .result-card { padding: 16px; }
  .success-panel h2 { font-size: 26px; }
}

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

@media print {
  body { background: white; }
  .page { width: 100%; padding: 0; }
  .form-shell { border: 0; padding: 0; }
  .brand-banner { max-width: 650px; }
  .progress-navigation, .form-navigation, .edit-button, .add-button, .skip-link, #save-note { display: none; }
  .review-section, .result-card { break-inside: avoid; }
}
