@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --fond: #f8f8f8;
  --carte: #ffffff;
  --encre: #0b0b0b;
  --encre-douce: #555555;
  --bordure: #6b6b6b;
  --ligne: #8c8c8c;
  --ombre: 0 2px 7px rgba(0, 0, 0, 0.16);
  --vert: #0b5a14;
  --vert-fond: #b0d8a0;
  --orange: #b0662e;
  --jaune: #8a7a12;
  --rouge: #a04545;
  --rouge-fond: #c9b6b6;
  --gris-fond: #c4c4c4;
  --gris-texte: #969696;
  --gris-bord: #8a8a8a;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--fond);
  color: var(--encre);
  font-family: "Jost", "Futura", "Century Gothic", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }

.page {
  max-width: 870px;
  margin: 0 auto;
  padding: 52px 24px 80px;
}

.colonne { max-width: 560px; }

h1 {
  font-size: 46px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 10px;
  line-height: 1.05;
}

.sous-titre, .fil {
  font-size: 12px;
  margin: 0;
  color: var(--encre);
}

.fil a { color: inherit; text-decoration: none; }
.fil a:hover { text-decoration: underline; }

.cours { padding: 64px 0 66px; border-bottom: 1px solid var(--ligne); }

.cours-tete {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  max-width: 710px;
  margin-bottom: 18px;
}

.cours-tete h2 { font-size: 21px; font-weight: 600; margin: 0; }

.progression-totale { font-size: 12px; font-weight: 600; white-space: nowrap; }

.grille {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 342px));
  gap: 15px 25px;
}

.carte {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 20px;
  background: var(--carte);
  border: 0;
  border-bottom: 4px solid var(--bordure);
  box-shadow: var(--ombre);
  text-align: left;
  font-size: 19px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.carte:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
.carte:focus-visible, .bouton:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }

.carte-titre { display: block; }
.carte-theme { display: block; font-size: 13px; color: var(--encre-douce); margin-top: 2px; line-height: 1.25; }
.carte-pct { font-size: 19px; color: var(--encre-douce); font-variant-numeric: tabular-nums; }

.niv-rouge { border-bottom-color: var(--rouge); }
.niv-orange { border-bottom-color: var(--orange); }
.niv-jaune { border-bottom-color: var(--jaune); }
.niv-vert { border-bottom-color: var(--vert); }
.txt-rouge { color: var(--rouge); }
.txt-orange { color: var(--orange); }
.txt-jaune { color: var(--jaune); }
.txt-vert { color: var(--vert); }
.txt-gris { color: var(--encre-douce); }

.question-bloc { margin: 76px 0 46px; }
.question-num { font-size: 19px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; }
.question-compteur { font-size: 13px; font-weight: 500; color: var(--encre-douce); }
.question-texte { font-size: 21px; margin: 2px 0 0; }
.etiquette {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: var(--encre);
  color: #fff;
}

.reponses { display: flex; flex-direction: column; gap: 20px; }

