/* Feuille de style unique des pages publiques (pages.py).
   Jetons de DESIGN.md « Encre et parole » : violet d'encre pour les liens et l'action, police du système, tailles 30/22/17/16/13/12,
   rythme 4/8, rayons 10/14/18. Clair et sombre automatiques (prefers-color-scheme) ; le sombre n'est pas une inversion : fond
   #0B0A10, surfaces plus claires en montant. Lisible dès 360 px ; sur grand écran, sommaire à gauche et colonne de lecture limitée.
   Aucune ressource extérieure, aucune police distante. */

:root {
  color-scheme: light dark;
  --fond: #F6F5FA;
  --surface: #FFFFFF;
  --surface-haute: #EEECF5;
  --filet: #DEDBE8;
  --filet-champ: #8F8AA0;
  --texte: #15131C;
  --texte-2: #625E72;
  --accent: #5B3DF5;
  --sur-accent: #FFFFFF;
  --accent-doux: #ECE8FF;
  --lien: #5B3DF5;
  --repere: #4A2FD6;
  --erreur: #B3261E;
  --erreur-fond: #FDECEB;
  --succes: #116932;
  --succes-fond: #E7F5EC;
  --vigilance: #8A4B00;
  --vigilance-fond: #FFF3DC;
  --ombre: 0 1px 2px rgba(21, 19, 28, .04), 0 4px 16px rgba(21, 19, 28, .06);

  --t-display: 1.875rem;   /* 30 */
  --t-titre-2: 1.375rem;   /* 22 */
  --t-titre: 1.0625rem;    /* 17 */
  --t-corps: 1rem;         /* 16 */
  --t-etiquette: .8125rem; /* 13 */
  --t-repere: .75rem;      /* 12 */

  --e-xs: 4px; --e-sm: 8px; --e-md: 12px; --e-lg: 16px; --e-xl: 24px; --e-xxl: 32px; --marge: 20px;
  --r-sm: 10px; --r-champ: 12px; --r-md: 14px; --r-lg: 18px; --r-full: 9999px;
  --lecture: 42rem;
  --large: 68rem;
  --duree: 150ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0B0A10;
    --surface: #17151F;
    --surface-haute: #24212E;
    --filet: #34303F;
    --filet-champ: #6F6A80;
    --texte: #F4F2FA;
    --texte-2: #A29DB3;
    --accent: #6D4CFF;
    --accent-doux: #272145;
    --lien: #B3A1FF;
    --repere: #B3A1FF;
    --erreur: #FF6B61;
    --erreur-fond: #2D181B;
    --succes: #4ADE80;
    --succes-fond: #13231D;
    --vigilance: #FBBF24;
    --vigilance-fond: #282012;
    --ombre: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--t-corps);
  line-height: 1.5;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; }
a { color: var(--lien); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
h1, h2, h3 { margin: 0; color: var(--texte); }
h1 { font-size: var(--t-display); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: var(--t-titre-2); font-weight: 700; line-height: 1.2; }
h3 { font-size: var(--t-titre); font-weight: 600; line-height: 1.3; }
p { margin: 0 0 var(--e-md); }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 var(--e-md); padding-left: 1.25rem; }
li { margin: 0 0 var(--e-sm); }
li:last-child { margin-bottom: 0; }
b, strong { font-weight: 600; }

.evitement {
  position: absolute; left: var(--marge); top: -100px; z-index: 10;
  background: var(--surface); color: var(--lien); padding: var(--e-md) var(--e-lg); border-radius: var(--r-sm);
}
.evitement:focus { top: var(--e-sm); }

/* ---------- en-tête et pied */
.entete {
  border-bottom: 1px solid var(--filet);
  padding-top: env(safe-area-inset-top, 0px);
}
.entete-int, .pied-int, .principal {
  max-width: var(--large); margin: 0 auto;
  padding-left: max(var(--marge), env(safe-area-inset-left, 0px));
  padding-right: max(var(--marge), env(safe-area-inset-right, 0px));
}
.entete-int { display: flex; align-items: center; justify-content: space-between; gap: var(--e-lg); min-height: 64px; }
.marque {
  display: inline-flex; align-items: center; gap: var(--e-md); min-height: 44px;
  color: var(--texte); text-decoration: none; font-size: var(--t-titre); font-weight: 700;
}
.marque img { border-radius: 8px; display: block; }
.langue {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--e-lg);
  border: 1px solid var(--filet); border-radius: var(--r-full); background: var(--surface);
  color: var(--texte); text-decoration: none; font-size: var(--t-etiquette); font-weight: 600;
}
.langue:hover { border-color: var(--filet-champ); }

.principal { padding-top: var(--e-xxl); padding-bottom: 56px; }

