/* Shared by the quiz, the privacy and terms pages and the 404 page. System fonts only: nothing external is loaded. */

:root {
  color-scheme: light;
  --bg: #ecf0ed;
  --surface: #ffffff;
  --ink: #18303a;
  --ink-soft: #46606a;
  --line: #c6d2cd;
  --line-strong: #7f938c;
  --pine: #0e5a4b;
  --pine-dark: #0a4538;
  --pine-tint: #e3f1ec;
  --amber: #f2a900;
  --asphalt: #1d2b31;
  --danger: #b42318;
  --danger-tint: #fdecea;
  --info-tint: #fff4d6;
  --focus: #1d4ed8;
  --radius: 12px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Class rules below set `display`; this keeps the hidden attribute stronger than any of them. */
[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
}

a {
  color: var(--pine);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.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;
}

/* ---------- Page frame ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  max-width: 36rem;
  margin: 0 auto;
  padding: 0.9rem 1rem;
  min-height: 3.4rem;
}

.brand {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.brand:hover {
  text-decoration: underline;
}

.shell {
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.site-footer .inner {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.1rem 1rem 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  align-items: center;
}

.site-footer a {
  color: var(--ink);
  padding: 0.35rem 0;
}

/* ---------- Progress: a lane marking, one dash per question ---------- */

.progress-wrap {
  margin-bottom: 0.9rem;
}

.progress-label {
  margin: 0 0 0.45rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.progress {
  display: flex;
  gap: 6px;
  padding: 7px;
  background: var(--asphalt);
  border-radius: 999px;
}

.progress span {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.24);
  transition: background-color 0.2s ease;
}

.progress span.on {
  background: var(--amber);
}

/* ---------- Card and screens ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
}

.screen {
  animation: screen-in 0.18s ease-out;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.q {
  margin: 0 0 1.1rem;
  font-size: clamp(1.625rem, 6.4vw, 2.1rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

.q:focus {
  outline: none;
}

/* The blocked screen is a heading and nothing else. */
.q:only-child {
  margin-bottom: 0;
}

.lede {
  margin: -0.4rem 0 1.25rem;
  color: var(--ink-soft);
}

.hint {
  margin: 0.45rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ---------- Option tiles ---------- */

.tiles {
  display: grid;
  gap: 0.7rem;
}

.tile {
  display: block;
  position: relative;
  cursor: pointer;
}

.tile input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.tile-text {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 3.75rem;
  padding: 0.7rem 1rem;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 1.125rem;
  font-weight: 650;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.tile-text::before {
  content: "";
  flex: 0 0 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.tile:hover .tile-text {
  border-color: var(--pine);
}

.tile input:checked + .tile-text {
  border-color: var(--pine);
  background: var(--pine-tint);
}

.tile input:checked + .tile-text::before {
  border-color: var(--pine);
  background: var(--pine) radial-gradient(circle, #ffffff 0 34%, transparent 38%);
}

.tile input:focus-visible + .tile-text {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Fields ---------- */

.field {
  margin-bottom: 1rem;
}

.field label,
.label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 700;
}

.input {
  display: block;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.6rem 0.9rem;
  border: 2px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.125rem; /* 16px or more keeps iOS from zooming on focus */
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.6rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 1.4rem) 52%, calc(100% - 1.05rem) 52%;
  background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
  background-repeat: no-repeat;
}

.input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  margin: 0.4rem 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--danger);
}

/* Honeypot: off screen rather than display:none, so naive bots still fill it. */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Consent ---------- */

.consent {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

.consent input {
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0.1rem 0 0;
  accent-color: var(--pine);
  cursor: pointer;
}

.consent-text {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.consent.is-invalid {
  border-color: var(--danger);
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.6rem 1.25rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  flex: 1;
  background: var(--pine);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--pine-dark);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  border-color: var(--ink);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Messages ---------- */

.notice {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 2px solid transparent;
  font-weight: 600;
}

.notice-error {
  background: var(--danger-tint);
  border-color: var(--danger);
  color: #7a1a12;
}

.notice-info {
  background: var(--info-tint);
  border-color: #b27d00;
  color: #523800;
}

.loading {
  margin: 2rem 0;
  text-align: center;
  color: var(--ink-soft);
}

#ts-container {
  margin-top: 1rem;
}

/* ---------- Document pages: privacy, terms, 404 ---------- */

.doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1.5rem;
}

.doc h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 6.4vw, 2.2rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.doc h2 {
  margin: 1.75rem 0 0.4rem;
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 750;
}

.doc p,
.doc li {
  max-width: 62ch;
}

.doc ul {
  padding-left: 1.25rem;
}

.doc li + li {
  margin-top: 0.35rem;
}

.doc .btn {
  margin-top: 0.75rem;
}

/* ---------- Larger screens ---------- */

@media (min-width: 40rem) {
  .shell {
    padding-top: 2rem;
  }

  .card,
  .doc {
    padding: 2rem;
  }

  .btn-primary {
    flex: 0 1 15rem;
  }

  .actions {
    justify-content: space-between;
  }
}

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