/* Feuille de style du questionnaire */
:root {
  --orange: #ff6900;          /* couleur principale */
  --orange-dark: #d95a00;
  --bg: #f6f6f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #e2e2e6;
  --selected: #fff3e8;
  --danger: #c4281c;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

h1 { font-size: 1.45rem; margin: 0 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 0.92rem; }

/* --- Choix de langue --- */
.lang-buttons { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.lang-btn {
  flex: 1 1 140px;
  padding: 18px 12px;
  font-size: 1.05rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.lang-btn:hover, .lang-btn:focus-visible { border-color: var(--orange); background: var(--selected); }

/* --- Intro / code --- */
.intro-html p { margin: 0 0 12px; }
.intro-html ul { margin: 0 0 12px; padding-left: 22px; }
.intro-html li { margin-bottom: 6px; }

.code-input {
  width: 100%;
  max-width: 260px;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  margin-top: 6px;
}
.code-input:focus { outline: none; border-color: var(--orange); }

.consent { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0; }
.consent input { margin-top: 4px; transform: scale(1.3); }

/* --- Boutons --- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 13px 26px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--orange);
  color: #fff;
  transition: background .15s;
}
.btn:hover { background: var(--orange-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #e8e8ec; color: var(--text); }
.btn.secondary:hover { background: #d8d8de; }
.nav-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }

/* --- Progression --- */
.progress-wrap { margin: 4px 0 18px; }
.progress-label { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--orange); border-radius: 3px; transition: width .25s; }

/* --- Questions --- */
.section-title { font-size: 1.3rem; margin-bottom: 4px; }
.section-intro {
  background: #f0f4ff;
  border-left: 4px solid #4a6fd6;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
  margin: 12px 0 4px;
}
.question { padding: 18px 0; border-bottom: 1px solid var(--border); }
.question:last-child { border-bottom: none; }
.q-text { font-weight: 600; margin-bottom: 12px; }
.q-hint {
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
  margin: -6px 0 12px;
  line-height: 1.45;
}
.q-id { color: var(--muted); font-weight: 400; font-size: 0.8rem; margin-right: 6px; }

.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  font-size: 0.97rem;
}
.option:hover { border-color: #c9c9cf; }
.option.selected { border-color: var(--orange); background: var(--selected); }
.option input { accent-color: var(--orange); transform: scale(1.2); flex-shrink: 0; }
.option.na { border-style: dashed; color: var(--muted); }

textarea.open-answer {
  width: 100%;
  min-height: 96px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  resize: vertical;
}
textarea.open-answer:focus { outline: none; border-color: var(--orange); }

.error-box {
  background: #fdecea;
  border: 1px solid #f5c6c2;
  color: var(--danger);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 0.95rem;
}

/* --- Écran de fin --- */
.end-help { background: #f0f4ff; border-radius: 10px; padding: 16px 18px; margin-top: 16px; }
.end-help ul { margin: 8px 0 0; padding-left: 20px; }
.end-help li { margin-bottom: 6px; }

/* --- Langue (rappel discret en haut) --- */
.lang-switch { text-align: right; margin-bottom: 10px; }
.lang-switch button {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 10px; margin-left: 6px; cursor: pointer; color: var(--muted); font-size: 0.85rem;
}
.lang-switch button.active { border-color: var(--orange); color: var(--orange); font-weight: 600; }

@media (max-width: 520px) {
  .card { padding: 18px; }
  h1 { font-size: 1.25rem; }
}
