/* ============================================================================
   LEGAL PAGES — Mentions légales, CGV, CGU, Politique de confidentialité
   Gabarit sobre et lisible, cohérent avec le design system (.sec-*) et les
   tokens de marque (--ink, --body, --line, --brand). Une colonne de contenu
   lisible (~820px), bonne typographie. L'enveloppe (héro + section) est fournie
   par les classes globales .sec-hero / .sec-section ; ce fichier ne style que
   le bloc de contenu juridique .legal-content et ses éléments.
   ========================================================================= */

html {
  scroll-behavior: smooth;
}

/* ---------- HÉRO COMPACT (pages légales, sans image de fond) ----------
   Réutilise .sec-hero / .sec-hero-inner / .sec-breadcrumb du design system.
   On réduit la hauteur et on fournit un fond dégradé sombre (l'overlay du
   design system suppose une image ; ici on peint directement le fond). */
.sec-hero--compact {
  min-height: 0;
  align-items: flex-start;
  padding: calc(var(--header-height, 90px) + 44px) 0 44px;
  background:
    radial-gradient(1100px 460px at 78% -12%, color-mix(in srgb, var(--sec-accent, #2563EB) 42%, transparent) 0%, transparent 60%),
    radial-gradient(820px 520px at -5% 120%, rgba(16, 185, 129, .20) 0%, transparent 55%),
    linear-gradient(155deg, #0b1424 0%, #0f1e3a 52%, #14315c 100%);
}
.sec-hero--compact .sec-hero-overlay {
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .6), transparent 72%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .6), transparent 72%);
}
.sec-hero--compact h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  max-width: 24ch;
}
.sec-hero--compact .sec-hero-sub {
  max-width: 70ch;
}

@media (max-width: 640px) {
  .sec-hero--compact {
    padding: calc(var(--header-height, 90px) + 24px) 0 28px;
  }
}

