/* Shared styles for the report form and the pages people reach from email links. */
/* Fonts are hosted here rather than loaded from Google, so visiting the form doesn't tell anyone else you were here. */
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("/fonts/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url("/fonts/montserrat-latin-800-normal.woff2") format("woff2"); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* Layout idea: one question per screen, thumb-sized answers stacked in a narrow column, a fixed action bar at the bottom like a phone app. */
:root {
  /* Bighorn Historical Combat colours: dark with the club blue, softened a little for easier reading. */
  --paper: #10151b;
  --surface: #18202a;
  --ink: #dde4ec;
  --muted: #93a2b2;
  --line: #2b3746;
  --accent: #4ba8ee;
  --accent-ink: #0d1218;
  --accent-soft: #15304a;
  --cream: #efe4b8;
  --danger: #f2998d;
  --focus: #8cc8f5;
  --page: #0b0f14;
  --font-display: "Montserrat", "Arial Black", "Segoe UI", sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}
/* Light mode: soft off-white and club blue. Used when the phone or computer is set to light,
   or when someone picks it with the "Switch to light mode" button (see theme.js). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --paper: #f7f9fb; --surface: #edf1f5; --ink: #14212f; --muted: #566779; --line: #d0d9e3;
    --accent: #1f6fb2; --accent-ink: #ffffff; --accent-soft: #dfe9f4; --cream: #14212f;
    --danger: #b3261e; --focus: #1f6fb2; --page: #e6ebf1; color-scheme: light;
  }
}
:root[data-theme="light"] {
  --paper: #f7f9fb; --surface: #edf1f5; --ink: #14212f; --muted: #566779; --line: #d0d9e3;
  --accent: #1f6fb2; --accent-ink: #ffffff; --accent-soft: #dfe9f4; --cream: #14212f;
  --danger: #b3261e; --focus: #1f6fb2; --page: #e6ebf1; color-scheme: light;
}

* { box-sizing: border-box; }
/* Keep room for the scrollbar even when the page is short, so the page doesn't shift
   sideways when a screen gets long enough to scroll (or short enough not to) */
html { scrollbar-gutter: stable; }
.copy-id { align-self: flex-start; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 34rem; margin: 0 auto; padding: 10px 16px 8px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; position: relative;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; }
.brand img { width: 40px; height: 40px; flex: none; }
/* Sun/moon button for light and dark mode (icons drawn by theme.js) */
.theme-toggle {
  flex: none; width: 40px; height: 40px; display: inline-grid; place-items: center; cursor: pointer; padding: 0;
  background: transparent; color: var(--ink); border: 1.5px solid var(--line); border-radius: 7px;
}
.theme-toggle:hover { border-color: var(--muted); }
/* Menu button and its drop-down (built by menu.js) */
.menu-btn {
  flex: none; width: 40px; height: 40px; display: inline-grid; place-items: center; cursor: pointer; padding: 0;
  background: transparent; color: var(--ink); border: 1.5px solid var(--line); border-radius: 7px;
}
.menu-btn:hover, .menu-btn[aria-expanded="true"] { border-color: var(--muted); }
.site-menu {
  position: absolute; top: calc(100% + 2px); right: 16px; z-index: 6; min-width: 15rem; max-width: calc(100vw - 32px);
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  animation: menu-in 0.16s ease-out;
}
.site-menu ul { list-style: none; margin: 0; padding: 0; }
.menu-item {
  display: block; width: 100%; text-align: left; padding: 11px 12px; border-radius: 7px; border: 0;
  background: none; color: var(--ink); text-decoration: none; font-size: 1rem; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface); }
.menu-action { font-weight: 700; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .site-menu { animation: none; } }
.wordmark {
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--accent);
  letter-spacing: 0.02em; text-transform: uppercase;
}
.pill {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; color: var(--muted);
}
.preview {
  width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 0.875rem; color: var(--muted);
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  border: 0; background: transparent; padding: 4px 10px; cursor: pointer; font-size: 0.875rem; color: var(--muted);
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.linkbtn {
  background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline;
  cursor: pointer; font-size: inherit;
}
/* Thin blue line under the top bar that fills up as you go through the form */
.progress { height: 3px; }
.progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.25s ease; }

