/* =============================================================================
   legal-pages.css
   Styles dédiés aux pages légales ITSOLUTIONS :
     - politique-confidentialite.html
     - conditions-utilisation.html
   N'affecte aucune autre page du site (fichier chargé uniquement par ces deux pages).
   Thèmes : clair (par défaut) / sombre, via [data-theme] sur <html>.
   ============================================================================= */

/* --- Variables : thème clair (valeurs de référence sur :root nu) --- */
:root {
  --lp-bg: #ffffff;
  --lp-bg-soft: #f8fafc;
  --lp-surface: #ffffff;
  --lp-text: #0f172a;
  --lp-muted: #5b6b82;
  --lp-border: #e2e8f0;
  --lp-blue: #2c5282;
  --lp-blue-strong: #1e3a5f;
  --lp-teal: #319795;
  --lp-focus-ring: #2c5282;
  --lp-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --lp-topbar-bg: rgba(255, 255, 255, 0.92);
  --lp-code-bg: #f1f5f9;
}

/* --- Thème sombre : suit prefers-color-scheme tant que l'utilisateur n'a pas
   explicitement choisi le mode clair (data-theme="light" prévaut toujours). --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lp-bg: #0b1220;
    --lp-bg-soft: #0f1729;
    --lp-surface: #111c2f;
    --lp-text: #e6edf7;
    --lp-muted: #93a4bd;
    --lp-border: #1f2c44;
    --lp-blue: #6fa3e0;
    --lp-blue-strong: #8fb8ea;
    --lp-teal: #4fd1c5;
    --lp-focus-ring: #6fa3e0;
    --lp-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --lp-topbar-bg: rgba(11, 18, 32, 0.92);
    --lp-code-bg: #0f1729;
  }
}

/* --- Thème sombre forcé explicitement par l'utilisateur (bascule JS) --- */
:root[data-theme="dark"] {
  --lp-bg: #0b1220;
  --lp-bg-soft: #0f1729;
  --lp-surface: #111c2f;
  --lp-text: #e6edf7;
  --lp-muted: #93a4bd;
  --lp-border: #1f2c44;
  --lp-blue: #6fa3e0;
  --lp-blue-strong: #8fb8ea;
  --lp-teal: #4fd1c5;
  --lp-focus-ring: #6fa3e0;
  --lp-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --lp-topbar-bg: rgba(11, 18, 32, 0.92);
  --lp-code-bg: #0f1729;
}

/* --- Réinitialisation minimale, pile de polices système uniquement --- */
* { box-sizing: border-box; }

html {
  color-scheme: light dark;
}

body.lp-body {
  margin: 0;
  padding: 0;
  background: var(--lp-bg);
  color: var(--lp-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color .2s ease, color .2s ease;
}

@media (prefers-reduced-motion: reduce) {
  body.lp-body,
  .lp-theme-btn,
  .lp-card,
  .lp-home-btn {
    transition: none !important;
    animation: none !important;
  }
}

/* --- Lien d'évitement (accessibilité clavier) --- */
.lp-skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--lp-blue);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
}
.lp-skip-link:focus {
  left: 0;
}

/* --- Focus clavier visible partout --- */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--lp-focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Barre supérieure sticky --- */
.lp-topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--lp-topbar-bg);
  backdrop-filter: saturate(160%) blur(6px);
  border-bottom: 1px solid var(--lp-border);
}
.lp-topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.lp-brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  color: var(--lp-blue);
  text-decoration: none;
  font-size: 1.05rem;
  white-space: nowrap;
}
.lp-brand svg { width: 22px; height: 22px; flex: none; }
.lp-page-title {
  color: var(--lp-muted);
  font-weight: 600;
  font-size: .92rem;
  padding-left: .75rem;
  border-left: 1px solid var(--lp-border);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lp-topbar-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: none;
}

.lp-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--lp-bg-soft);
  border: 1px solid var(--lp-border);
  color: var(--lp-text);
  padding: .45rem .8rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.lp-theme-btn:hover { border-color: var(--lp-blue); }
.lp-theme-btn .lp-icon-sun,
.lp-theme-btn .lp-icon-moon {
  width: 16px;
  height: 16px;
  flex: none;
}
/* L'icône affichée dépend du thème courant : masquée/affichée en CSS pur,
   aucune manipulation de classe JS nécessaire pour les icônes elles-mêmes. */
:root:not([data-theme="dark"]) .lp-theme-btn .lp-icon-moon { display: none; }
:root[data-theme="dark"] .lp-theme-btn .lp-icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .lp-theme-btn .lp-icon-sun { display: none; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .lp-theme-btn .lp-icon-moon { display: inline; }
}

