/* ==========================================================================
   CGT-VIVEST — 42-legal.css — pages légales (refonte-cgt, 3.0.0-beta.4)
   --------------------------------------------------------------------------
   Politique de confidentialité (RGPD) et mentions légales, en deux versions :
   - boîtes JS SM.showRGPDModal / SM.showTermsModal (.cgt-boite.sm-legal) ;
   - modales PHP #sm-rgpd-modal / #sm-terms-modal (.sm-modal.sm-legal).
   Les ≈ 1 290 !important et 470 style="" en ligne ont été remplacés par les
   classes .sm-legal-* (outil : scratchpad/refonte-cgt/outils/legal-classes.py).
   Mise en page de LECTURE : colonne de 72 caractères, titres d'article
   numérotés dans un carré d'encre, encadrés sur papier doux, couleurs des
   rubriques de cgt.fr pour les tons (jamais le vert de l'ancienne version).
   ========================================================================== */

/* ---------- Tons ---------- */
.sm-legal-ton-rouge   { --ton:var(--accent-titre); --ton-fort:var(--lien);             --ton-fond:var(--primaire-teinte); }
.sm-legal-ton-info    { --ton:var(--info-plein);   --ton-fort:var(--info-texte);       --ton-fond:var(--info-fond); }
.sm-legal-ton-succes  { --ton:var(--succes-plein); --ton-fort:var(--succes-texte);     --ton-fond:var(--succes-fond); }
.sm-legal-ton-alerte  { --ton:var(--cgt-jaune);    --ton-fort:var(--alerte-fort);      --ton-fond:var(--alerte-fond); }
.sm-legal-ton-document{ --ton:var(--t-document);   --ton-fort:var(--t-document-fort);  --ton-fond:var(--t-document-fond); }
.sm-legal-ton-petition{ --ton:var(--t-petition);   --ton-fort:var(--t-petition-fort);  --ton-fond:var(--t-petition-fond); }
.sm-legal-ton-dossier { --ton:var(--t-dossier);    --ton-fort:var(--t-dossier-fort);   --ton-fond:var(--t-dossier-fond); }

/* ---------- Conteneur ---------- */
.sm-legal{ font-family:var(--police-texte); }
.sm-legal .cgt-boite-carte{ max-width:880px; max-height:min(92vh, 100%); }
.sm-legal.sm-modal .sm-modal-container.sm-legal-conteneur{
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
  padding:0 !important;
}
@media (min-width: 1025px){
  .sm-legal.sm-modal .sm-modal-container.sm-legal-conteneur{ max-width:880px !important; }
}

/* ---------- En-tête : bandeau d'encre (pied de page cgt.fr), barre rouge ---------- */
.sm-legal .sm-legal-entete{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:20px 24px !important;
  background:var(--bande) !important;
  color:var(--bande-texte) !important;
  border-bottom:4px solid var(--cgt-rouge) !important;
  border-radius:0 !important;
}
.sm-legal .sm-legal-entete-ligne{ display:flex; align-items:center; justify-content:space-between; gap:16px; width:100%; }
.sm-legal .sm-legal-entete-titre{ display:flex; align-items:center; gap:16px; min-width:0; }
.sm-legal .sm-legal-carre{
  display:inline-flex; align-items:center; justify-content:center; flex:none;
  width:48px; height:48px;
  background:var(--ton, var(--cgt-rouge));
  color:var(--cgt-blanc);
  box-shadow:3px 3px 0 0 var(--cgt-noir);
}
.sm-legal .sm-legal-entete .sm-legal-carre{ background:var(--cgt-rouge); box-shadow:3px 3px 0 0 var(--cgt-jaune); }
/* Passe B2 (V3-09) : titre-modale de la charte, comme toutes les autres fenêtres
   (mot de passe, carte, résiliation…) : phrase en Figtree 400, UN mot en Besley
   italique (« Mentions légales », « Politique de confidentialité », casse de phrase).
   Sur la bande d'encre et sous 24 px, le mot d'accent prend --t-actualite-encre
   (#FF8787 : 6,66:1 sur #212529, 8,45:1 sur #0B0C0E) au lieu du rouge de titre. */
.sm-legal .sm-legal-titre{
  margin:0 !important;
  font-family:var(--police-texte);
  font-size:clamp(1.25rem, 1rem + 1vw, 1.625rem) !important;
  font-weight:var(--fw-400) !important;
  line-height:1.2;
  letter-spacing:var(--ls-accent);
  color:var(--bande-texte) !important;
  --accent-titre:var(--t-actualite-encre);
}
/* En bloc : dans la modale PHP, le gabarit met le h2 de l'en-tête en flex, et la
   phrase et le mot d'accent devenaient deux colonnes (« Politique / de » | « confidentialité »). */