/* ---------- COLONNE DE CONTENU LISIBLE ---------- */
.legal-content {
  max-width: 820px;
  margin: 0 auto;
  color: var(--body, #475569);
  font-family: var(--font-family, 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif);
}

/* Préambule / chapô éventuel sous le titre de section */
.legal-lead {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--body, #475569);
  margin: 0 0 8px;
}

/* ---------- SECTIONS INTERNES ---------- */
.legal-section {
  scroll-margin-top: calc(var(--header-height, 90px) + 24px);
}

.legal-section + .legal-section {
  margin-top: 2.4rem;
  padding-top: 2.4rem;
  border-top: 1px solid var(--line, #E2E8F0);
}

.legal-section h2 {
  margin: 0 0 0.9rem;
  color: var(--ink, #0F172A);
  font-weight: 800;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.legal-section h3 {
  margin: 0 0 0.65rem;
  color: var(--ink, #0F172A);
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.3;
}

.legal-section p {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.78;
  color: var(--body, #475569);
}

.legal-section p:last-child {
  margin-bottom: 0;
}

/* ---------- LIENS ---------- */
.legal-content a:not(.sec-btn):not(.legal-link-button) {
  color: var(--brand, #2563EB);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  font-weight: 600;
  transition: color 0.15s ease;
}
.legal-content a:not(.sec-btn):not(.legal-link-button):hover {
  color: var(--brand-dark, #1E40AF);
}

.legal-content strong {
  color: var(--ink, #0F172A);
  font-weight: 700;
}

/* ---------- LISTES ---------- */
.legal-list {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}
.legal-list li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--body, #475569);
}
.legal-list li::marker {
  color: var(--brand, #2563EB);
}
.legal-list li + li {
  margin-top: 0.45rem;
}

/* ---------- CARTES / TABLEAU D'INFORMATIONS ---------- */
.legal-card {
  margin: 0 0 1rem;
  padding: 1.25rem 1.4rem;
  border-radius: 16px;
  background: var(--bg-alt, #F8FAFC);
  border: 1px solid var(--line, #E2E8F0);
}
.legal-card:last-child {
  margin-bottom: 0;
}
.legal-card h3 {
  margin-top: 0;
}
.legal-card p {
  margin: 0;
}
.legal-card p + p {
  margin-top: 0.85rem;
}

/* Deux cartes côte à côte (CGU / Confidentialité) */
.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}
.legal-grid .legal-card {
  margin-bottom: 0;
  height: 100%;
}
.legal-grid .legal-list:last-child {
  margin-bottom: 0;
}

/* Tableau éditeur / hébergement */
.legal-table {
  width: 100%;
  border-collapse: collapse;
}
.legal-table th,
.legal-table td {
  padding: 0.85rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line, #E2E8F0);
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--body, #475569);
}
.legal-table tr:last-child th,
.legal-table tr:last-child td {
  border-bottom: none;
}
.legal-table th {
  width: 32%;
  padding-right: 1.2rem;
  color: var(--ink, #0F172A);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legal-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

/* ---------- ENCART D'AVERTISSEMENT ---------- */
.legal-note {
  margin: 0 0 1.6rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid #FCD34D;
  background: #FFFBEB;
  color: #92400E;
  font-size: 0.96rem;
  line-height: 1.6;
  font-weight: 600;
}

/* ---------- BOUTON LIEN (cookies) ---------- */
.legal-link-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--brand, #2563EB);
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}
.legal-link-button:hover {
  color: var(--brand-dark, #1E40AF);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 720px) {
  .legal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .legal-table th,
  .legal-table td {
    display: block;
    width: 100%;
    padding: 0.2rem 0;
    border-bottom: none;
  }
  .legal-table th {
    padding-top: 0.85rem;
  }
  .legal-table td {
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line, #E2E8F0);
  }
  .legal-table tr:last-child td {
    border-bottom: none;
  }
}

/* ============================================================================
   ERROR / EMPTY STATE — utilisé par les pages d'erreur (404/500). Conservé.
   ========================================================================= */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--aur-base, #fff);
  position: relative;
}

.error-card {
  position: relative;
  z-index: 2;
  max-width: 480px;
  width: 100%;
  padding: 3rem 2.5rem;
  text-align: center;
  background: var(--aur-glass-2, #fff);
  border: 1px solid var(--aur-edge-str, #E2E8F0);
  border-radius: var(--aur-r-xl, 20px);
  backdrop-filter: blur(var(--aur-blur, 12px)) saturate(var(--aur-sat, 1.2));
  -webkit-backdrop-filter: blur(var(--aur-blur, 12px)) saturate(var(--aur-sat, 1.2));
  box-shadow: var(--aur-shadow-lg, 0 20px 50px -12px rgba(15, 23, 42, 0.25)), var(--aur-shadow-inset, inset 0 1px 0 rgba(255, 255, 255, 0.4));
}

.error-card__icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 1.5rem;
  border-radius: var(--aur-r-xl, 20px);
  background: linear-gradient(135deg, var(--aur-accent, #2563EB), var(--aur-accent-2, #10B981));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 48px;
  box-shadow:
    0 16px 40px -10px var(--aur-accent-glow, rgba(37, 99, 235, 0.4)),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.error-card__icon .material-symbols-rounded { font-size: 48px; }

.error-card h1 {
  font-size: var(--aur-fs-3xl, 2rem);
  font-weight: 800;
  color: var(--aur-ink, #0F172A);
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
}

.error-card p {
  font-size: var(--aur-fs-md, 1rem);
  color: var(--aur-ink-mute, #475569);
  margin: 0 0 1.75rem;
  line-height: 1.55;
}

.error-card .error-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .error-card { padding: 2rem 1.5rem; }
  .error-card__icon { width: 80px; height: 80px; }
}

/* ── Light theme overrides (pages d'erreur) ── */
[data-theme="light"] .error-card,
[data-aur-theme="light"] .error-card {
  background: var(--surface-1, #fff);
  border-color: var(--aur-edge-str, #E2E8F0);
}
