/* ==========================================================================
   style.css — apparence du questionnaire
   Style « chaleureux » (crème et vert sapin), pensé d'abord pour le téléphone.
   Pour changer une couleur ou une taille, modifie les variables juste en dessous.
   ========================================================================== */

:root {
  --fond: #f7f1e8;              /* fond de la page : crème */
  --carte: #fffdf9;             /* fond du bloc de questions */
  --texte: #2a2420;
  --texte-doux: #6b6158;
  --bordure: #e7ddd0;
  --principal: #1f5f4f;         /* boutons et barre : vert sapin (ne rappelle aucun des deux parcs) */
  --principal-survol: #174a3d;
  --selection: #e9f2ee;         /* fond d'une réponse cochée */
  --accent: #b26b3a;            /* petits titres de partie (« Vous », « Vos choix »…) */
  --erreur: #b42318;
  --erreur-fond: #fef3f2;
  --couleur-parc: #57606a;      /* remplacée par la couleur du parc (voir VERSIONS dans script.js) */
  --rayon: 14px;
  color-scheme: light;
}

/* Police des titres (Fraunces), rangée dans le dossier polices/ :
   rien n'est chargé depuis un autre site, donc aucune adresse IP n'est transmise. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("polices/fraunces-600.woff2") format("woff2");
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
}

/* ---------- Bandeau de test (visible seulement pendant les essais) ---------- */
.bandeau-test {
  padding: 8px 16px;
  background: #fff3c4;
  color: #4d3800;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

/* ---------- Barre de progression ---------- */
.entete {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--fond);
  padding: 12px 16px;
}
.compteur {
  max-width: 36rem;
  margin: 8px auto 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}
.compteur[hidden] { display: none; }
.progression {
  max-width: 36rem;
  height: 6px;
  margin: 0 auto;
  background: var(--bordure);
  border-radius: 999px;
  overflow: hidden;
}
.progression-remplissage {
  width: 0;
  height: 100%;
  background: var(--principal);
  transition: width 0.3s ease;
}

/* ---------- Zone principale ---------- */
.contenu {
  flex: 1;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 4px 16px 16px;
}
.carte {
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: 0 4px 18px rgba(80, 60, 30, 0.07);
  padding: 30px 22px;
}

/* Un seul écran visible à la fois */
.ecran { display: none; }
.ecran.actif { display: block; }

h1 {
  margin: 0 0 16px;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  line-height: 1.25;
  font-weight: 600;
}
h1:focus { outline: none; }

p { margin: 0 0 12px; }

.infos { padding-left: 1.25rem; margin: 0 0 12px; }
.infos li { margin: 6px 0; }

.aide { color: var(--texte-doux); font-size: 1rem; margin-top: 8px; }
.consigne { display: block; color: var(--texte-doux); font-size: 1rem; margin-bottom: 8px; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; width: 100%; }

/* ---------- Réponses à choisir (gros boutons) ---------- */
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin-top: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--bordure);
  border-radius: var(--rayon);
  background: var(--carte);
  cursor: pointer;
}
.option:hover { border-color: #c9b9a4; }
.option input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--principal);
}
.option:has(input:checked) {
  border-color: var(--principal);
  background: var(--selection);
  font-weight: 600;
}
.option:has(input:focus-visible) {
  outline: 3px solid var(--principal);
  outline-offset: 2px;
}
.option-accord { margin-top: 20px; }

/* Petit titre de partie au-dessus de la question (« Vous », « Vos habitudes »…) */
.partie {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Prix affichés dans la question du test A/B */
.prix-ab {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.prix-ab li {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f4ece0;
  border-radius: 8px;
}
.prix-ab strong { font-variant-numeric: tabular-nums; }

/* Cadeau de la version B, sous le prix */
.prix-ab li { flex-wrap: wrap; column-gap: 12px; }
.prix-ab .bonus {
  flex-basis: 100%;
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- Une page = jusqu'à 3 questions ---------- */
.question {
  margin: 0;
  padding: 0;
  border-radius: var(--rayon);
}
.question + .question {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--bordure);
}
h2 {
  margin: 0 0 12px;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  line-height: 1.3;
  font-weight: 600;
}
h2:focus { outline: none; }
.ecran > .partie { margin-bottom: 14px; }
.ecran > .consigne { margin-bottom: 18px; }

/* Question oubliée : signalée quand on clique sur Suivant */
.question.manquante {
  outline: 2px solid var(--erreur);
  outline-offset: 8px;
}

/* ---------- Matrice : une ligne par élément, une réponse par ligne ---------- */
.ligne-matrice {
  margin-top: 14px;
  padding: 12px 14px;
  background: #faf5ee;
  border-radius: var(--rayon);
}
.ligne-matrice legend {
  float: left;
  width: 100%;
  margin-bottom: 8px;
  font-weight: 600;
}
.pastilles {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pastille {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1.5px solid var(--bordure);
  border-radius: 999px;
  background: var(--carte);
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
}
.pastille input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pastille:has(input:checked) {
  border-color: var(--principal);
  background: var(--principal);
  color: #ffffff;
  font-weight: 600;
}
.pastille:has(input:focus-visible) {
  outline: 3px solid var(--principal);
  outline-offset: 2px;
}

/* Un champ de prix par parc (Van Westendorp) */
.champ-parc {
  display: block;
  margin-top: 16px;
  font-weight: 600;
}

/* ---------- Champ de prix en euros ---------- */
.champ-prix {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.champ-prix input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font: inherit;
  font-size: 1.5rem;
  border: 2px solid var(--bordure);
  border-radius: var(--rayon);
  background: var(--carte);
}
.champ-prix input:focus {
  outline: 3px solid var(--principal);
  outline-offset: 1px;
  border-color: var(--principal);
}
.champ-prix span { font-size: 1.5rem; font-weight: 600; }

/* ---------- Fiche de l'offre (seuls le nom et la couleur changent entre A et B) ---------- */
.offre {
  margin: 8px 0 16px;
  border: 2px solid var(--couleur-parc);
  border-radius: var(--rayon);
  overflow: hidden;
}
.offre-parc {
  margin: 0;
  padding: 16px 20px;
  background: var(--couleur-parc);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
}
.offre-details { padding: 16px 20px; }
.offre-titre { font-weight: 700; margin-bottom: 8px; }
.offre ul { margin: 0; padding-left: 1.25rem; }
.offre li { margin: 4px 0; }

/* ---------- Messages ---------- */
.message {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 1rem;
}
.message-erreur {
  color: var(--erreur);
  background: var(--erreur-fond);
  border: 1px solid #f4b4ad;
}
.message-verification {
  background: #f4ece0;
  border-left: 4px solid var(--accent);
}

/* État de l'envoi des réponses, sur l'écran de fin */
.etat-envoi {
  margin: 16px 0 0;
  color: var(--texte-doux);
  font-size: 1rem;
}

/* ---------- Bouton Suivant ---------- */
.bouton {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 24px;
  border: 0;
  border-radius: var(--rayon);
  background: var(--principal);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.bouton:hover { background: var(--principal-survol); }
.bouton:focus-visible { outline: 3px solid var(--principal); outline-offset: 3px; }

/* ---------- Pied de page ---------- */
.pied {
  padding: 8px 16px 20px;
  text-align: center;
  color: var(--texte-doux);
  font-size: 0.875rem;
  font-style: italic;
}

/* ---------- Écrans plus larges (ordinateur) ---------- */
@media (min-width: 640px) {
  .contenu { padding-top: 24px; }
  .carte { padding: 32px; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
}
