/* HKAOA survey — mobile-first, clean and neutral (Brief §12).
   Brand applied lightly: HKAOA Blue #1B3F8B, HKAOA Red #CC0000.
   WCAG AA contrast, large tap targets, system fonts (self-hosted later). */

:root {
  --blue: #1B3F8B;
  --red: #CC0000;
  --ink: #1a1a1a;
  --muted: #5a5f6a;
  --line: #d7dbe0;
  --bg: #f4f6f9;
  --card: #ffffff;
  --focus: #1B3F8B;
  --radius: 12px;
  --tap: 48px; /* minimum tap target */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  padding: 16px;
}

main.card, .card {
  max-width: 620px;
  margin: 16px auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
}

h1 { font-size: 1.4rem; color: var(--blue); margin: 0 0 .5em; }
h2 { font-size: 1.15rem; margin: 0 0 .25em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); font-size: .95rem; }

/* Progress */
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 8px; }
.progress > .fill { height: 100%; background: var(--blue); border-radius: 3px; transition: width .2s ease; }
.step-count { margin: 0 0 4px; font-size: .85rem; }
.section-label {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--blue); margin: 0 0 14px; font-weight: 600;
}

/* Questions */
fieldset { border: 0; margin: 0 0 24px; padding: 0; }
legend { font-weight: 600; margin-bottom: 10px; padding: 0; }

.option {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); padding: 8px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.option:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.option input { width: 22px; height: 22px; accent-color: var(--blue); }

/* Matrix (Q1) — stacks into per-row option groups on mobile */
.matrix-row { margin-bottom: 18px; }
.matrix-row > .row-label { font-weight: 600; margin-bottom: 8px; }

textarea, input[type="text"], input[type="tel"] {
  width: 100%; min-height: var(--tap); padding: 12px;
  font-size: 17px; border: 1px solid var(--line); border-radius: 10px;
}
textarea { min-height: 120px; resize: vertical; }

.charcount { text-align: right; }
.warn { color: var(--red); font-weight: 600; }

/* Buttons */
.actions { display: flex; gap: 12px; margin-top: 8px; }
button {
  min-height: var(--tap); padding: 12px 20px; font-size: 17px;
  border-radius: 10px; border: 1px solid var(--blue); cursor: pointer;
}
button.primary { background: var(--blue); color: #fff; flex: 1; }
button.secondary { background: #fff; color: var(--blue); }
button:disabled { opacity: .5; cursor: not-allowed; }

.error { color: var(--red); font-weight: 600; margin-top: 12px; }
.hidden { display: none; }