.pied { border-top: 1px solid var(--filet); padding-bottom: env(safe-area-inset-bottom, 0px); }
.pied-int { padding-top: var(--e-xl); padding-bottom: var(--e-xxl); color: var(--texte-2); font-size: var(--t-etiquette); }
.pied-liens { list-style: none; padding: 0; margin: 0 0 var(--e-lg); display: flex; flex-wrap: wrap; gap: 0 var(--e-xl); }
.pied-liens li { margin: 0; }
.pied-liens a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--texte-2); }
.pied-liens a[aria-current="page"] { color: var(--texte); font-weight: 600; text-decoration: none; }
.pied-editeur { line-height: 1.6; }
.pied-editeur a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- surfaces communes */
.carte {
  background: var(--surface); border: 1px solid var(--filet); border-radius: var(--r-lg);
  padding: var(--e-xl) var(--e-lg); box-shadow: var(--ombre);
}
.encadre { border-radius: var(--r-lg); padding: var(--e-lg); margin: 0 0 var(--e-xl); border: 1px solid transparent; }
.encadre-succes { background: var(--succes-fond); color: var(--texte); border-color: var(--succes); }
.encadre-succes b { color: var(--succes); }
.encadre-erreur { background: var(--erreur-fond); color: var(--erreur); border-color: var(--erreur); font-weight: 600; }
.encadre-vigilance { background: var(--vigilance-fond); border-color: transparent; }
.encadre-vigilance h2 { color: var(--vigilance); }
.encadre a { white-space: nowrap; }

/* ---------- documents (confidentialité, conditions, assistance, suppression) */
.doc-tete { max-width: var(--lecture); margin-bottom: var(--e-xxl); }
.maj { color: var(--texte-2); font-size: var(--t-etiquette); font-weight: 600; margin-bottom: var(--e-sm); font-variant-numeric: tabular-nums; }
.doc-tete h1 { margin-bottom: var(--e-lg); }
.chapeau { font-size: var(--t-titre); line-height: 1.5; }
.chapeau p, .chapeau li { color: var(--texte); }
.essentiel {
  list-style: none; padding: var(--e-lg); margin: var(--e-lg) 0 0;
  background: var(--accent-doux); border-radius: var(--r-lg); font-size: var(--t-corps);
}
.essentiel li { padding-left: 1.5rem; position: relative; }
.essentiel li::before {
  content: ""; position: absolute; left: .25rem; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--repere);
}
.moyens { padding-left: 1.5rem; }

.doc-corps { display: block; }
.sommaire { display: none; }
.doc-texte { max-width: var(--lecture); }
.section { margin: 0 0 var(--e-xxl); scroll-margin-top: var(--e-lg); }
.section h2 { margin-bottom: var(--e-md); }
.doc-texte .section h2 { font-size: var(--t-titre); font-weight: 700; padding-top: var(--e-xl); border-top: 1px solid var(--filet); }
.doc-texte .section:first-child h2 { border-top: 0; padding-top: 0; }

@media (min-width: 64rem) {
  .doc-corps { display: grid; grid-template-columns: 15rem minmax(0, var(--lecture)); gap: 56px; align-items: start; }
  .sommaire {
    display: block; position: sticky; top: var(--e-xl);
    font-size: var(--t-etiquette);
  }
  .doc:not(.doc-suppression) .doc-tete { margin-left: calc(15rem + 56px); }
  .sommaire-titre { font-weight: 600; color: var(--texte-2); margin-bottom: var(--e-sm); }
  .sommaire ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--filet); }
  .sommaire li { margin: 0; }
  .sommaire a {
    display: flex; align-items: center; min-height: 36px; padding: var(--e-xs) var(--e-md);
    color: var(--texte-2); text-decoration: none; line-height: 1.3; margin-left: -1px; border-left: 2px solid transparent;
  }
  .sommaire a:hover { color: var(--texte); border-left-color: var(--filet-champ); }
}

/* ---------- suppression du compte */
.suppression { display: grid; gap: var(--e-xl); }
.suppression-infos { max-width: var(--lecture); }
.suppression-infos .section { margin-bottom: var(--e-xl); }
.suppression-infos .section:not(.encadre) h2,
.suppression-infos .encadre h2 { font-size: var(--t-titre); margin-bottom: var(--e-sm); }
.carte-formulaire h2 { font-size: var(--t-titre-2); margin-bottom: var(--e-lg); }
@media (min-width: 64rem) {
  .suppression { grid-template-columns: minmax(0, 1fr) 26rem; gap: 56px; align-items: start; }
  .suppression-form { position: sticky; top: var(--e-xl); }
}

