/* Fairfield Public Schools: light theme in the district's navy and gold. Shared by the form, Terms and Privacy pages. */
:root {
  color-scheme: light;
  --navy: #0a2f5c;
  --navy-hover: #072447;
  --gold: #c8a047;
  --gold-soft: #f7f1e1;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #56626f;
  --border: #c5cfda;
  --divider: #e3e8ee;
  --focus: #1f6fd1;
  --error: #b42318;
  --error-bg: #fdecea;
  --emergency: #a3150b;
  --emergency-bg: #fff1ef;
  --success: #1c7c45;
  --success-bg: #ecf7f0;
  --req: #b42318;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--navy); text-underline-offset: 2px; }
a:hover { color: var(--navy-hover); }

/* ---------- Header ---------- */
.site-header {
  background: var(--navy);
  border-bottom: 5px solid var(--gold);
  padding: 20px 16px 72px;
}
.site-header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.crest { display: block; width: 54px; height: 60px; flex: none; }
.site-name { margin: 0; color: #fff; font-size: 20px; font-weight: 700; line-height: 1.2; }
.site-dept {
  margin: 4px 0 0;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Page ---------- */
.page {
  max-width: 860px;
  margin: -52px auto 0;
  padding: 0 16px 40px;
}
.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(10, 47, 92, 0.06), 0 8px 28px rgba(10, 47, 92, 0.1);
  padding: 36px 44px 40px;
}
.card-header { margin-bottom: 8px; }
h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; color: var(--navy); letter-spacing: -0.01em; }
.lead { margin: 0 0 8px; font-size: 17px; color: var(--text); }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.req { color: var(--req); font-weight: 700; }

/* ---------- Emergency banner ---------- */
.emergency {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--emergency-bg);
  border: 2px solid var(--emergency);
  border-left-width: 10px;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 8px 28px rgba(10, 47, 92, 0.1);
  color: var(--text);
}
.emergency-icon { color: var(--emergency); flex: none; margin-top: 2px; }
.emergency-title {
  margin: 0 0 4px;
  color: var(--emergency);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
}
.emergency p:last-child { margin: 0; font-size: 16px; }

/* ---------- Form sections ---------- */
.section { border-top: 1px solid var(--divider); padding-top: 24px; margin-top: 24px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 19px;
  color: var(--navy);
}
.step {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold-soft);
  border: 2px solid var(--gold);
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
  flex: none;
}
.section-help { margin: -8px 0 16px; color: var(--muted); font-size: 15px; }
.section-last { padding-top: 20px; }

.grid-2, .grid-3 { display: grid; gap: 0 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: 2fr 1fr 1fr; }

.field { min-width: 0; margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="time"], select, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 46px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: #9aaabb; }
textarea { resize: vertical; min-height: 150px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(31, 111, 209, 0.25);
}
.btn:focus-visible, .checkbox input:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
[aria-invalid="true"] { border-color: var(--error) !important; }
.inline { display: flex; align-items: center; gap: 10px; }
.inline input { flex: 1; min-width: 0; }
.inline input[type="date"] { flex: 1.5; }
.at { color: var(--muted); }
.help { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.error { margin: 6px 0 0; color: var(--error); font-size: 14px; font-weight: 600; }
.error:empty { display: none; }

.checkbox { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 400; }
.checkbox input { margin-top: 3px; width: 20px; height: 20px; flex: none; accent-color: var(--navy); }
.turnstile { min-height: 65px; }

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  min-height: 48px;
  padding: 10px 24px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--navy);
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); color: #fff; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: wait; }

/* ---------- Messages ---------- */
.alert { border-radius: 10px; padding: 12px 16px; margin: 16px 0 4px; font-weight: 600; }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid #f3b8b1; }
.success { text-align: center; padding: 16px 8px 0; }
.success-icon { color: var(--success); }
.success h2 { margin: 8px 0 8px; font-size: 26px; color: var(--navy); }
.success p { margin: 0 0 12px; }
.reference {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  background: var(--gold-soft);
  border-left: 5px solid var(--gold);
  border-radius: 10px;
  padding: 12px 24px;
  color: var(--muted);
  font-size: 14px;
}
.reference strong { color: var(--navy); font-size: 24px; letter-spacing: 0.04em; }
.success:focus, .alert:focus { outline: none; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 0 16px 32px;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--muted); }

/* ---------- Terms / Privacy pages ---------- */
.doc h1 { margin-bottom: 4px; }
.doc .updated { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.doc h2 { margin: 32px 0 8px; font-size: 20px; color: var(--navy); }
.doc h3 { margin: 20px 0 6px; font-size: 17px; }
.doc p, .doc li { max-width: 72ch; }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc .callout {
  background: var(--gold-soft);
  border-left: 5px solid var(--gold);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
}
.doc .toc { background: #f7f9fb; border: 1px solid var(--divider); border-radius: 10px; padding: 14px 20px; }
.doc .toc ol { margin: 6px 0 0; padding-left: 22px; }
.doc .toc li { margin-bottom: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

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

@media (max-width: 720px) {
  .site-header { padding: 16px 16px 64px; }
  .site-name { font-size: 18px; }
  .card { padding: 24px 18px 28px; border-radius: 14px; }
  h1 { font-size: 24px; }
  .emergency { padding: 14px 16px; gap: 12px; border-left-width: 8px; }
  .emergency-icon { width: 32px; height: 32px; }
  .emergency-title { font-size: 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .btn { width: 100%; }
}
