/* ============================================================
   Pages légales (CGU / Confidentialité) — refonte 2026-07
   En-tête à onglets, sommaire sticky avec scrollspy, sections
   en cartes numérotées avec icônes et apparition au scroll.
   ============================================================ */

html { scroll-behavior: smooth; }

.lg-wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(32px, 6vh, 64px) 16px 48px;
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- En-tête ---------- */
.lg-head {
  text-align: center;
  margin-bottom: clamp(28px, 5vh, 48px);
  position: relative;
}
.lg-head::before {
  content: "";
  position: absolute;
  top: -40%; left: 50%; transform: translateX(-50%);
  width: min(720px, 100vw); height: 320px;
  background: radial-gradient(ellipse 60% 55% at 50% 40%, rgba(88,101,242,0.13), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.lg-title {
  font-size: clamp(30px, 4.6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin: 14px 0 10px;
}
.lg-updated {
  color: #949aa4;
  font-size: 0.9rem;
  margin: 0 0 22px;
}
.lg-updated i { font-size: 0.78rem; color: #949cf7; }

.lg-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
}
.lg-tab {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 20px;
  border-radius: 9px;
  color: #949aa4;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}
.lg-tab i { font-size: 0.8rem; }
.lg-tab:hover { color: #dbdee1; background: rgba(255,255,255,0.05); }
.lg-tab.active {
  background: linear-gradient(135deg, #5865f2, #4654c0);
  color: #ffffff;
  box-shadow: 0 4px 14px -4px rgba(88,101,242,0.6);
}

/* ---------- Corps : sommaire + sections ---------- */
.lg-body {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 32px;
  align-items: start;
}

.lg-toc {
  position: sticky;
  top: 24px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.028);
  border: 1px solid rgba(255,255,255,0.08);
}
.lg-toc ol {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.lg-toc a {
  display: flex; align-items: baseline; gap: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #949aa4;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
  transition: background 0.12s ease, color 0.12s ease;
}
.lg-toc a:hover { color: #dbdee1; background: rgba(255,255,255,0.05); }
.lg-toc a.active {
  color: #ffffff;
  background: rgba(88,101,242,0.14);
}
.lg-toc a.active .lg-toc-num { color: #949cf7; }
.lg-toc-num {
  flex: none;
  font-size: 0.7rem;
  font-weight: 800;
  color: #6d7178;
  width: 16px;
}

.lg-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* ---------- Cartes de section ---------- */
.lg-card {
  position: relative;
  padding: 22px 26px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.09);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
  scroll-margin-top: 24px;
}
.lg-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #5865f2, rgba(88,101,242,0));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lg-card:hover { border-color: rgba(148,156,247,0.35); }
.lg-card:hover::before { opacity: 1; }

.lg-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.lg-ic {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  color: #949cf7;
  background: rgba(88,101,242,0.10);
  border: 1px solid rgba(148,156,247,0.25);
}
.lg-card-head h2 {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #f2f3f5;
  margin: 0;
}
.lg-num {
  font-size: 0.72rem;
  font-weight: 800;
  color: #5865f2;
  letter-spacing: 0.06em;
}

.lg-card-body { color: #b5bac1; font-size: 0.95rem; line-height: 1.65; }
.lg-card-body p { margin: 0 0 10px; }
.lg-card-body p:last-child { margin-bottom: 0; }
.lg-card-body ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.lg-card-body li::marker { color: #5865f2; }
.lg-card-body strong { color: #f2f3f5; }
.lg-card-body a { color: #949cf7; text-decoration: none; border-bottom: 1px solid rgba(148,156,247,0.35); }
.lg-card-body a:hover { color: #ffffff; border-bottom-color: #ffffff; }
.lg-card-body code {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.85em;
}

.lg-back { margin: 18px 0 0; }
.lg-back a {
  display: inline-flex; align-items: center; gap: 9px;
  color: #949aa4;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s ease;
}
.lg-back a:hover { color: #ffffff; }
.lg-back i { font-size: 0.75rem; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .lg-body { grid-template-columns: 1fr; }
  .lg-toc { display: none; }
}
@media (max-width: 560px) {
  .lg-tabs { width: 100%; }
  .lg-tab { flex: 1; justify-content: center; padding: 9px 8px; font-size: 0.8rem; }
  .lg-card { padding: 18px; }
}

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .lg-card, .lg-card::before { transition: none; }
}