.sm-legal .sm-legal-entete .sm-legal-titre:not(#cgt){ display:block !important; }
.sm-legal .sm-legal-titre .cgt-accent{ color:var(--accent-titre); }
.sm-legal .sm-legal-sous-titre{ margin:4px 0 0; font-size:var(--fs-13); line-height:1.4; color:var(--bande-texte-2); }
.sm-legal .sm-legal-fermer:not(#cgt){
  flex:none;
  display:inline-flex !important; align-items:center; justify-content:center;
  width:40px !important; height:40px !important; min-width:40px;
  padding:0 !important;
  font-size:22px !important; line-height:1;
  background:transparent !important;
  color:var(--bande-texte) !important;
  border:2px solid var(--bande-texte-2) !important;
  border-radius:0 !important;
  box-shadow:2px 2px 0 0 var(--cgt-rouge) !important;
  cursor:pointer;
}
.sm-legal .sm-legal-fermer:not(#cgt):hover{ background:var(--cgt-rouge) !important; border-color:var(--cgt-rouge) !important; color:var(--cgt-blanc) !important; }
.sm-legal .sm-legal-fermer:not(#cgt):active{ translate:2px 2px; box-shadow:none !important; }

/* ---------- Corps : lecture ---------- */
.sm-legal .sm-legal-corps{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  padding:28px clamp(18px, 4vw, 40px) 24px !important;
  max-height:none !important;
  background:var(--papier) !important;
  color:var(--texte-2) !important;
  font-size:var(--fs-15) !important;
  line-height:1.7 !important;
  text-align:left !important;
  hyphens:auto;
}
.sm-legal .sm-legal-corps > *{ max-width:72ch; }
.sm-legal .sm-legal-corps > :is(.sm-legal-article, .sm-legal-intro, .sm-legal-fin, .sm-legal-encadre, .sm-legal-grille){ max-width:none; }
.sm-legal .sm-legal-corps strong{ color:var(--texte); }
.sm-legal .sm-legal-corps p{ margin:0; }
.sm-legal .sm-legal-p + .sm-legal-p{ margin-top:6px; }
.sm-legal .sm-legal-bas{ margin-bottom:14px !important; }
.sm-legal .sm-legal-haut{ margin-top:10px !important; }
.sm-legal .sm-legal-fort{ font-weight:var(--fw-700); color:var(--texte); }
.sm-legal .sm-legal-discret{ color:var(--texte-3); }
.sm-legal .sm-legal-petit{ font-size:var(--fs-13); }
.sm-legal .sm-legal-moyen{ font-size:var(--fs-14); }
.sm-legal .sm-legal-grand{ font-size:var(--fs-18); }
.sm-legal .sm-legal-italique{ font-style:italic; }
.sm-legal .sm-legal-centre{ text-align:center; }
.sm-legal .sm-legal-gras{ font-weight:var(--fw-700); }
.sm-legal .sm-legal-marque{ color:var(--ton-fort, var(--lien)); font-weight:var(--fw-800); }

/* Introduction */
.sm-legal .sm-legal-intro{
  margin:0 0 28px;
  padding:18px 20px;
  background:var(--ton-fond, var(--papier-2));
  border:1px solid var(--filet);
  border-left:6px solid var(--ton, var(--cgt-rouge));
  color:var(--texte);
}

/* Articles */
.sm-legal .sm-legal-article{ margin:0 0 30px; }
.sm-legal .sm-legal-article-titre{
  display:flex;
  align-items:center;
  gap:12px;
  margin:28px 0 14px;
  padding:0 0 10px;
  border-bottom:2px solid var(--texte);
  font-family:var(--police-texte);
  font-size:var(--fs-18);
  font-weight:var(--fw-900);
  line-height:1.3;
  color:var(--texte);
}
.sm-legal .sm-legal-article > .sm-legal-article-titre:first-child,
.sm-legal .sm-legal-intro + .sm-legal-article-titre{ margin-top:0; }
.sm-legal .sm-legal-num{
  display:inline-flex; align-items:center; justify-content:center; flex:none;
  width:30px; height:30px;
  background:var(--texte);
  color:var(--papier);
  font-size:var(--fs-14);
  font-weight:var(--fw-900);
  box-shadow:3px 3px 0 0 var(--cgt-rouge);
}

/* Encadrés */
.sm-legal .sm-legal-encadre{
  margin:12px 0;
  padding:14px 16px;
  background:var(--ton-fond, var(--papier-2));
  border:1px solid var(--filet);
  color:var(--texte-2);
}
.sm-legal .sm-legal-filet{ border-left:4px solid var(--ton, var(--cgt-rouge)); }
.sm-legal .sm-legal-encadre.sm-legal-centre{ display:flex; flex-direction:column; align-items:center; gap:4px; }
.sm-legal .sm-legal-ligne{ display:flex; align-items:flex-start; gap:12px; }
.sm-legal .sm-legal-ligne-filet{ padding:10px 0; border-bottom:1px solid var(--filet); }
.sm-legal .sm-legal-ligne-titre{ display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.sm-legal .sm-legal-rangee{ display:flex; flex-wrap:wrap; gap:12px; margin-top:12px; }
.sm-legal .sm-legal-case{ padding:12px; }
.sm-legal .sm-legal-pile{ display:grid; gap:12px; }
.sm-legal .sm-legal-grille{ display:grid; gap:12px; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); }
.sm-legal .sm-legal-grille-180{ grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); }
.sm-legal .sm-legal-grille-250{ grid-template-columns:repeat(auto-fit, minmax(250px, 1fr)); }
.sm-legal .sm-legal-grille > .sm-legal-encadre{ margin:0; }
.sm-legal .sm-legal-pastille{
  display:inline-flex; align-items:center; justify-content:center;
  width:48px; height:48px; margin:0 auto 10px;
  border-radius:var(--rayon-rond);
  background:var(--ton-fond, var(--papier-3));
  color:var(--ton-fort, var(--texte));
  border:2px solid var(--ton, var(--filet-fort));
}

/* Listes */
.sm-legal .sm-legal-liste{ margin:10px 0; padding-left:22px; }
.sm-legal .sm-legal-liste li{ margin:4px 0; }
.sm-legal .sm-legal-liste li::marker{ color:var(--accent-titre); }
.sm-legal .sm-legal-liste-nue{ margin:0; padding:0; list-style:none; }
.sm-legal .sm-legal-li{ padding:4px 0; }

/* Tableau */
.sm-legal .sm-legal-tableau{ width:100%; margin-top:12px; border-collapse:collapse; font-size:var(--fs-14); }
.sm-legal .sm-legal-cellule{ padding:12px 14px; border:1px solid var(--filet-fort); vertical-align:top; }
.sm-legal .sm-legal-cellule-titre{ font-weight:var(--fw-700); color:var(--texte); background:var(--papier-2); }

/* Pictogrammes et liens */
.sm-legal .sm-legal-i{ color:var(--texte-3); }
.sm-legal .sm-legal-i-rouge{ color:var(--accent-titre); }
.sm-legal .sm-legal-i-info{ color:var(--info-texte); }
.sm-legal .sm-legal-i-succes{ color:var(--succes-texte); }
.sm-legal .sm-legal-i-alerte{ color:var(--alerte-fort); }
.sm-legal .sm-legal-i-document{ color:var(--t-document-fort); }
.sm-legal .sm-legal-i-petition{ color:var(--t-petition-fort); }
.sm-legal .sm-legal-i-dossier{ color:var(--t-dossier-fort); }
.sm-legal .sm-legal-i-blanc{ color:var(--cgt-blanc); }
.sm-legal .sm-legal-i-marge{ margin-right:8px; }
.sm-legal .sm-legal-i-haut{ margin-top:4px; }
.sm-legal .sm-legal-picto{ font-size:20px; }
.sm-legal .sm-legal-picto-grand{ font-size:22px; }
.sm-legal .sm-legal-encadre.sm-legal-centre > .sm-legal-picto-grand{ margin-bottom:6px; color:var(--ton-fort, var(--texte)); }
.sm-legal .sm-legal-lien{
  color:var(--lien);
  font-weight:var(--fw-600);
  text-decoration:underline;
  text-underline-offset:.2em;
  text-decoration-thickness:1px;
  overflow-wrap:anywhere;
}
.sm-legal .sm-legal-lien:hover{ color:var(--lien-survol); text-decoration-thickness:2px; }

/* Tuiles de contact (courriel, téléphone, formulaire) */
.sm-legal .sm-legal-tuile{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  background:var(--papier);
  color:var(--texte) !important;
  border:2px solid var(--texte);
  box-shadow:4px 4px 0 0 var(--ton, var(--cgt-rouge));
  text-decoration:none;
  cursor:pointer;
  translate:0 0;
  transition:translate var(--duree-2) var(--courbe-ressort);
}
.sm-legal .sm-legal-tuile > i{ color:var(--ton-fort, var(--accent-titre)) !important; font-size:20px; }
.sm-legal .sm-legal-tuile p{ color:var(--texte); }
.sm-legal .sm-legal-tuile .sm-legal-discret{ color:var(--texte-3); }
@media (hover: hover){
  .sm-legal .sm-legal-tuile:hover{ translate:-2px -2px; box-shadow:6px 6px 0 0 var(--ton, var(--cgt-rouge)); }
}
.sm-legal .sm-legal-tuile:active{ translate:2px 2px; box-shadow:0 0 0 0 var(--ton, var(--cgt-rouge)); transition-duration:0ms; }

/* Fin d'article (mise à jour) et pied */
.sm-legal .sm-legal-fin{
  margin-top:32px;
  padding-top:18px;
  border-top:2px solid var(--filet);
  font-size:var(--fs-13);
  color:var(--texte-3);
  text-align:center;
}
.sm-legal .sm-legal-pied{
  flex:none;
  display:flex;
  justify-content:center;
  padding:16px 24px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  background:var(--papier-2) !important;
  border-top:1px solid var(--filet) !important;
  border-radius:0 !important;
}
.sm-legal .sm-legal-pied .sm-btn{ min-width:200px; min-height:48px; }
@media (max-width: 480px){
  .sm-legal .sm-legal-pied .sm-btn{ width:100%; }
  .sm-legal .sm-legal-entete{ padding:16px !important; }
  .sm-legal .sm-legal-carre{ width:40px; height:40px; }
}