main {
  max-width: 34rem; margin: 0 auto; padding: 20px 16px 120px;
  display: flex; flex-direction: column; gap: 18px;
}
.eyebrow { font-size: 0.9375rem; font-weight: 700; color: var(--muted); margin: 0; }
h1, h2 {
  font-family: var(--font-display); font-weight: 700; line-height: 1.2; margin: 0;
  text-wrap: balance;
}
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.45rem; }
.sub { color: var(--muted); margin: -8px 0 0; }
p { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-weight: 700; }
.note { font-size: 0.9375rem; color: var(--muted); }
/* Separate each question on a screen, so screens with several don't run together */
.q + .q { margin-top: 6px; padding-top: 20px; border-top: 1px solid var(--line); }
.sub-field .field-label { font-size: 0.95rem; }
.sub-field { margin: 2px 0 6px 28px; padding-left: 12px; border-left: 2px solid var(--line); }
.lead-box { margin: 0 0 10px; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; color: var(--ink); font-weight: 700; line-height: 1.45; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.event-chip {
  align-self: flex-start; font-size: 0.9375rem; background: var(--accent-soft); color: var(--ink);
  border-radius: 8px; padding: 6px 10px;
}

.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 52px;
  text-align: left; padding: 13px 14px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px;
}
.opt:hover { border-color: var(--muted); }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.mark {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border: 2px solid var(--muted); border-radius: 50%;
  display: grid; place-items: center;
}
.multi .mark { border-radius: 6px; }
.opt[aria-pressed="true"] .mark { border-color: var(--accent); background: var(--accent); }
.opt[aria-pressed="true"] .mark::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--surface);
}
.multi .opt[aria-pressed="true"] .mark::after {
  width: 10px; height: 5px; border-radius: 0; background: none;
  border-left: 2.5px solid var(--surface); border-bottom: 2.5px solid var(--surface);
  transform: translateY(-2px) rotate(-45deg);
}
.opt-text { display: flex; flex-direction: column; gap: 4px; }
.opt-note { font-size: 0.875rem; color: var(--muted); font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .opt { width: auto; min-height: 44px; padding: 10px 14px; align-items: center; }
.chips .mark { display: none; }

input[type="text"], input[type="email"], input[type="date"], input[type="number"], input[type="search"], input[type="password"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 14px; min-height: 52px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.row { display: flex; gap: 8px; align-items: stretch; }
.row > input { flex: 1; min-width: 0; }
.check {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface);
}
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check.checked { border-color: var(--accent); background: var(--accent-soft); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs img { width: 88px; height: 88px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.filebtn {
  position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; cursor: pointer;
  border: 1.5px dashed var(--muted); border-radius: 8px; background: var(--surface); font-weight: 700;
}
.filebtn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.err { color: var(--danger); font-size: 0.9375rem; font-weight: 700; }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
  background: var(--paper); border-top: 1px solid var(--line);
}
.actionbar-inner {
  max-width: 34rem; margin: 0 auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 10px;
}
[hidden] { display: none !important; }
.btn {
  text-align: center;
  min-height: 52px; padding: 0 20px; border-radius: 8px; cursor: pointer; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 1rem;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent);
}
.btn-primary { flex: 1; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-quiet { background: transparent; border-color: var(--line); color: var(--ink); }

.idbox {
  font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; letter-spacing: 0.08em; color: var(--cream);
  background: var(--surface); border: 2px solid var(--accent); border-radius: 8px; padding: 6px 16px; align-self: flex-start;
  font-variant-numeric: tabular-nums;
}
.summary { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.summary th, .summary td { text-align: left; vertical-align: top; padding: 8px 0; border-bottom: 1px solid var(--line); }
.summary th { color: var(--muted); font-weight: 400; width: 45%; padding-right: 12px; }
details summary { cursor: pointer; font-weight: 700; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 10; background: rgb(0 0 0 / 0.45);
  display: grid; place-items: end center; padding: 16px;
}
.modal {
  width: 100%; max-width: 34rem; max-height: 85%; overflow: auto; background: var(--surface);
  border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.footnote { font-size: 0.8125rem; color: var(--muted); text-align: center; }
/* Start page: tips list, then the age check right above the buttons */
.tips h2 { font-size: 1.05rem; margin: 4px 0 6px; }
.tips ul { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 0.95rem; }
.start-go { gap: 10px; margin-top: 4px; }
.start-go .btn { width: 100%; }
@media (prefers-reduced-motion: reduce) { .progress span { transition: none; } }

/* Small outlined button, like "Start over" in the top bar */
.btn-small { min-height: 40px; padding: 0 14px; font-size: 1rem; border-radius: 7px; border-width: 1.5px; }
/* Question title with the (?) button beside it */
.title-row { display: flex; align-items: flex-start; gap: 10px; }
.title-row h2 { flex: 1; }
.help {
  flex: none; width: 30px; height: 30px; margin-top: 2px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid var(--muted); background: transparent; color: var(--muted); font-weight: 700; font-size: 0.95rem; line-height: 1;
}
.help[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.why {
  font-size: 0.9375rem; color: var(--ink); background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 10px 12px;
}

/* On phones, keep the logo, title, sun/moon button and menu button on one line. */
@media (max-width: 480px) {
  .topbar-inner { column-gap: 10px; }
  .brand { gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .wordmark { font-size: 0.88rem; }
  .btn-small { padding: 0 12px; }
  .theme-toggle, .menu-btn { width: 36px; height: 36px; }
}
@media (max-width: 380px) {
  .topbar-inner { column-gap: 8px; }
  .wordmark { font-size: 0.82rem; }
}

/* Computers and tablets: the page sits in a white (or dark) panel on a tinted background,
   with bigger text, long answer lists in two columns, and Back / Next right under the panel. */
@media (min-width: 900px) {
  html, body { background: var(--page); }
  body { font-size: 1.125rem; }
  .topbar { background: var(--paper); }
  .topbar-inner { max-width: 72rem; padding: 14px 32px 12px; }
  .site-menu { right: 32px; }
  .brand img { width: 44px; height: 44px; }
  .wordmark { font-size: 1.15rem; }
  main {
    max-width: 48rem; margin: 36px auto 0; padding: 40px 48px; gap: 22px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  }
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.9rem; }
  /* Count only the answer buttons, not follow-up questions that open inside the list */
  /* The space between rows is a margin on each item instead of a grid gap, so a follow-up
     opening or closing can grow from nothing without the rows jumping by a gap */
  .opts:has(> button.opt:nth-of-type(6)) { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: dense; column-gap: 10px; row-gap: 0; margin-bottom: -10px; }
  .opts:has(> button.opt:nth-of-type(6)) > * { margin-bottom: 10px; }
  .opts:has(> button.opt:nth-of-type(6)) > .sub-field { margin-bottom: 16px; }
  .opts .sub-field { grid-column: 1 / -1; }
  main > .btn { align-self: flex-start; min-width: 300px; }
  .actionbar .btn-quiet { background: var(--paper); }
  .actionbar { position: static; background: transparent; border: 0; }
  .actionbar-inner { max-width: 48rem; padding: 18px 0 48px; justify-content: flex-end; }
  .actionbar #back { margin-right: auto; }
  .actionbar .btn-primary { flex: 0 0 260px; }
}

/* Small unit labels between number boxes, like 3 lbs 2 oz */
.unit-label { align-self: center; color: var(--muted); font-size: 0.95rem; }
.row input[type=number] { min-width: 0; }

/* Follow-up questions fade and slide in when an answer opens them (the form) */
@keyframes form-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.form-appear { animation: form-in 0.35s ease-in-out 0.12s both; }
@media (prefers-reduced-motion: reduce) { .form-appear { animation: none; } }