.lp-home-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--lp-blue);
  color: #fff;
  text-decoration: none;
  padding: .5rem 1rem;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .15s ease;
}
.lp-home-btn:hover { background: var(--lp-blue-strong); color: #fff; }

/* --- Mise en page générale : sommaire latéral + contenu --- */
.lp-layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

/* Sommaire desktop */
.lp-toc {
  position: sticky;
  top: 84px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: 14px;
  padding: 1.1rem 1.1rem;
}
.lp-toc-title {
  margin: 0 0 .6rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--lp-muted);
}
.lp-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.lp-toc a {
  display: block;
  padding: .4rem .55rem;
  border-radius: 8px;
  color: var(--lp-text);
  text-decoration: none;
  font-size: .87rem;
}
.lp-toc a:hover { background: var(--lp-bg-soft); color: var(--lp-blue); }

/* Sommaire mobile (élément natif <details>, sans JS) */
.lp-toc-mobile { display: none; }

@media (max-width: 900px) {
  .lp-layout { grid-template-columns: minmax(0, 1fr); }
  .lp-toc { display: none; }
  .lp-toc-mobile {
    display: block;
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 12px;
    padding: .25rem .9rem;
    margin-bottom: 1.5rem;
  }
  .lp-toc-mobile summary {
    cursor: pointer;
    padding: .65rem 0;
    font-weight: 700;
    font-size: .9rem;
    color: var(--lp-text);
    list-style: none;
  }
  .lp-toc-mobile summary::-webkit-details-marker { display: none; }
  .lp-toc-mobile ol {
    list-style: none;
    margin: 0 0 .75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .3rem;
  }
  .lp-toc-mobile a {
    display: block;
    padding: .4rem .3rem;
    color: var(--lp-text);
    text-decoration: none;
    font-size: .87rem;
    border-radius: 8px;
  }
  .lp-toc-mobile a:hover { color: var(--lp-blue); background: var(--lp-bg-soft); }
}

/* --- Contenu principal --- */
.lp-content { min-width: 0; }
.lp-content h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  margin: 0 0 .4rem;
  color: var(--lp-text);
}
.lp-updated {
  color: var(--lp-muted);
  font-size: .88rem;
  margin: 0 0 2rem;
}

.lp-card {
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: 14px;
  padding: 1.6rem 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--lp-shadow);
  scroll-margin-top: 90px;
}
.lp-card h2 {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: 1.08rem;
  font-weight: 800;
  margin: 0 0 .8rem;
  color: var(--lp-text);
}
.lp-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lp-blue), var(--lp-teal));
  color: #fff;
  font-size: .85rem;
  font-weight: 800;
  flex: none;
}
.lp-card p { margin: 0 0 .85rem; color: var(--lp-text); }
.lp-card p:last-child { margin-bottom: 0; }
.lp-card ul { margin: 0 0 .85rem; padding-left: 1.3rem; color: var(--lp-text); }
.lp-card li { margin-bottom: .35rem; }
.lp-card code {
  background: var(--lp-code-bg);
  padding: .1rem .4rem;
  border-radius: 6px;
  font-size: .88em;
}

/* --- Bloc coordonnées --- */
.lp-contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 0;
}
.lp-contact-list > div {
  background: var(--lp-bg-soft);
  border: 1px solid var(--lp-border);
  border-radius: 10px;
  padding: .8rem .95rem;
}
.lp-contact-list dt {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--lp-muted);
  margin-bottom: .25rem;
}
.lp-contact-list dd {
  margin: 0;
  font-size: .92rem;
  color: var(--lp-text);
  font-weight: 600;
  word-break: break-word;
}
.lp-contact-list a { color: var(--lp-blue); text-decoration: none; }
.lp-contact-list a:hover { text-decoration: underline; }

/* --- Pied de page --- */
.lp-footer {
  border-top: 1px solid var(--lp-border);
  padding: 1.5rem 1.25rem 2.5rem;
  text-align: center;
  color: var(--lp-muted);
  font-size: .85rem;
  background: var(--lp-bg-soft);
}
.lp-footer a { color: var(--lp-blue); text-decoration: none; font-weight: 600; }
.lp-footer a:hover { text-decoration: underline; }
.lp-footer p { margin: 0 0 .4rem; }
.lp-footer p:last-child { margin-bottom: 0; }

/* --- Garantie anti-débordement horizontal ---
   Note (Correction 2) : ne pas fixer .lp-layout / .lp-topbar-inner à
   max-width:100% ici, cela écraserait le max-width:1180px déjà défini
   plus haut (même spécificité, règle plus tardive = prioritaire) et
   annulerait le conteneur centré. La largeur de ces éléments ne peut de
   toute façon pas dépasser le viewport : ce sont des éléments de type
   bloc, en display par défaut (width auto), sans marge/padding négatifs,
   et box-sizing:border-box est appliqué globalement (règle "* " en tête
   de ce fichier) — aucune règle supplémentaire n'est donc nécessaire ici
   pour eux. Seuls les médias intégrés ont besoin d'un garde-fou explicite : */
img, svg { max-width: 100%; }
