/* ==========================================================================
   Parcours patient — kiosque tablette
   Univers : santé, chaleureux, rassurant. Fond doux, un accent sarcelle,
   coins très arrondis, ombres légères. Corps ≥ 18 px, questions ≥ 24 px.
   ========================================================================== */

:root {
  /* Palette */
  --fond: #f6f3ee;            /* papier chaud */
  --surface: #ffffff;
  --encre: #263230;           /* vert-ardoise foncé — contraste AA sur blanc */
  --encre-douce: #5b6a66;
  --accent: #0e7a6d;          /* sarcelle santé */
  --accent-fonce: #0a5f55;
  --accent-doux: #e2f0ed;
  --ligne: #e4ded4;

  /* Dégradé sémantique Likert : désaccord → accord */
  --likert-1: #c2603d;        /* terracotta */
  --likert-2: #cf8a4e;
  --likert-3: #948e7d;        /* neutre sable */
  --likert-4: #5f9a6e;
  --likert-5: #197d63;

  --rayon: 20px;
  --ombre: 0 2px 8px rgba(38, 50, 48, 0.07), 0 8px 28px rgba(38, 50, 48, 0.06);
  --duree: 240ms;
  --ressort: cubic-bezier(0.22, 0.9, 0.32, 1);

  font-size: 18px;            /* base ≥ 18 px partout */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 85% -10%, #eaf3ef 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #f3ece1 0%, transparent 55%),
    var(--fond);
  color: var(--encre);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI",
    Roboto, "Nunito", "Helvetica Neue", sans-serif;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow: hidden;             /* kiosque : pas de défilement de page parasite */
  user-select: none;
}

/* --- Barre de progression ------------------------------------------------ */
.progression {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 7px;
  background: rgba(38, 50, 48, 0.08);
  z-index: 10;
}
.progression-barre {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #2ba08b);
  border-radius: 0 4px 4px 0;
  transition: width 380ms var(--ressort);
}

/* --- Écran courant --------------------------------------------------------- */
.ecran {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  overflow-y: auto;
}

.panneau {
  width: 100%;
  max-width: 660px;
  background: var(--surface);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 40px 36px;
}

