/* Feuille de style unique — mobile d'abord, contrastes AA, gros boutons. */
:root {
  --fond: #f6f5f1;
  --surface: #ffffff;
  --texte: #1c2329;
  --texte-doux: #4a5560;
  --primaire: #0f4c5c;
  --primaire-fonce: #0a3743;
  --sur-primaire: #ffffff;
  --doux-primaire: #e3eef0;
  --bordure: #cfd5d9;
  --succes: #1b6e3a;
  --succes-fond: #e6f4ea;
  --erreur: #a4262c;
  --erreur-fond: #fbeaea;
  --attention-texte: #5c4300;
  --attention-fond: #fff3cf;
  --focus: #c75b00;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.05);
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Polices arabes présentes sur les téléphones (Android : Noto ; iOS : Geeza Pro / SF Arabic) */
  --police-ar: "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", "SF Arabic", "Segoe UI", Tahoma, "Arial", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #12181c;
    --surface: #1b2328;
    --texte: #e8ecee;
    --texte-doux: #b4bec5;
    --primaire: #7cc8d9;
    --primaire-fonce: #a5dbe6;
    --sur-primaire: #0a1a1f;
    --doux-primaire: #1f3a41;
    --bordure: #3a4850;
    --succes: #86d9a1;
    --succes-fond: #173525;
    --erreur: #ffa3a3;
    --erreur-fond: #3d1c1f;
    --attention-texte: #ffe08a;
    --attention-fond: #3a3115;
    --focus: #ffb86b;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: 1.0625rem;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; }
a { color: var(--primaire); text-underline-offset: 2px; }
a:hover { color: var(--primaire-fonce); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 1.4em 0 0.5em; }
h1 { font-size: 1.75rem; margin-top: 0.6em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }

.lien-evitement { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.lien-evitement:focus { left: 8px; }

.conteneur { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.page-courte { padding-top: 32px; padding-bottom: 48px; }

/* En-tête */
.entete { background: var(--surface); border-bottom: 1px solid var(--bordure); }
.entete .conteneur { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.marque { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--texte); text-decoration: none; font-size: 1.05rem; }
.marque img { width: 32px; height: 32px; }
.marque-texte { font-weight: 700; color: var(--texte-doux); margin: 0; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 10px 10px; text-decoration: none; font-weight: 600; border-radius: 8px; }
.nav a[aria-current="page"] { background: var(--doux-primaire); }

main { display: block; padding-bottom: 32px; }

/* Pied de page */
.pied { border-top: 1px solid var(--bordure); background: var(--surface); padding: 24px 0 32px; font-size: 0.95rem; color: var(--texte-doux); }
.pied nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.pied a { color: var(--texte-doux); padding: 4px 0; }
.avertissement-independant { font-weight: 600; color: var(--texte); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px; border-radius: var(--rayon);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 2px solid var(--primaire); background: var(--surface); color: var(--primaire);
}
.btn:hover { color: var(--primaire-fonce); border-color: var(--primaire-fonce); }
.btn-primaire { background: var(--primaire); color: var(--sur-primaire); }
.btn-primaire:hover { background: var(--primaire-fonce); color: var(--sur-primaire); }
.btn-large { width: 100%; font-size: 1.1rem; }
.btn-lien { background: none; border: none; color: var(--primaire); text-decoration: underline; padding: 8px 0; min-height: 44px; font: inherit; cursor: pointer; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.actions { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
@media (min-width: 560px) { .actions { flex-direction: row; flex-wrap: wrap; } .actions .btn-large { width: auto; flex: 1; } }

/* Blocs */
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 20px; box-shadow: var(--ombre); margin: 16px 0; }
.carte > :first-child { margin-top: 0; }
.carte > :last-child { margin-bottom: 0; }
.grille { display: grid; gap: 12px; }
@media (min-width: 620px) { .grille-2 { grid-template-columns: 1fr 1fr; } }
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: 1.9rem; }
.hero .accroche { font-size: 1.15rem; color: var(--texte-doux); }
.liste-coches { list-style: none; padding: 0; margin: 0 0 1em; }
.liste-coches li { padding-left: 30px; position: relative; margin: 8px 0; }
.liste-coches li::before { content: "✓"; position: absolute; left: 4px; color: var(--succes); font-weight: 800; }
.prix { font-size: 2.2rem; font-weight: 800; margin: 0; }
.petit { font-size: 0.92rem; color: var(--texte-doux); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; background: var(--doux-primaire); color: var(--texte); }
.badge-attention { background: var(--attention-fond); color: var(--attention-texte); }

.alerte { border-radius: var(--rayon); padding: 14px 16px; margin: 16px 0; border: 1px solid transparent; }
.alerte-info { background: var(--doux-primaire); }
.alerte-attention { background: var(--attention-fond); color: var(--attention-texte); border-color: currentColor; }
.alerte-erreur { background: var(--erreur-fond); color: var(--erreur); border-color: currentColor; }
.alerte-succes { background: var(--succes-fond); color: var(--succes); border-color: currentColor; }
.gabarit { background: var(--attention-fond); color: var(--attention-texte); border: 2px dashed currentColor; border-radius: var(--rayon); padding: 12px 16px; font-weight: 700; }
.a-completer { background: var(--attention-fond); color: var(--attention-texte); padding: 0 4px; border-radius: 4px; font-weight: 700; }

/* FAQ */
details { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); margin: 10px 0; }
summary { cursor: pointer; padding: 14px 16px; font-weight: 700; min-height: 52px; list-style-position: inside; }
details > div { padding: 0 16px 14px; }

/* Formulaires */
label { font-weight: 600; }
input[type="email"], input[type="text"], select, textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; font: inherit; color: var(--texte);
  background: var(--surface); border: 2px solid var(--bordure); border-radius: var(--rayon);
}
textarea { min-height: 96px; }
input:focus, select:focus, textarea:focus { border-color: var(--primaire); }
.case { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0; font-weight: 400; }
.case input { width: 26px; height: 26px; flex: 0 0 26px; margin-top: 2px; accent-color: var(--primaire); }
.champ { margin: 14px 0; }
.champ label { display: block; margin-bottom: 6px; }
.message-formulaire:empty { display: none; }

/* Quiz */
.barre-quiz { position: sticky; top: 0; z-index: 5; background: var(--fond); padding: 10px 0; border-bottom: 1px solid var(--bordure); }
.barre-quiz .ligne { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; }
.chrono { font-variant-numeric: tabular-nums; font-size: 1.15rem; padding: 4px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--bordure); }
.chrono.urgent { color: var(--erreur); border-color: var(--erreur); }
.progression { height: 8px; background: var(--bordure); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progression > span { display: block; height: 100%; width: 0; background: var(--primaire); transition: width 0.2s; }
.question { font-size: 1.2rem; font-weight: 700; margin: 18px 0 14px; }
.meta-question { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.choix { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.choix button {
  width: 100%; min-height: 56px; text-align: left; padding: 12px 16px; font: inherit; font-weight: 600;
  background: var(--surface); color: var(--texte); border: 2px solid var(--bordure); border-radius: var(--rayon);
  cursor: pointer; display: flex; gap: 12px; align-items: center;
}
.choix button .lettre { flex: 0 0 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--doux-primaire); font-weight: 800; }
.choix button:hover:not([disabled]) { border-color: var(--primaire); }
.choix button[aria-pressed="true"] { border-color: var(--primaire); background: var(--doux-primaire); }
.choix button.correct { border-color: var(--succes); background: var(--succes-fond); color: var(--texte); }
.choix button.incorrect { border-color: var(--erreur); background: var(--erreur-fond); color: var(--texte); }
.choix button[disabled] { cursor: default; }
.verdict { font-weight: 800; margin: 14px 0 6px; }
.verdict.bon { color: var(--succes); }
.verdict.faux { color: var(--erreur); }

.explication { background: var(--surface); border-left: 4px solid var(--primaire); border-radius: 8px; padding: 12px 14px; margin: 10px 0; }
.explication p { margin: 0; }
.mention-ia { font-size: 0.9rem; color: var(--texte-doux); margin: 8px 0 0; }
[dir="rtl"] { text-align: right; }
:lang(ar), [lang="ar"] { font-family: var(--police-ar); font-size: 1.12em; line-height: 1.9; }
.explication[dir="rtl"] { border-left: none; border-right: 4px solid var(--primaire); }

.selecteur-langue { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.selecteur-langue .libelle { font-weight: 600; margin-right: 4px; }
.selecteur-langue button { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--bordure); background: var(--surface); color: var(--texte); font: inherit; font-weight: 700; cursor: pointer; }
.selecteur-langue button[aria-pressed="true"] { border-color: var(--primaire); background: var(--doux-primaire); }

.grille-numeros { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin: 12px 0; }
.grille-numeros button { min-height: 44px; border-radius: 8px; border: 2px solid var(--bordure); background: var(--surface); color: var(--texte); font: inherit; font-weight: 700; cursor: pointer; }
.grille-numeros button.repondue { background: var(--doux-primaire); border-color: var(--primaire); }
.grille-numeros button[aria-current="true"] { outline: 3px solid var(--focus); }

.signalement { margin-top: 10px; }
.signalement form { margin-top: 8px; }

.score { font-size: 2.6rem; font-weight: 800; margin: 0; }
table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.98rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--bordure); vertical-align: top; }
.revue-item { border-top: 1px solid var(--bordure); padding: 14px 0; }

/* Fiches */
.fiche h2 { font-size: 1.2rem; }
.fiche .note { background: var(--attention-fond); color: var(--attention-texte); padding: 10px 12px; border-radius: 8px; }

/* Pages légales */
.legal h2 { font-size: 1.2rem; }

.cache { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
