/* Shared styles for Vigilance legal pages (mentions légales, confidentialité).
   Mirrors the landing-page atmospheric treatment: godray + grain + contour map,
   with a compact editorial type system inspired by vibeisland.app/privacy. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy-deep: #050d1a;
  --navy: #0a1628;
  --electric: #1a8cff;
  --electric-light: #4db8ff;
  --electric-soft: rgba(77,184,255,0.12);
  --text: #ffffff;
  --text-light: rgba(255,255,255,0.5);
  --text-muted: rgba(255,255,255,0.32);
  --border: rgba(255,255,255,0.08);
  --font: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html { background: var(--navy); scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: transparent;
  color: var(--text-light);
  font-weight: 500;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Atmospheric layers (shared with landing) ── */
.page-grain {
  position: fixed; inset: 0;
  pointer-events: none; z-index: -1;
  opacity: 0.15;
}
@media (prefers-reduced-motion: reduce) { .page-grain { display: none; } }

.legal-wrapper {
  position: relative; overflow: hidden;
  min-height: 100vh;
  background: var(--navy);
}

.hero-godray {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1; display: block;
}
@media (prefers-reduced-motion: reduce) { .hero-godray { display: none; } }
@media (max-width: 640px) { .hero-godray { display: none; } }

.hero-noise {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  opacity: 0.15;
}

.contour-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: url('reunion-contours.svg') right 42% / 50% auto no-repeat;
  opacity: 0.22;
  mask-image: linear-gradient(to left, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 30%, transparent 55%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 30%, transparent 55%);
}

.contour-bg-glow {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: url('reunion-contours.svg') right 42% / 50% auto no-repeat;
  opacity: 0.75;
  mask-image:
    radial-gradient(180px circle at var(--mx, -300px) var(--my, -300px), black 0%, transparent 70%),
    linear-gradient(to left, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 30%, transparent 55%);
  mask-composite: intersect;
  -webkit-mask-image:
    radial-gradient(180px circle at var(--mx, -300px) var(--my, -300px), black 0%, transparent 70%),
    linear-gradient(to left, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 30%, transparent 55%);
  -webkit-mask-composite: source-in;
  transition: opacity .25s ease;
}
@media (prefers-reduced-motion: reduce) { .contour-bg-glow { display: none; } }

/* ── Main content ── */
.legal-page {
  position: relative; z-index: 3;
  max-width: 680px; margin: 0 auto;
  padding: 80px 24px 120px;
}

.legal-page .back {
  position: fixed; top: 0; z-index: 100;
  left: max(20px, calc(50% - 316px));
  display: inline-flex; align-items: center; gap: 6px;
  padding: 14px 0;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: none;
  letter-spacing: 1.5px; text-transform: uppercase;
  isolation: isolate;
  transition: color 0.2s, text-shadow 0.25s var(--ease);
}
.legal-page .back::before,
.legal-page .back::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: -1;
  pointer-events: none;
}
/* Layer 1 — light blur, extends furthest down */
.legal-page .back::before {
  height: 96px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 100%);
}
/* Layer 2 — heavy blur, concentrated near top; stacks on top of Layer 1
   so their filters compound, producing a perceived gradient blur */
.legal-page .back::after {
  height: 56px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}
.legal-page .back:hover {
  color: var(--electric-light);
  border-bottom: none;
  text-shadow: 0 0 10px rgba(77,184,255,0.6), 0 0 18px rgba(77,184,255,0.3);
}

.legal-page h1 {
  font-size: 48px; font-weight: 700; color: var(--text);
  letter-spacing: -1.5px; line-height: 1.05;
  margin-bottom: 10px;
}