/* Transitions entre écrans (fondu + léger glissement) */
.panneau { animation: entree var(--duree) var(--ressort) both; }
@keyframes entree {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
.panneau.sortie {
  animation: sortie 180ms ease-in both;
}
@keyframes sortie {
  to { opacity: 0; transform: translateX(-24px); }
}
.panneau.entree-arriere { animation-name: entree-arriere; }
@keyframes entree-arriere {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* --- Écran d'accueil -------------------------------------------------------- */
.accueil { text-align: center; }
.accueil .pictogramme {
  width: 76px; height: 76px;
  margin: 0 auto 18px;
  border-radius: 24px;
  background: var(--accent-doux);
  display: flex; align-items: center; justify-content: center;
}
.accueil .pictogramme svg { width: 42px; height: 42px; stroke: var(--accent); }
.accueil h1 {
  font-size: 2rem;             /* 36 px */
  line-height: 1.2;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.puce-duree {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-doux);
  color: var(--accent-fonce);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 999px;
  padding: 7px 18px;
  margin-bottom: 22px;
}
.accueil p { margin: 0 0 12px; color: var(--encre-douce); text-align: left; }
.encart-anonymat {
  background: var(--accent-doux);
  border-radius: 14px;
  padding: 14px 18px;
  margin: 18px 0;
  text-align: left;
  color: var(--accent-fonce);
  font-weight: 600;
}
.accueil .actions { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }

/* --- Boutons ----------------------------------------------------------------- */
.btn {
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 16px;
  min-height: 64px;
  padding: 14px 26px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.btn:active { transform: scale(0.975); }
.btn-principal {
  background: var(--accent);
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 3px 10px rgba(14, 122, 109, 0.32);
}
.btn-principal:hover { background: var(--accent-fonce); }
.btn-principal:disabled {
  background: #b9c9c5; box-shadow: none; cursor: default; transform: none;
}
.btn-discret {
  background: transparent;
  color: var(--encre-douce);
  font-size: 1rem;
  min-height: 56px;
}
.btn-discret:hover { color: var(--encre); background: rgba(38,50,48,0.05); }

/* --- Écran question ----------------------------------------------------------- */
.compteur {
  color: var(--encre-douce);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}
.question-texte {
  font-size: 1.45rem;           /* ≥ 24 px */
  line-height: 1.35;
  font-weight: 700;
  margin: 0 0 24px;
  letter-spacing: -0.005em;
}

/* Options — zone tactile généreuse (≥ 64 px) */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 18px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  color: var(--encre);
  background: var(--surface);
  border: 2px solid var(--ligne);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}
.option:active { transform: scale(0.985); }
.option .pastille {
  width: 16px; height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--p, var(--accent));
  opacity: 0.85;
}
.option .coche {
  margin-left: auto;
  width: 26px; height: 26px;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 140ms ease, transform 140ms var(--ressort);
}
.option[aria-pressed="true"] {
  border-color: var(--p, var(--accent));
  background: color-mix(in srgb, var(--p, var(--accent)) 12%, white);
}
.option[aria-pressed="true"] .coche { opacity: 1; transform: scale(1); }
.option .coche circle { fill: var(--p, var(--accent)); }

/* Navigation bas d'écran */
.navigation {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}
.navigation .btn-principal { flex: 1; max-width: 300px; margin-left: auto; }

/* --- Écran de remerciement ------------------------------------------------------ */
.merci { text-align: center; padding: 30px 10px; }
.merci h1 { font-size: 1.9rem; margin: 18px 0 8px; }
.merci p { color: var(--encre-douce); margin: 0; }
.coche-celebration { width: 108px; height: 108px; margin: 0 auto; }
.coche-celebration .cercle {
  fill: none; stroke: var(--accent); stroke-width: 3;
  stroke-dasharray: 302; stroke-dashoffset: 302;
  animation: tracer 500ms var(--ressort) forwards;
}
.coche-celebration .trait {
  fill: none; stroke: var(--accent); stroke-width: 6;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: tracer 320ms 380ms ease-out forwards;
}
@keyframes tracer { to { stroke-dashoffset: 0; } }

/* --- Bandeau d'erreur réseau ------------------------------------------------------ */
.erreur {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  background: #fdf2ee;
  border: 2px solid #d9825f;
  color: #7c3a1d;
  border-radius: 16px;
  padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--ombre);
  z-index: 20;
}
.erreur[hidden] { display: none; }
.erreur p { margin: 0; flex: 1; font-weight: 600; }
.erreur .btn { min-height: 52px; }

/* --- Sélecteur site / médecin (si lien non pré-paramétré) --------------------------- */
.selecteur h2 { font-size: 1.2rem; margin: 18px 0 8px; }
.selecteur .options { flex-direction: row; flex-wrap: wrap; }
.selecteur .option { width: auto; flex: 1 1 140px; justify-content: center; text-align: center; }

/* --- Accessibilité / divers ----------------------------------------------------------- */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Paysage tablette : panneau un peu plus large, marges réduites */
@media (orientation: landscape) and (max-height: 860px) {
  .ecran { padding: 18px 24px; }
  .panneau { padding: 28px 34px; max-width: 760px; }
  .accueil h1 { font-size: 1.7rem; }
  .question-texte { font-size: 1.3rem; margin-bottom: 16px; }
  .options { gap: 8px; }
  .option { min-height: 58px; }
}

/* Petits écrans (téléphone via QR code) */
@media (max-width: 480px) {
  .panneau { padding: 28px 20px; }
  .accueil h1 { font-size: 1.6rem; }
  .question-texte { font-size: 1.25rem; }
}
