/* ============================================================
   answersd: public form surface, on the house design layer.
   Tokens (--hs-*) and the hs-* components come from the vendored
   static/house-ds (never edit that copy) with brands/yanz.css,
   loaded in base.html ahead of this file. What is here is the
   app's own: page frame, question rows, choice rows, rating,
   file drop, status cards. Built from house tokens; a literal
   size is one the house scale does not have.
   Warm paper, white ledger cards, one vermilion action.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=Hanken+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-15);
  line-height: 1.5;
  color: var(--hs-ink-2);
  /* The one gradient the system allows: a faint primary tint behind a lone card. */
  background: radial-gradient(900px 420px at 50% -120px, color-mix(in srgb, var(--hs-accent) 8%, transparent), transparent 70%), var(--hs-canvas);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2 {
  font-family: var(--hs-font-display);
  font-weight: 700;
  letter-spacing: var(--hs-tracking-tight);
  color: var(--hs-ink);
  line-height: 1.08;
  margin: 0;
}
/* Links: only the two plain ones are styled here. A bare `a` rule would be
   unlayered and so beat the colour of every hs-btn drawn on a link. */
.back, .brand { text-decoration: none; }
.back { color: var(--hs-accent); }
.back:hover { color: var(--hs-accent-hover); text-decoration: underline; }
.eyebrow {
  font-size: var(--hs-text-11); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--hs-ink-3);
}
.data { font-family: var(--hs-font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ============ Page frame ============ */
.page { max-width: 640px; margin: 0 auto; padding: 28px 16px 56px; }
.brand { display: flex; align-items: center; gap: 9px; margin: 0 0 18px 2px; color: var(--hs-ink); }
.brand:hover { color: var(--hs-accent); text-decoration: none; }
/* Mask, not <img>, so the mark follows the link colour like the Hub rail. */
.brand-mark {
  width: 28px; height: 28px; flex: 0 0 auto; background-color: currentColor;
  -webkit-mask: url(/static/yanz-mark.svg) center / contain no-repeat;
  mask: url(/static/yanz-mark.svg) center / contain no-repeat;
  transition: background-color 160ms var(--hs-ease);
}
.brand-name { font-family: var(--hs-font-display); font-weight: 800; font-size: 16px; letter-spacing: var(--hs-tracking-tight); }
.foot { margin-top: 16px; text-align: center; font-size: var(--hs-text-12); color: var(--hs-ink-3); }
.foot strong { color: var(--hs-ink-3); font-weight: 600; }

/* ============ Card ============ */
/* The surface itself is hs-card (hs-card--flush around the form). */
.card-head { padding: 26px 24px 22px; border-bottom: 1px solid var(--hs-line); }
.card-head h1 { font-size: 31px; }
.card-head p { margin: 10px 0 0; color: var(--hs-ink-3); font-size: var(--hs-text-15); white-space: pre-line; }
.card-body { padding: 4px 24px 24px; }

/* Status cards: thanks / closed / error */
.status { padding: 32px 24px 26px; }
.status-tile {
  width: 44px; height: 44px; border-radius: var(--hs-radius-md);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.status-tile.ok { background: var(--hs-success-soft); color: var(--hs-success); }
.status-tile.closed { background: var(--hs-surface-3); color: var(--hs-ink-3); }
.status-tile.err { background: var(--hs-danger-soft); color: var(--hs-danger); }
.status h1 { font-size: 25px; }
.status p { margin: 8px 0 0; color: var(--hs-ink-3); }
.status .back { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-weight: 600; font-size: var(--hs-text-14); }

/* ============ Questions ============ */
.q { padding: 20px 0; border-top: 1px solid var(--hs-line); }
.qs > .q:first-child { border-top: 0; }
.q-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.q-num { font-family: var(--hs-font-mono); font-size: var(--hs-text-12); font-weight: 600; color: var(--hs-ink-3); flex: 0 0 auto; }
.q-label { font-size: 16px; font-weight: 600; color: var(--hs-ink); line-height: 1.35; }
.req { color: var(--hs-accent); }

/* The error is an hs-notice with the danger tone; this keeps its place and its red text. */
.alert-error { margin: 20px 0 0; color: var(--hs-danger-ink); font-weight: 500; }
.alert-preview {
  margin: 0 0 16px; padding: 11px 14px; border-radius: var(--hs-radius-md); font-size: var(--hs-text-14); font-weight: 500;
  background: var(--hs-surface); border: 1px solid var(--hs-line-strong); color: var(--hs-ink); text-align: center;
}

/* Text controls are hs-input / hs-textarea / hs-select. Kept here: 44px tall for
   thumbs, and 16px type so iOS does not zoom the page when a field takes focus. */
.q .hs-input, .q .hs-select, .q .hs-textarea { min-height: 44px; font-size: 16px; }
.q .hs-textarea { min-height: 112px; padding: 10px 12px; line-height: 1.5; }
.q input[type=date].hs-input { -webkit-appearance: none; appearance: none; }

/* Choice rows: RadioGroup / Checkbox primitives on a tappable bordered row. */
.opts { display: flex; flex-direction: column; gap: 8px; }
.opts.two { flex-direction: row; }
.opts.two .opt { flex: 1; }
.opt {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 10px 12px; cursor: pointer;
  background: var(--hs-surface); border: 1px solid var(--hs-line-strong); border-radius: var(--hs-radius-md);
  color: var(--hs-ink); font-size: var(--hs-text-15); line-height: 1.3;
  transition: background var(--hs-fast) var(--hs-ease), border-color var(--hs-fast) var(--hs-ease);
}
.opt:hover { background: var(--hs-surface-2); border-color: var(--hs-ink-4); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt .mark {
  width: 18px; height: 18px; flex: 0 0 auto; background: var(--hs-surface);
  border: 1.5px solid var(--hs-line-strong); display: flex; align-items: center; justify-content: center;
  transition: background var(--hs-fast) var(--hs-ease), border-color var(--hs-fast) var(--hs-ease);
}
.opt .mark.radio { border-radius: 50%; }
.opt .mark.box { border-radius: var(--hs-radius-xs); color: transparent; }
.opt:has(input:checked) { border-color: var(--hs-accent); background: var(--hs-accent-soft); }
.opt input:checked + .mark.radio { border-color: var(--hs-accent); }
.opt input:checked + .mark.radio::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--hs-accent); }
.opt input:checked + .mark.box { background: var(--hs-accent); border-color: var(--hs-accent); color: var(--hs-on-accent); }
.opt input:focus-visible + .mark { box-shadow: var(--hs-focus-ring); border-color: var(--hs-accent); }

/* Rating */
.stars { display: flex; align-items: center; gap: 4px; }
.stars button {
  width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--hs-line-strong); border-radius: var(--hs-radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: color var(--hs-fast) var(--hs-ease);
}
.stars button.on { color: var(--hs-amber); }
.stars button:focus-visible { outline: none; box-shadow: var(--hs-focus-ring); }
.stars .rlabel { margin-left: 8px; font-size: var(--hs-text-13); font-weight: 600; color: var(--hs-ink-3); }

/* File upload */
.dropzone {
  position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 14px; border: 1.5px dashed var(--hs-line-strong); border-radius: var(--hs-radius-md); background: var(--hs-surface-2);
  transition: border-color var(--hs-fast) var(--hs-ease), background var(--hs-fast) var(--hs-ease);
}
.dropzone:hover { border-color: var(--hs-accent); background: var(--hs-accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-tile {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: var(--hs-radius-sm);
  background: var(--hs-surface); border: 1px solid var(--hs-line); color: var(--hs-ink-3);
  display: flex; align-items: center; justify-content: center;
}
.dz-main { display: block; font-weight: 600; color: var(--hs-ink); font-size: var(--hs-text-14); }
.dz-sub { display: block; font-size: var(--hs-text-12); color: var(--hs-ink-3); }

/* ============ Buttons ============ */
/* hs-btn, hs-btn--primary, hs-btn--block. The big Send button is the app's size. */
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 16px; }

.submit { padding-top: 20px; border-top: 1px solid var(--hs-line); }

/* ============ Event (add to calendar) ============ */
.event { margin-top: 22px; padding: 16px; border: 1px solid var(--hs-line); border-radius: var(--hs-radius-md); background: var(--hs-surface-2); }
.event-title { font-weight: 700; color: var(--hs-ink); font-size: var(--hs-text-15); }
.event-line { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: var(--hs-text-13); color: var(--hs-ink-3); }
.event-line svg { color: var(--hs-ink-3); flex: 0 0 auto; }
.event-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

@media (max-width: 480px) {
  .page { padding-top: 20px; }
  .card-head { padding: 22px 18px 18px; }
  .card-head h1 { font-size: 25px; }
  .card-body { padding: 2px 18px 20px; }
  .status { padding: 26px 18px 22px; }
  .event-actions .hs-btn { flex: 1; }
}

/* Suburb question: type-ahead list with each suburb's local board, then an
   optional postcode (Hub design approved 3 Dec 2026). */
.q-help { margin: 0 0 8px; font-size: var(--hs-text-13); color: var(--hs-ink-3); }
.sb { position: relative; }
.sb-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; max-height: 320px; overflow-y: auto;
  background: var(--hs-surface); border: 1px solid var(--hs-line); border-radius: var(--hs-radius-md);
  box-shadow: 0 8px 20px rgba(43,33,20,0.12); padding: 4px; font-size: var(--hs-text-14); }
.sb-opt { padding: 9px 10px; border-radius: var(--hs-radius-sm); color: var(--hs-ink); cursor: pointer; }
.sb-opt span, .sb-opt.out { color: var(--hs-ink-3); }
.sb-opt[aria-selected=true] { background: var(--hs-surface-2); }
.sb-pc { display: block; margin: 12px 0 6px; font-size: var(--hs-text-14); font-weight: 600; color: var(--hs-ink); }
.sb-pc span { font-weight: 400; font-size: var(--hs-text-13); color: var(--hs-ink-3); margin-left: 4px; }
.q .sb-pc-in { width: 140px; font-family: var(--hs-font-mono); }