.legal-page .meta {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 12px; font-weight: 500;
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.legal-page section { margin-bottom: 40px; }

/* H2 — tiny uppercase accent label (vibeisland pattern, our electric blue) */
.legal-page h2 {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  color: var(--electric-light);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.legal-page h3 {
  font-size: 15px; font-weight: 700;
  color: var(--text);
  margin: 22px 0 8px;
}

.legal-page p,
.legal-page li {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  line-height: 1.65;
}

.legal-page p { margin-bottom: 10px; }
.legal-page ul { padding-left: 20px; margin: 6px 0 12px; }
.legal-page li { margin-bottom: 2px; }
.legal-page li > ul { margin: 2px 0 4px; }

.legal-page strong {
  color: var(--text);
  font-weight: 700;
}

.legal-page a {
  color: var(--electric-light);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(77,184,255,0.3);
  transition: border-color 0.2s, color 0.2s;
}
.legal-page a:hover {
  color: #fff;
  border-color: var(--electric-light);
}

.legal-page code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--electric-light);
  background: var(--electric-soft);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(77,184,255,0.15);
}

/* Brief — plain-language summary at top of each legal page */
.legal-brief {
  background: var(--electric-soft);
  border: 1px solid rgba(77, 184, 255, 0.22);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 48px;
}

.legal-brief-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--electric-light);
  margin-bottom: 14px;
}

.legal-brief p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.65;
  margin-bottom: 10px;
}

.legal-brief p:last-of-type {
  margin-bottom: 0;
}

.legal-brief strong {
  color: var(--text);
  font-weight: 700;
}

.legal-brief .reassure {
  color: #5cc87a;
  font-weight: 600;
}

.legal-brief-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Card — used for identity blocks (éditeur, hébergeur, sous-traitants) */
.legal-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 14px 0 18px;
}
.legal-card p { margin-bottom: 4px; font-size: 14px; }
.legal-card p:last-child { margin-bottom: 0; }
.legal-card p.name { color: var(--text); font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.legal-card p.small { color: var(--text-light); font-size: 13px; font-weight: 500; }

/* Key-value facts inside sections */
.legal-page .fact {
  font-size: 14px; color: var(--text-light); margin-bottom: 8px;
}
.legal-page .fact strong { margin-right: 8px; }

/* Compact data table — used for third-party services, retention, cookies */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 18px;
  font-size: 13px;
}
.legal-table th,
.legal-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.55;
}
.legal-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom-color: rgba(255,255,255,0.14);
}
.legal-table td {
  color: var(--text-light);
  font-weight: 500;
}
.legal-table td strong { color: var(--text); }
.legal-table tr:last-child td { border-bottom: none; }
.legal-table code { font-size: 12px; padding: 1px 6px; }

@media (max-width: 640px) {
  .legal-table { font-size: 12px; }
  .legal-table th,
  .legal-table td { padding: 8px 8px; }
}

/* ── Footer ── mirrors landing page .footer (two-col, single line) */
.legal-footer {
  position: relative; z-index: 3;
  max-width: 1200px; margin: 0 auto;
  padding: 14px 32px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px 24px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}
.legal-footer-col { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.legal-footer .sep { color: rgba(255,255,255,0.12); }
.legal-footer a {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color 0.2s;
}
.legal-footer a:hover { color: var(--electric-light); }
.legal-footer a[aria-current="page"] {
  color: var(--electric-light);
}
.legal-footer-socials { display: inline-flex; align-items: center; gap: 10px; margin-left: 6px; }
.legal-footer-socials a { display: inline-flex; color: rgba(255,255,255,0.4); transition: color 0.2s, transform 0.15s var(--ease); }
.legal-footer-socials a:hover { color: var(--electric-light); transform: translateY(-1px); }
.legal-footer-socials svg { width: 16px; height: 16px; display: block; image-rendering: pixelated; }
.legal-footer-socials .footer-brand-icon svg { image-rendering: auto; }

/* Responsive */
@media (max-width: 640px) {
  .legal-page { padding: 60px 20px 80px; }
  .legal-page h1 { font-size: 36px; letter-spacing: -1px; }
  .legal-page .meta { margin-bottom: 32px; padding-bottom: 24px; }
  .legal-page h3 { font-size: 15px; }
  .legal-page p, .legal-page li { font-size: 14px; }
  .legal-brief { padding: 18px 20px; }
  .legal-card { padding: 16px 18px; }
  .legal-footer {
    gap: 10px 16px; padding: 16px 20px; font-size: 11px;
    justify-content: center;
  }
  .legal-footer-col { gap: 6px 10px; justify-content: center; }
}