.reponse {
  display: block;
  width: 100%;
  padding: 18px 20px 19px;
  background: var(--carte);
  border: 0;
  border-bottom: 4px solid var(--bordure);
  box-shadow: var(--ombre);
  text-align: left;
  font-size: 19px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.reponse:hover:not(:disabled) { transform: translateY(-1px); }
.reponse.choisie { background: #e9e9e9; border-bottom-color: var(--encre); box-shadow: inset 4px 0 0 var(--encre), var(--ombre); }

.reponse:disabled { cursor: default; }
.reponse.neutre { background: var(--gris-fond); color: var(--gris-texte); border-bottom-color: var(--gris-bord); }
.reponse.bonne { background: var(--vert-fond); border-bottom-color: var(--vert); }
.reponse.mauvaise { background: var(--rouge-fond); border-bottom-color: var(--rouge); }
.reponse.bonne .reponse-texte { color: var(--vert); font-weight: 600; }
.reponse.mauvaise .reponse-texte { color: var(--rouge); font-weight: 600; }

.reponse-verdict { display: block; font-size: 15px; font-weight: 600; color: var(--encre); margin-top: 20px; }
.reponse-rappel { display: block; font-size: 15px; color: #222; margin-top: 18px; line-height: 1.4; }

.actions { display: flex; justify-content: flex-end; gap: 14px; margin-top: 46px; flex-wrap: wrap; }

.bouton {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 132px;
  justify-content: center;
  padding: 8px 22px;
  background: var(--encre);
  color: #fff;
  border: 0;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.bouton:disabled { opacity: 0.3; cursor: default; }
.bouton.secondaire { background: transparent; color: var(--encre); box-shadow: inset 0 0 0 2px var(--encre); }

.resume { margin-top: 76px; }
.resume h3 { font-size: 19px; font-weight: 600; margin: 0 0 28px; }
.resume-ligne { font-size: 21px; margin: 0; }
.score { font-size: 88px; font-weight: 600; line-height: 1; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.score-detail { font-size: 14px; color: var(--encre-douce); margin: 10px 0 0; }
.pistes-titre { font-size: 21px; margin: 74px 0 12px; }
.pistes { display: flex; flex-direction: column; gap: 15px; }

.piste .carte { font-size: 19px; }
.piste-nb { font-size: 14px; color: var(--encre-douce); white-space: nowrap; }
.piste-detail { background: var(--carte); box-shadow: var(--ombre); padding: 6px 20px 14px; margin-top: -4px; }
.erreur { padding: 14px 0; border-top: 1px solid #e3e3e3; font-size: 15px; }
.erreur:first-child { border-top: 0; }
.erreur-q { font-weight: 600; margin: 0 0 6px; }
.erreur-r { margin: 0 0 6px; color: var(--vert); }
.erreur-r.faux { color: var(--rouge); }
.erreur-rappel { margin: 0; color: #333; }

.vide { font-size: 17px; color: var(--encre-douce); }

.pied { margin-top: 48px; font-size: 13px; color: var(--encre-douce); display: flex; gap: 18px; flex-wrap: wrap; }
.lien { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: inherit; font-size: inherit; }

@media (max-width: 680px) {
  .page { padding: 32px 16px 60px; }
  h1 { font-size: 36px; }
  .grille { grid-template-columns: minmax(0, 1fr); }
  .cours { padding: 44px 0 46px; }
  .cours-tete { flex-direction: column; gap: 4px; }
  .question-bloc { margin: 48px 0 32px; }
  .question-texte { font-size: 19px; }
  .reponse, .carte { font-size: 17px; }
  .score { font-size: 72px; }
}

.entete { max-width: 870px; margin: 0 auto; padding: 18px 24px 0; display: flex; justify-content: flex-end; }
.bouton-compte {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px;
  color: var(--encre); text-decoration: none; font-size: 14px; font-weight: 500;
}
.bouton-compte svg { width: 24px; height: 24px; flex: none; }
.bouton-compte:hover .bouton-compte-texte { text-decoration: underline; }
.bouton-compte:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }
.entete + .page { padding-top: 24px; }

.formulaire { max-width: 400px; margin-top: 56px; }
.formulaire h2 { font-size: 26px; font-weight: 600; margin: 0 0 8px; }
.formulaire .sous { font-size: 14px; color: var(--encre-douce); margin: 0 0 28px; }
.champ { display: block; margin-bottom: 18px; }
.champ-libelle { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.champ-ligne { display: flex; align-items: stretch; background: var(--carte); box-shadow: var(--ombre); border-bottom: 4px solid var(--bordure); }
.champ-ligne:focus-within { border-bottom-color: var(--encre); }
.champ-ligne input {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 14px 16px; font: inherit; font-size: 16px; color: var(--encre);
}
.champ-ligne input:focus { outline: none; }
.champ-ligne button { border: 0; background: transparent; padding: 0 16px; cursor: pointer; font: inherit; font-size: 14px; color: var(--encre-douce); }
.champ-ligne button.fleche { font-size: 20px; color: var(--encre); }
.champ-ligne button:focus-visible { outline: 2px solid var(--encre); outline-offset: -4px; }
.aide { font-size: 13px; color: var(--encre-douce); margin: 6px 0 0; }
.alerte { background: var(--rouge-fond); border-left: 4px solid var(--rouge); padding: 10px 14px; font-size: 14px; margin: 0 0 18px; }
.succes { background: var(--vert-fond); border-left: 4px solid var(--vert); padding: 10px 14px; font-size: 14px; margin: 0 0 18px; }
.lien-bas { font-size: 14px; color: var(--encre-douce); margin-top: 28px; text-align: center; }
.lien-bas a, .texte a { color: var(--encre); font-weight: 600; }
.case { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 20px; }
.case input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--encre); flex: none; }
.identifiant-choisi { display: flex; justify-content: space-between; align-items: center; background: var(--carte); box-shadow: var(--ombre); padding: 12px 16px; font-size: 15px; margin-bottom: 18px; }
.bouton.plein { width: 100%; padding: 12px 22px; }
.ou { display: flex; align-items: center; gap: 14px; color: var(--encre-douce); font-size: 12px; margin: 22px 0; }
.ou::before, .ou::after { content: ""; flex: 1; height: 1px; background: #dcdcdc; }

.compte-bloc { background: var(--carte); box-shadow: var(--ombre); padding: 18px 20px; margin-top: 20px; }
.compte-bloc h3 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
.compte-bloc p { margin: 0 0 12px; font-size: 15px; }
.compte-bloc .actions { margin-top: 14px; justify-content: flex-start; }
.compte-bloc.danger { border-bottom: 4px solid var(--rouge); }
.bouton.petit { min-width: 0; font-size: 15px; padding: 7px 16px; }
.bouton.rouge { background: var(--rouge); }
.texte { max-width: 640px; font-size: 16px; line-height: 1.55; margin-top: 40px; }
.texte h3 { font-size: 18px; font-weight: 600; margin: 28px 0 8px; }
.texte ul { padding-left: 20px; }
.etiquette-sync { display: inline-block; font-size: 12px; color: var(--vert); font-weight: 600; margin-left: 8px; }

/* --- Téléphones --- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, .reponse, .carte, input[type=checkbox] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.bouton-compte { min-height: 44px; min-width: 44px; justify-content: center; }
.carte:hover, .reponse:hover:not(:disabled) { transform: none; }
@media (hover: hover) {
  .carte:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
  .reponse:hover:not(:disabled) { transform: translateY(-1px); }
}
.carte:active, .reponse:active:not(:disabled) { background: #efefef; }
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

@media (max-width: 680px) {
  .entete { padding: max(10px, env(safe-area-inset-top)) 12px 0; }
  .entete + .page { padding-top: 8px; }
  .page { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  h1 { font-size: 32px; }
  .question-bloc { margin: 32px 0 24px; }
  .reponses { gap: 14px; }
  .reponse { padding: 16px 16px 17px; min-height: 56px; }
  .reponse-verdict { margin-top: 12px; }
  .reponse-rappel { margin-top: 10px; font-size: 15px; }
  .question-page .actions {
    position: sticky; bottom: 0; z-index: 5; margin: 24px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, rgba(248, 248, 248, 0), var(--fond) 30%);
  }
  .question-page .actions .bouton { flex: 1; min-height: 50px; font-size: 18px; }
  .actions .bouton { min-height: 46px; }
  .carte { min-height: 60px; padding: 12px 16px; }
  .carte-theme { font-size: 13px; }
  .cours-tete h2 { font-size: 19px; }
  .resume { margin-top: 40px; }
  .pistes-titre { margin-top: 44px; font-size: 19px; }
  .pied { flex-direction: column; gap: 12px; }
  .pied .lien { min-height: 36px; text-align: left; }
  .formulaire { margin-top: 28px; }
  .champ-ligne input { font-size: 16px; padding: 15px 14px; }
  .champ-ligne button { min-width: 48px; }
  .bouton.plein { min-height: 50px; }
  .identifiant-choisi .lien { min-height: 40px; }
  .compte-bloc { padding: 16px; }
  .compte-bloc .actions { flex-direction: column; align-items: stretch; }
  .compte-bloc .actions .bouton { width: 100%; }
  .case { font-size: 15px; }
  .case input { width: 22px; height: 22px; }
}
.case-aide { color: var(--encre-douce); font-size: 13px; }
