/* VF Interview — strict black & white, Apple-ish. Mobile first. */

@font-face {
  font-family: "Public Sans";
  src: url("/static/fonts/public-sans-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("/static/fonts/public-sans-medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("/static/fonts/public-sans-semibold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  /* Both palettes below are real, so native controls — the audio player, radio
     buttons, scrollbars — should follow the reader's setting too, instead of
     staying light on a dark page. */
  color-scheme: light dark;

  --bg: #ffffff;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --surface: #f5f5f7;

  --font: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --maxw: 720px;
  --radius: 16px;
  --gap: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #f5f5f7;
    --muted: #98989d;
    --line: #38383a;
    --surface: #1c1c1e;
  }
}

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

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

/* Conditional fields are toggled with the hidden attribute; flex/grid would win. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding-left: 1.2em;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* ---------- Layout ---------- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 20px 96px;
}

@media (min-width: 700px) {
  .container {
    padding: 64px 24px 128px;
  }
}

.progress {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  height: 1px;
  background: var(--line);
}

.progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--fg);
  transition: width .3s ease;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
}

.muted {
  color: var(--muted);
}

.note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

/* The closing note sits under the action row; keep it off the buttons. */
.actions + .note {
  margin-top: 22px;
}

/* ---------- Landing ---------- */

.landing {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 24px;
}

/* The file is white artwork on transparent, so it is inverted to near-black on
   the light theme and left as-is on the dark one. */
.landing__logo {
  width: clamp(200px, 46vw, 260px);
  height: auto;
  align-self: flex-start;
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  .landing__logo {
    filter: none;
  }
}

.landing__title {
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.06;
}

.landing__lede {
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.5;
  color: var(--fg);
  max-width: 34em;
}

.landing__meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

/* ---------- Step ---------- */

.step {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.step__eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.step__intro {
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg);
  max-width: 36em;
  white-space: pre-line;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.q {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.q__label {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.12;
  margin: 0;
}

.q__help {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 36em;
}

.info-block {
  font-size: 17px;
  line-height: 1.65;
  white-space: pre-line;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

/* ---------- Inputs ---------- */

.textarea,
.input {
  font-family: inherit;
  font-size: 19px;
  line-height: 1.55;
  color: var(--fg);
  background: transparent;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 0;
  appearance: none;
}

.textarea {
  min-height: 132px;
  resize: none;
  overflow: hidden;
}

.textarea::placeholder,
.input::placeholder,
.sentence__input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.textarea:focus,
.input:focus,
.sentence__input:focus {
  outline: none;
  border-bottom-color: var(--fg);
  border-bottom-width: 2px;
  padding-bottom: 9px;
}

.textarea:focus-visible,
.input:focus-visible,
.sentence__input:focus-visible {
  outline: none;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 17px;
  line-height: 1.4;
  background: var(--bg);
}

.choice input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.choice input:checked {
  border: 6px solid var(--fg);
}

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

.choice.is-selected {
  border: 2px solid var(--fg);
  padding: 17px 19px;
}

.choice:has(input:checked) {
  border: 2px solid var(--fg);
  padding: 17px 19px;
}

.sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 19px;
  line-height: 1.6;
}

.sentence__prefix {
  color: var(--fg);
}

.sentence__input {
  flex: 1 1 12em;
  min-width: 10em;
  font-family: inherit;
  font-size: 19px;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--fg);
  border-radius: 0;
  padding: 4px 0;
  appearance: none;
}

/* ---------- Probes ---------- */

/* Probes sit between the question and its input, so they read as part of the
   question rather than as a footnote under the answer. */
.probes {
  background: var(--surface);
  border-left: 3px solid var(--fg);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.probes__caption {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.probes__list {
  margin: 0;
  padding-left: 1.1em;
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.probes--collapsed {
  padding: 0;
}

.probes--collapsed > summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.probes--collapsed > summary::-webkit-details-marker {
  display: none;
}

.probes--collapsed > summary::after {
  content: " +";
}

.probes--collapsed[open] > summary::after {
  content: " –";
}

.probes--collapsed > .probes__list {
  padding: 0 20px 18px 2em;
}

/* ---------- Recorder ---------- */

.recorder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.recorder__btn {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 980px;
  padding: 9px 18px;
  cursor: pointer;
}

.recorder__btn:hover {
  border-color: var(--fg);
}

.recorder__status {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.recorder__level {
  flex: 0 0 auto;
  width: 96px;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.recorder__level > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--fg);
}

.recorder__player {
  flex: 1 1 240px;
  min-width: 220px;
}

.recorder__player audio {
  width: 100%;
  display: block;
}

.recorder__error {
  flex: 1 1 100%;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Actions ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 980px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.btn--primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.btn--ghost {
  border-color: var(--line);
  color: var(--fg);
}

.btn--ghost:hover {
  border-color: var(--fg);
}

.btn--danger {
  border-color: var(--fg);
  color: var(--fg);
  background: transparent;
}

.btn[disabled] {
  opacity: .4;
  cursor: default;
}

/* ---------- Admin ---------- */

.admin {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100vh;
}

.admin__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.admin__nav a {
  text-decoration: none;
  color: var(--muted);
}

.admin__nav a:hover {
  color: var(--fg);
}

.admin__main {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 96px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.admin__main h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.admin__main h2 {
  font-size: 17px;
  font-weight: 600;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table th {
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="email"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
  font: inherit;
  font-size: 15px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}

.form-row textarea {
  min-height: 96px;
  resize: vertical;
}

.label {
  font-size: 13px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 980px;
  color: var(--muted);
  white-space: nowrap;
}

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.split > * {
  flex: 1 1 260px;
  min-width: 0;
}

/* ---------- Admin: statistiques ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 20px 0 32px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
}

.stat__value {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* The activity strip: one column per day, tall enough to compare at a glance
   and short enough to stay out of the way of the tables below. */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin: 16px 0 32px;
  overflow-x: auto;
}

.spark__col {
  flex: 1 1 0;
  min-width: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.spark__track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 72px;
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
}

.spark__bar {
  display: block;
  width: 100%;
  min-height: 0;
  background: var(--fg);
  border-radius: 6px 6px 0 0;
}

.spark__n {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.spark__label {
  font-size: 0.6875rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Admin: sessions ---------- */

/* Terminées / en cours: two lists, one at a time, so reading finished
   interviews is not interleaved with the ones still being filled in. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  font-size: 14px;
  line-height: 1;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 980px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover {
  color: var(--fg);
}

.tab.is-active {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

/* One step of an interview, read top down: step title, then each question,
   then the answer it drew. The type scale carries that order — the answer is
   the text you came to read, so it is the largest thing on the row, and the
   question above it stays a label: same colour, smaller, heavier. */
.qa {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 20px 16px;
}

.qa__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0 10px;
}

.qa__step {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.qa__step-code {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 980px;
  background: var(--bg);
}

/* The step prose the participant read above the questions. */
.qa__intro {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 74ch;
  margin: 0 0 10px;
}

.qa__probes {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.qa__probes > summary {
  cursor: pointer;
}

.qa__probes ul {
  margin: 8px 0 0;
  padding-left: 18px;
  max-width: 74ch;
}

.qa__probes li {
  margin-bottom: 4px;
}

.qa__row {
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.qa__q {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  max-width: 74ch;
}

/* The key names the field for the export; it is the least of what is on the
   row, so it sits smallest and lightest, above the question it labels. */
.qa__meta {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  opacity: .65;
  margin: 0;
}

/* 500, not 600: these questions run three sentences, and a wall of bold reads
   worse than the size step down from the answer already does. */
.qa__question {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  margin: 0;
}

.qa__help {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
}

/* The answer sits on the page background, a step out of the card, so a page of
   them can be scanned without reading a single question. */
.qa__a {
  font-size: 16px;
  line-height: 1.6;
  min-width: 0;
  max-width: 74ch;
  margin: 10px 0 18px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 10px;
}

.qa__a p {
  margin: 0 0 8px;
}

.qa__a p:last-child {
  margin-bottom: 0;
}

.qa__choice {
  font-weight: 600;
}

/* Sentence completion: show the amorce the participant was continuing, so the
   answer reads as the whole sentence it was. */
.qa__prefix {
  color: var(--muted);
}

.qa__a--empty {
  color: var(--muted);
}

/* The choices that were not taken, under the one that was: an answer of "non"
   means little without the alternatives it was picked over. */
.qa__options {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.qa__options span + span::before {
  content: " · ";
}

.qa__audio {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.qa__audio audio {
  max-width: 100%;
  height: 32px;
}

.qa .note {
  margin-top: 6px;
}
