/* rsrchlab — shared styles (survey + admin)
   Palette: cool paper + ink, one cobalt accent. No external fonts/trackers. */

:root {
  --ink: #18202c;
  --ink-2: #3c4656;
  --muted: #667285;
  --paper: #f5f7fa;
  --surface: #ffffff;
  --line: #dde3eb;
  --line-strong: #c3ccd8;
  --accent: #1f4fd8;
  --accent-ink: #163aa3;
  --accent-soft: #eaf0ff;
  --ok: #1d7a4c;
  --ok-soft: #e7f5ee;
  --warn: #9a5b00;
  --danger: #b42318;
  --danger-soft: #fdecea;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(24, 32, 44, 0.04), 0 8px 24px rgba(24, 32, 44, 0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(245, 247, 250, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-inner {
  max-width: 760px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; font-size: 17px; }
.brand-mark { width: 22px; height: 22px; }
.progress { height: 3px; background: var(--line); }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.35s ease; }

.lang-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang-toggle button {
  border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; color: var(--muted); cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- layout ---------- */
main { max-width: 760px; margin: 0 auto; padding: 48px 24px 96px; }
.screen { max-width: 620px; }
.screen[hidden] { display: none; }
.screen.enter { animation: enter 0.35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .screen.enter { animation: none; }
  .progress > span { transition: none; }
}

h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; line-height: 1.18; margin: 0 0 18px; }
h1 { font-size: clamp(32px, 6vw, 46px); }
h2 { font-size: clamp(26px, 4.6vw, 34px); }
h3 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0 0 14px; }
.lede { font-size: 19px; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }

/* intro facts */
.facts { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.facts svg { width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }
.facts strong { display: block; font-weight: 600; }
.facts span { color: var(--ink-2); font-size: 15.5px; }

details.privacy { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px 18px; margin: 0 0 24px; }
details.privacy summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
details.privacy ul { margin: 0 0 14px; padding-left: 20px; color: var(--ink-2); font-size: 15.5px; }
details.privacy li { margin-bottom: 6px; }

/* ---------- step header ---------- */
.step-count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.step-count b { color: var(--accent); font-weight: 700; }
.question { font-family: var(--serif); font-size: clamp(26px, 4.6vw, 34px); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 10px; }
.hint { color: var(--muted); font-size: 15.5px; margin: 0 0 22px; }

/* ---------- inputs ---------- */
.field { margin: 22px 0 6px; }
input[type="text"], input[type="email"], input[type="number"] {
  width: 100%; font: inherit; font-size: 20px; color: var(--ink);
  padding: 14px 16px; background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="number"] { max-width: 180px; }
input::placeholder { color: #a3acb9; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[aria-invalid="true"] { border-color: var(--danger); }

.options { display: grid; gap: 10px; margin: 22px 0 6px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 13px 16px; cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.option:hover { border-color: var(--line-strong); }
.option .key {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 6px;
  font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums;
}
.option[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.option[aria-checked="true"] .key { background: var(--accent); border-color: var(--accent); color: #fff; }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15.5px; color: var(--ink-2); margin: 0 0 24px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

.error { color: var(--danger); font-size: 15px; min-height: 22px; margin: 6px 0 0; }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 26px; }
.btn {
  appearance: none; font: inherit; font-weight: 600; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: var(--r-md); border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink-2); }
.btn-quiet { background: transparent; color: var(--muted); padding-left: 8px; padding-right: 8px; }
.btn-quiet:hover { color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f1c4bf; }
.btn-danger:hover { background: var(--danger-soft); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.kbd-hint { font-size: 13.5px; color: var(--muted); }
.kbd-hint kbd { font-family: inherit; font-weight: 600; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; font-size: 12.5px; }

/* ---------- donation ---------- */
.video-wrap { background: var(--ink); border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 9; margin: 22px 0 10px; position: relative; }
.video-wrap video { width: 100%; height: 100%; display: block; background: #000; }
.video-wrap video[hidden] { display: none; }
.video-missing { position: absolute; inset: 0; display: grid; place-items: center; color: #c9d1dc; text-align: center; padding: 24px; font-size: 15px; }

.how { counter-reset: how; list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 12px; }
.how li { counter-increment: how; display: grid; grid-template-columns: 30px 1fr; gap: 10px; color: var(--ink-2); font-size: 16px; }
.how li::before {
  content: counter(how); width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 14px;
}

.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface);
  padding: 34px 24px; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s;
  margin: 24px 0 8px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 34px; height: 34px; color: var(--accent); margin-bottom: 8px; }
.dropzone strong { display: block; font-size: 17px; }
.dropzone .muted { font-size: 14.5px; }
.file-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--accent); border-radius: var(--r-md);
  padding: 12px 16px; margin: 24px 0 8px; font-size: 15.5px;
}
.file-chip .name { font-weight: 600; word-break: break-all; }
.upload-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 14px 0 4px; }
.upload-bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

.donate-actions { display: grid; gap: 10px; margin-top: 22px; }
@media (min-width: 560px) {
  .donate-actions { grid-template-columns: auto auto 1fr; align-items: center; }
  .donate-actions .btn-quiet { justify-self: end; }
}

/* ---------- final screens ---------- */
.done-mark { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); margin-bottom: 22px; }
.done-mark svg { width: 28px; height: 28px; }

footer.site { max-width: 760px; margin: 0 auto; padding: 0 24px 40px; color: var(--muted); font-size: 13.5px; }

@media (max-width: 520px) {
  main { padding-top: 32px; }
  body { font-size: 16px; }
  .btn { width: 100%; }
  .actions .kbd-hint { display: none; }
}