.champ { margin-bottom: var(--e-lg); }
.champ label { display: block; font-size: var(--t-etiquette); font-weight: 600; margin-bottom: var(--e-sm); }
.champ input {
  display: block; width: 100%; min-height: 52px; padding: 0 var(--e-lg);
  font: inherit; color: var(--texte); background: var(--surface);
  border: 1px solid var(--filet-champ); border-radius: var(--r-champ);
}
.champ input:focus { outline: none; border: 2px solid var(--accent); padding: 0 calc(var(--e-lg) - 1px); }
.case { display: flex; gap: var(--e-md); align-items: flex-start; min-height: 44px; margin: var(--e-sm) 0 var(--e-xl); cursor: pointer; }
.case input { width: 24px; height: 24px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.case span { font-size: var(--t-corps); }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--e-sm);
  min-height: 52px; padding: var(--e-md) var(--e-xl); border-radius: var(--r-md);
  font: inherit; font-size: var(--t-titre); font-weight: 600; line-height: 1.3; text-align: center; text-decoration: none;
  cursor: pointer; transition: opacity var(--duree);
}
.bouton:active { opacity: .85; }
.bouton-principal { background: var(--accent); color: var(--sur-accent); border: 0; }
.bouton-principal:hover { text-decoration: none; }
.bouton-danger { width: 100%; background: transparent; color: var(--erreur); border: 1.5px solid var(--erreur); }
.bouton-danger:hover { background: var(--erreur-fond); }
.bouton svg { flex: none; }

/* ---------- présentation */
.une { display: grid; gap: var(--e-xxl); margin-bottom: 56px; }
.une h1 { font-size: 2.25rem; margin-bottom: var(--e-lg); }
@media (max-width: 30rem) { .une h1 { font-size: var(--t-display); } }
.sous-titre { font-size: var(--t-titre); line-height: 1.5; max-width: 34rem; }
.appareils { color: var(--texte-2); font-size: var(--t-etiquette); font-weight: 600; }
.stores { display: flex; flex-wrap: wrap; gap: var(--e-md); margin-top: var(--e-xl); }

.specimen {
  margin: 0; background: var(--surface); border: 1px solid var(--filet); border-radius: var(--r-lg);
  padding: var(--e-xl) var(--e-lg) var(--e-lg); box-shadow: var(--ombre);
}
.specimen-titre { font-size: var(--t-etiquette); font-weight: 600; color: var(--texte-2); margin-bottom: var(--e-md); }
.lignes { list-style: none; padding: 0; margin: 0 0 var(--e-lg); }
.ligne {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "genre repere" "texte texte";
  gap: var(--e-xs) var(--e-md); align-items: center; padding: var(--e-md) 0; margin: 0; border-top: 1px solid var(--filet);
}
.ligne:first-child { border-top: 0; padding-top: 0; }
.ligne-genre { grid-area: genre; font-size: var(--t-repere); font-weight: 600; color: var(--texte-2); }
.ligne-texte { grid-area: texte; font-size: var(--t-corps); }
.repere {
  grid-area: repere; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: var(--r-sm);
  background: var(--accent-doux); color: var(--repere); font-size: var(--t-repere); font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.specimen-legende { font-size: var(--t-etiquette); color: var(--texte-2); }

@media (min-width: 56rem) {
  .une { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
  .une h1 { font-size: 2.75rem; }
}

.bloc { margin-bottom: 56px; }
.bloc > h2 { margin-bottom: var(--e-xl); }
.benefices { list-style: none; padding: 0; margin: 0 0 var(--e-xl); display: grid; gap: var(--e-md); }
.benefice {
  margin: 0; background: var(--surface); border: 1px solid var(--filet); border-radius: var(--r-lg); padding: var(--e-xl) var(--e-lg);
}
.benefice h3 { margin-bottom: var(--e-sm); }
.benefice p { color: var(--texte-2); }
@media (min-width: 40rem) { .benefices { grid-template-columns: 1fr 1fr; } }
.note-compte { max-width: var(--lecture); color: var(--texte); }

.carte-prix { max-width: var(--lecture); }
.prix-ligne { font-size: var(--t-titre-2); font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; margin-bottom: var(--e-sm); }
.prix-essai { font-size: var(--t-titre); font-weight: 600; color: var(--succes); }
.prix-detail { color: var(--texte-2); }

.duo { display: grid; gap: 0; }
@media (min-width: 56rem) {
  .duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 56px; align-items: start; }
  .duo .rappel { margin-bottom: 0; }
}
.rappel {
  max-width: var(--lecture); margin: 0 0 56px; padding: var(--e-lg); border-radius: var(--r-lg);
  background: var(--vigilance-fond); color: var(--texte);
}

.liens-cartes { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--e-sm); max-width: var(--lecture); }
.liens-cartes li { margin: 0; }
.lien-carte {
  display: flex; align-items: center; justify-content: space-between; gap: var(--e-md); min-height: 56px; padding: 0 var(--e-lg);
  background: var(--surface); border: 1px solid var(--filet); border-radius: var(--r-md);
  color: var(--texte); text-decoration: none; font-weight: 600;
}
.lien-carte:hover { border-color: var(--filet-champ); }
.fleche { color: var(--texte-2); font-size: 1.5rem; line-height: 1; }

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