/* ============================================================
   (27/11/2026) Pages légales publiques : mentions légales, confidentialité et cookies, sous-traitants.
   S'appuie sur les variables et la police Manrope (hébergée chez Gubernix) de auth-gubernix.css.
   Charte : barre du haut en verre dépoli, bouton 40 px rayon 12 en dégradé bleu, cartes rayon 16 à ombre douce.
   Toutes les règles sont scopées sous .gbx-legal.
   ============================================================ */

/* Variables de la charte (les mêmes que .gbx-auth dans auth-gubernix.css, qui les limite aux pages de connexion) */
.gbx-legal {
  --ink: #0F0F0E;
  --ink-soft: #524F49;
  --ink-ghost: #6B6862;
  --paper: #F8F7F4;
  --accent: #1A4EBD;
  --accent-light: #EBF0FB;
  --amber-light: #FEF3E2;
  --white: #FFFFFF;
  --border: rgba(15, 15, 14, 0.09);
  --sans: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 3px rgba(15, 15, 14, 0.06), 0 2px 10px rgba(15, 15, 14, 0.04);
  color-scheme: light;
}

.gbx-legal {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.gbx-legal *, .gbx-legal *::before, .gbx-legal *::after { box-sizing: border-box; }
.gbx-legal a { color: var(--accent); text-underline-offset: 2px; }
.gbx-legal a:focus-visible { outline: 3px solid #5B8DEF; outline-offset: 2px; border-radius: 6px; }

/* Lien d'évitement (clavier, lecteurs d'écran) */
.gbx-legal .evitement { position: absolute; left: -9999px; top: 0; }
.gbx-legal .evitement:focus {
  left: 16px; top: 12px; z-index: 20;
  background: var(--white); padding: 8px 12px; border-radius: 12px; box-shadow: var(--shadow-sm);
}

/* Barre du haut en verre dépoli */
.gbx-legal .barre {
  position: sticky; top: 0; z-index: 10;
  background: rgba(248, 247, 244, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.gbx-legal .barre-int {
  max-width: 960px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 20px;
}
.gbx-legal .logo img { display: block; height: 34px; width: auto; }
.gbx-legal .barre-liens { display: flex; gap: 4px; margin-left: auto; }
.gbx-legal .barre-liens a {
  color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; font-weight: 600;
  padding: 8px 12px; border-radius: 10px;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.gbx-legal .barre-liens a:hover,
.gbx-legal .barre-liens a[aria-current="page"] { background: var(--accent-light); color: var(--accent); }

/* Bouton principal : 40 px, rayon 12, dégradé bleu */
.gbx-legal .btn-gbx {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 18px; border-radius: 12px;
  background: linear-gradient(135deg, #1A4EBD 0%, #5B8DEF 100%);
  color: #fff; font-weight: 700; font-size: 0.9rem; text-decoration: none; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(26, 78, 189, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.gbx-legal .btn-gbx:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(26, 78, 189, 0.32); }

/* Contenu */
.gbx-legal .page { max-width: 960px; margin: 0 auto; padding: 32px 16px 40px; animation: gbx-apparition 0.35s ease both; }
.gbx-legal h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
.gbx-legal .maj { color: var(--ink-ghost); font-size: 0.85rem; margin: 0 0 20px; }
.gbx-legal .bandeau-projet {
  background: var(--amber-light); color: #7A4A06; border-radius: 12px;
  padding: 10px 14px; font-size: 0.88rem; margin: 0 0 18px;
}
.gbx-legal .intro { font-size: 1.02rem; color: var(--ink-soft); max-width: 72ch; margin: 0 0 20px; }

/* Sommaire en pastilles */
.gbx-legal .sommaire { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.gbx-legal .sommaire a {
  display: inline-flex; align-items: center; min-height: 34px; padding: 4px 12px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--border); color: var(--ink-soft);
  font-size: 0.85rem; text-decoration: none; transition: border-color 0.18s ease, color 0.18s ease;
}
.gbx-legal .sommaire a:hover { border-color: var(--accent); color: var(--accent); }

/* Cartes */
.gbx-legal .carte {
  background: var(--white); border-radius: 16px; box-shadow: var(--shadow-sm);
  padding: 24px; margin: 0 0 16px; scroll-margin-top: 80px;
}
.gbx-legal .carte h2 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 10px; }
.gbx-legal .carte h3 { font-size: 1rem; margin: 18px 0 6px; }
.gbx-legal .carte p, .gbx-legal .carte li { max-width: 75ch; }
.gbx-legal .carte p:last-child, .gbx-legal .carte ul:last-child { margin-bottom: 0; }
.gbx-legal .carte ul { padding-left: 1.2rem; }

/* Identité (mentions légales) */
.gbx-legal .identite { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.gbx-legal .identite dt { color: var(--ink-ghost); font-size: 0.88rem; }
.gbx-legal .identite dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* Tableaux : défilement dans la carte sur ordinateur, lignes empilées sur mobile */
.gbx-legal .tableau { overflow-x: auto; margin: 8px 0 12px; border: 1px solid var(--border); border-radius: 12px; }
.gbx-legal table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.gbx-legal th, .gbx-legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.gbx-legal thead th { background: var(--paper); font-size: 0.8rem; color: var(--ink-soft); font-weight: 700; }
.gbx-legal tbody tr:last-child td { border-bottom: 0; }

/* Information restant à compléter (visible tant que le réglage est vide) */
.gbx-legal .a-completer { background: var(--amber-light); color: #7A4A06; border-radius: 6px; padding: 0 6px; font-weight: 600; }

/* Pied de page */
.gbx-legal .pied-legal { text-align: center; font-size: 0.8rem; color: var(--ink-ghost); padding: 8px 16px 32px; margin: 0; }
.gbx-legal .pied-legal a { color: inherit; }
.gbx-legal .pied-legal a:hover { color: var(--accent); }

/* Micro-animation d'apparition */
@keyframes gbx-apparition { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .gbx-legal .page { animation: none; }
  .gbx-legal *, .gbx-legal *::before, .gbx-legal *::after { transition: none !important; }
}

@media (max-width: 720px) {
  .gbx-legal .barre-liens { display: none; }
  .gbx-legal .barre-int { justify-content: space-between; }
  .gbx-legal .page { padding-top: 24px; }
  .gbx-legal .carte { padding: 18px 16px; }
  .gbx-legal .identite { grid-template-columns: 1fr; gap: 0; }
  .gbx-legal .identite dd { margin-bottom: 10px; }
  .gbx-legal .tableau { border: 0; overflow: visible; }
  .gbx-legal table, .gbx-legal tbody, .gbx-legal tr, .gbx-legal td { display: block; width: 100%; }
  .gbx-legal thead { display: none; }
  .gbx-legal tbody tr { border: 1px solid var(--border); border-radius: 12px; padding: 6px 0; margin-bottom: 10px; }
  .gbx-legal td { border-bottom: 0; padding: 6px 12px; }
  .gbx-legal td::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 700; color: var(--ink-ghost); }
}

@media print {
  .gbx-legal .barre, .gbx-legal .sommaire, .gbx-legal .evitement { display: none; }
  .gbx-legal .carte { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
