/* Quiz « Quelle ligne choisirais-tu dans une chanson ? » — mobile d'abord, une seule couleur d'accent. */

:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #1c1c1e;          /* contraste 16:1 sur --bg */
  --muted: #55555c;         /* contraste 7:1 sur --bg */
  --border: #d6d6d0;
  --accent: #0b5c6b;        /* contraste 7,4:1 avec le blanc */
  --accent-soft: #e3eff1;
  --error: #b3261e;         /* contraste 6:1 sur --bg */
  --radius: 12px;
  --tap: 48px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.app {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.screen { display: flex; flex-direction: column; gap: 1rem; }
.screen[hidden] { display: none; }

h1, h2, h3 { line-height: 1.25; margin: 0; }
p { margin: 0; }

.title { font-size: 1.6rem; padding-top: 1.5rem; }
.title:focus, .consigne:focus, .visually-hidden:focus { outline: none; }
.lead { font-size: 1.15rem; color: var(--muted); }
.intro { display: flex; flex-direction: column; gap: 0.85rem; min-width: 0; }

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled { cursor: progress; opacity: 0.7; }
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover:not(:disabled) { background: #084a57; }
.btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn-link {
  align-self: flex-start;
  background: none;
  color: var(--accent);
  padding-left: 0;
  padding-right: 0.5rem;
}
.btn-link:hover { text-decoration: underline; }

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

a { color: var(--accent); }

/* Progression */
.progress { display: flex; flex-direction: column; gap: 0.4rem; }
.progress-label { font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.progress-track { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.progress-bar { height: 100%; width: 10%; background: var(--accent); transition: width 0.2s ease; }

/* Énoncé : une information par ligne, étiquette en petites capitales au-dessus */
.prompt { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; }
.prompt-item { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.prompt-item[hidden] { display: none; }
.prompt dd { margin: 0; }
.label {
  font-size: 1rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.idea { font-size: 1.25rem; font-weight: 600; }
.context { color: var(--text); }
.line { font-size: 1.1rem; font-style: italic; }
.consigne { font-size: 1.15rem; margin-top: 0.5rem; }

/* Options */
.options { display: flex; flex-direction: column; gap: 0.75rem; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}
.option:hover:not(:disabled) { border-color: var(--accent); }
.option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.option:disabled { cursor: default; }
.option-letter {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.option[aria-pressed="true"] .option-letter { background: var(--accent); color: #fff; }
.option-text { padding-top: 0.15rem; min-width: 0; }

/* Formulaire */
form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-weight: 600; }
.field input[type="text"],
.field input[type="email"] {
  min-height: var(--tap);
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.field input:focus-visible { border-color: var(--accent); }
.field input[aria-invalid="true"] { border-color: var(--error); }

.field-check {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  align-items: start;
  column-gap: 0.5rem;
  margin-left: -0.75rem;        /* la zone tactile déborde à gauche, la case reste alignée */
}
.field-check input {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0.75rem 0 0.75rem 0.75rem;   /* zone tactile de 48 px de haut */
  accent-color: var(--accent);
}
.field-check label { font-weight: 400; padding: 0.7rem 0; cursor: pointer; }
.field-check .field-error { grid-column: 2; }

.field-error { color: var(--error); font-size: 0.95rem; font-weight: 600; }
.suggest { font-size: 0.95rem; }
.suggest[hidden] { display: none; }
.btn-suggest {
  min-height: var(--tap);
  padding: 0.25rem 0.1rem;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.info { font-size: 0.95rem; color: var(--muted); }

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* États */
.status { color: var(--muted); min-height: 1.5rem; }
.alert {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 2px solid var(--error);
  border-radius: var(--radius);
  background: #fdf1f0;
}
.alert[hidden] { display: none; }

/* Confirmation */
.done-text { display: flex; flex-direction: column; gap: 0.85rem; }
.done-text a { font-weight: 600; }
.done-close-msg { font-weight: 600; color: var(--muted); margin-top: 0.5rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

/* Page de confidentialité */
.legal { display: flex; flex-direction: column; gap: 0.75rem; }
.legal h2 { font-size: 1.2rem; margin-top: 1.25rem; }
.legal ul { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.35rem; }
.legal a { display: inline-block; min-height: 1.5rem; }
.legal .back a, .legal > p:first-child a { min-height: var(--tap); display: inline-flex; align-items: center; }
.muted { color: var(--muted); font-size: 0.95rem; }
mark.todo {
  background: #fff1a8;
  color: var(--text);
  outline: 2px dashed #8a6d00;
  padding: 0 0.2rem;
  font-weight: 700;
}
