/* =============================================================================
   QUIZ EMPREINTE CARBONE + EAU · La Libre
   style.css
   Conçu pour un embed de 600 à 700 px de large en desktop, pleine largeur
   en mobile. Les polices sont à brancher en woff2 self-hosted (voir @font-face
   en bas de fichier).
   ========================================================================== */

/* ------------------------------------------------------------- 1. Tokens -- */
:root {
  /* Couleurs */
  --c-papier:       #F7F6F3;
  --c-surface:      #FFFFFF;
  --c-encre:        #16191D;
  --c-encre-douce:  #5A6068;
  --c-trait:        #DEDBD4;
  --c-carbone:      #1F2328;
  --c-eau:          #0B6E9E;
  --c-eau-clair:    #E4F0F7;
  --c-accent:       #B3593F;
  --c-focus:        #0B6E9E;

  /* Typographie : remplacer par les familles IPM une fois les woff2 en place */
  --ff-titre: "IPM Serif", Georgia, "Times New Roman", serif;
  --ff-texte: "IPM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ff-data:  "IPM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Rythme */
  --esp-1: 4px;
  --esp-2: 8px;
  --esp-3: 12px;
  --esp-4: 16px;
  --esp-5: 24px;
  --esp-6: 32px;
  --esp-7: 48px;

  --rayon: 3px;
}

/* --------------------------------------------------------------- 2. Base -- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-papier);
}

body {
  font-family: var(--ff-texte);
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-encre);
  -webkit-font-smoothing: antialiased;
}

.quiz {
  max-width: 700px;
  margin: 0 auto;
  padding: var(--esp-5) var(--esp-4) var(--esp-6);
}

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

.noscript {
  font-family: var(--ff-texte);
  padding: var(--esp-5);
  text-align: center;
}

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

/* ---------------------------------------------------------- 2 bis. Marque -- */
.marque {
  display: flex;
  align-items: center;
  padding-bottom: var(--esp-4);
  margin-bottom: var(--esp-5);
  border-bottom: 1px solid var(--c-trait);
}

.marque__logo {
  display: block;
  height: 26px;
  width: auto;
  color: var(--c-encre);
}

/* ------------------------------------------------- 3. En-tête et compteurs -- */
.entete {
  margin-bottom: var(--esp-6);
}

.compteurs {
  display: flex;
  align-items: flex-end;
  gap: var(--esp-5);
  padding-bottom: var(--esp-3);
}

.compteur {
  display: flex;
  align-items: baseline;
  gap: var(--esp-2);
  flex: 1;
}

.compteur + .compteur {
  border-left: 1px solid var(--c-trait);
  padding-left: var(--esp-5);
}

.compteur__cle {
  font-family: var(--ff-texte);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-encre-douce);
}

.compteur__valeur {
  font-family: var(--ff-data);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--c-carbone);
}

.compteur--eau .compteur__valeur,
.compteur--eau .compteur__cle { color: var(--c-eau); }

.compteur__unite {
  font-size: 12px;
  color: var(--c-encre-douce);
}

.progression {
  height: 2px;
  background: var(--c-trait);
  overflow: hidden;
}

.progression__barre {
  height: 100%;
  background: var(--c-encre);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s ease;
}

.progression__texte {
  margin: var(--esp-2) 0 0;
  font-size: 12px;
  color: var(--c-encre-douce);
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- 4. Écrans -- */
.ecran.is-actif { animation: apparition 0.28s ease both; }

@keyframes apparition {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* --- Intro --- */
.surtitre {
  margin: 0 0 var(--esp-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.titre {
  font-family: var(--ff-titre);
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 var(--esp-4);
  letter-spacing: -0.01em;
}

.chapo {
  margin: 0 0 var(--esp-5);
  font-size: 17px;
  line-height: 1.55;
  color: var(--c-encre-douce);
}

.reperes {
  list-style: none;
  margin: 0 0 var(--esp-6);
  padding: var(--esp-4) 0;
  border-top: 1px solid var(--c-trait);
  border-bottom: 1px solid var(--c-trait);
  display: flex;
  gap: var(--esp-5);
}

.repere { flex: 1; }

.repere__valeur {
  display: block;
  font-family: var(--ff-data);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--c-carbone);
}

.repere--eau .repere__valeur { color: var(--c-eau); }

.repere__legende {
  display: block;
  margin-top: var(--esp-2);
  font-size: 13px;
  line-height: 1.4;
  color: var(--c-encre-douce);
}

.mention {
  margin: var(--esp-4) 0 0;
  font-size: 12px;
  color: var(--c-encre-douce);
}

/* --- Question --- */
.categorie {
  --c-categorie: var(--c-encre-douce);
  margin: 0 0 var(--esp-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-categorie);
}

.categorie::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  margin-right: var(--esp-2);
  vertical-align: middle;
  background: currentColor;
}

.question {
  font-family: var(--ff-titre);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 var(--esp-2);
}

.question__aide {
  margin: 0 0 var(--esp-4);
  font-size: 14px;
  color: var(--c-encre-douce);
}

.options {
  border: 0;
  margin: 0 0 var(--esp-5);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--esp-3);
  padding: var(--esp-3) var(--esp-4);
  background: var(--c-surface);
  border: 1px solid var(--c-trait);
  border-radius: var(--rayon);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option:hover { border-color: var(--c-encre); }

.option__input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  margin: 0;
}

.option__puce {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1px solid var(--c-encre-douce);
  border-radius: 50%;
  position: relative;
  transition: border-color 0.15s ease;
}

.option__label {
  font-size: 15px;
  line-height: 1.35;
}

.option__input:checked ~ .option__puce {
  border-color: var(--c-encre);
  border-width: 5px;
}

.option:has(.option__input:checked) {
  border-color: var(--c-encre);
  background: #FFFDF7;
}

.option:has(.option__input:focus-visible) {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ 5. Boutons -- */
.bouton {
  font-family: var(--ff-texte);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 13px 22px;
  border-radius: var(--rayon);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bouton--primaire {
  background: var(--c-encre);
  color: #FFFFFF;
}

.bouton--primaire:hover { background: var(--c-accent); }

.bouton--discret {
  background: transparent;
  color: var(--c-encre);
  border-color: var(--c-trait);
}

.bouton--discret:hover { border-color: var(--c-encre); }

.bouton--fantome {
  background: transparent;
  color: var(--c-encre-douce);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-left: 0;
  padding-right: 0;
}

.bouton--fantome:hover { color: var(--c-encre); }

.bouton:disabled { opacity: 0.35; cursor: not-allowed; }

.navigation {
  display: flex;
  align-items: center;
  gap: var(--esp-4);
}

.navigation--fin {
  margin-top: var(--esp-6);
  padding-top: var(--esp-5);
  border-top: 1px solid var(--c-trait);
  flex-wrap: wrap;
}

/* ---------------------------------------------------------- 6. Résultats -- */
.bilan {
  padding: var(--esp-5) 0;
  border-top: 2px solid var(--c-carbone);
}

.bilan--eau { border-top-color: var(--c-eau); }

.bilan__cle {
  margin: 0 0 var(--esp-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-encre-douce);
}

.bilan__chiffre {
  margin: 0 0 var(--esp-3);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--esp-3);
  font-family: var(--ff-data);
  font-size: 54px;
  font-weight: 700;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.bilan--eau .bilan__chiffre { color: var(--c-eau); }

.bilan__unite {
  font-family: var(--ff-texte);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--c-encre-douce);
}

.bilan__phrase {
  margin: 0 0 var(--esp-5);
  font-size: 15px;
  line-height: 1.55;
  max-width: 52ch;
}

/* --- Jauge de comparaison --- */
.jauge { margin-bottom: var(--esp-5); }

.jauge__ligne {
  display: grid;
  grid-template-columns: 100px 1fr 52px;
  align-items: center;
  gap: var(--esp-3);
  margin-bottom: var(--esp-2);
}

.jauge__label {
  font-size: 12px;
  color: var(--c-encre-douce);
}

.jauge__ligne:first-child .jauge__label {
  font-weight: 700;
  color: var(--c-encre);
}

.jauge__piste {
  height: 14px;
  background: #EAE7E1;
}

.jauge__remplissage {
  height: 100%;
  width: 0;
  background: var(--c-carbone);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.jauge__remplissage--ref    { background: #9C9890; }
.jauge__remplissage--cible  { background: #6B7F3A; }

.jauge__valeur {
  font-family: var(--ff-data);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--c-encre-douce);
}

/* --- Répartition par poste --- */
.repartition {
  list-style: none;
  margin: 0;
  padding: 0;
}

.poste { margin-bottom: var(--esp-3); }

.poste__tete {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--esp-3);
  margin-bottom: var(--esp-1);
}

.poste__nom { font-size: 13px; }

.poste__valeur {
  font-family: var(--ff-data);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--c-encre-douce);
  white-space: nowrap;
}

.poste__piste {
  height: 6px;
  background: #EAE7E1;
}

.poste__barre {
  height: 100%;
  width: 0;
  background: var(--c-poste, var(--c-encre));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Duo eau visible / eau invisible --- */
.duo {
  display: flex;
  gap: var(--esp-4);
  margin-bottom: var(--esp-5);
}

.duo__part {
  flex: 1;
  padding: var(--esp-4);
  background: var(--c-surface);
  border: 1px solid var(--c-trait);
  border-radius: var(--rayon);
}

.duo__part--forte {
  background: var(--c-eau-clair);
  border-color: transparent;
}

.duo__valeur {
  display: block;
  font-family: var(--ff-data);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--c-eau);
}

.duo__legende {
  display: block;
  margin-top: var(--esp-2);
  font-size: 12px;
  line-height: 1.4;
  color: var(--c-encre-douce);
}

/* --- Leviers --- */
.leviers {
  margin-top: var(--esp-6);
  padding-top: var(--esp-5);
  border-top: 1px solid var(--c-trait);
}

.leviers__titre {
  font-family: var(--ff-titre);
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 var(--esp-4);
}

.leviers__liste {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: levier;
}

.levier {
  counter-increment: levier;
  position: relative;
  padding-left: 34px;
  margin-bottom: var(--esp-4);
  font-size: 15px;
  line-height: 1.5;
}

.levier::before {
  content: counter(levier);
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #FFFFFF;
  font-family: var(--ff-data);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Méthodologie --- */
.methodo {
  margin-top: var(--esp-5);
  padding: var(--esp-4);
  background: var(--c-surface);
  border: 1px solid var(--c-trait);
  border-radius: var(--rayon);
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-encre-douce);
}

.methodo__intro { margin: 0 0 var(--esp-3); }

.methodo__sources {
  margin: 0;
  padding-left: 18px;
}

.methodo__sources li { margin-bottom: var(--esp-1); }

.methodo__sources a {
  color: var(--c-eau);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ------------------------------------------- 6 bis. Panel des lecteurs ---- */
.panel {
  margin-top: var(--esp-6);
  padding: var(--esp-5) var(--esp-4);
  background: var(--c-surface);
  border: 1px solid var(--c-trait);
  border-radius: var(--rayon);
}

.panel__titre {
  font-family: var(--ff-titre);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 var(--esp-1);
}

.panel__base {
  margin: 0 0 var(--esp-5);
  font-size: 13px;
  color: var(--c-encre-douce);
  font-variant-numeric: tabular-nums;
}

.panel__ligne {
  display: grid;
  grid-template-columns: 120px 1fr 46px;
  align-items: center;
  gap: var(--esp-3);
  margin-bottom: var(--esp-5);
}

.panel__label { font-size: 13px; }

.panel__piste {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #EAE7E1, var(--c-carbone));
}

.panel__piste--eau {
  background: linear-gradient(to right, var(--c-eau-clair), var(--c-eau));
}

.panel__curseur {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 22px;
  margin-left: -1px;
  background: var(--c-accent);
  transform: translateY(-50%);
  transition: left 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.panel__curseur::after {
  content: "vous";
  position: absolute;
  left: 50%;
  bottom: -16px;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.panel__rang {
  font-family: var(--ff-data);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.panel__note {
  margin: 0;
  padding-top: var(--esp-3);
  border-top: 1px solid var(--c-trait);
  font-size: 12px;
  line-height: 1.45;
  color: var(--c-encre-douce);
}

/* ----------------------------------------------------------- 7. Responsive */
@media (max-width: 520px) {
  .quiz { padding: var(--esp-4) var(--esp-4) var(--esp-5); }
  .titre { font-size: 25px; }
  .question { font-size: 21px; }
  .bilan__chiffre { font-size: 42px; }
  .reperes { flex-direction: column; gap: var(--esp-4); }
  .duo { flex-direction: column; }
  .compteurs { gap: var(--esp-4); }
  .compteur + .compteur { padding-left: var(--esp-4); }
  .compteur__valeur { font-size: 24px; }
  .marque__logo { height: 21px; }
  .jauge__ligne { grid-template-columns: 88px 1fr 46px; }
  .panel__ligne { grid-template-columns: 92px 1fr 42px; }
}

/* -------------------------------------------------- 8. Mouvement réduit --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------- 9. Polices --
   À décommenter une fois les woff2 IPM déposés dans /fonts.
   Ne jamais appeler de CDN externe.

@font-face {
  font-family: "IPM Serif";
  src: url("../fonts/ipm-serif-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IPM Sans";
  src: url("../fonts/ipm-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IPM Sans";
  src: url("../fonts/ipm-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
*/
