/* ==========================================================================
   PAGES LÉGALES — Mentions Légales & Politique de Confidentialité
   Univers Graphique : Dark Mica, Système 2^n & Verre Dépoli
   ========================================================================== */

:root {
  /* Palette Dark Mica */
  --bg-deep: #080C14;
  --bg-surface: #0E1420;
  --bg-card: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-hover: rgba(29, 121, 216, 0.4);
  
  --color-primary: #1D79D8;
  --color-primary-light: #4FA8F5;
  --color-accent: #6266E8;
  --color-emerald: #10B981;
  
  --text-primary: #F5F7FA;
  --text-secondary: rgba(245, 247, 250, 0.82);
  --text-muted: rgba(245, 247, 250, 0.60);
  
  /* Grille 2^n */
  --space-2: 4px;
  --space-3: 8px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 16px 36px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.legal-page {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-secondary);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Grille interactive dynamique & Fond Cinématique */
.ambient-background {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  contain: strict;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle at 18% 14%, rgba(29, 121, 216, 0.18) 0%, transparent 52%),
    radial-gradient(circle at 82% 32%, rgba(98, 102, 232, 0.16) 0%, transparent 48%),
    radial-gradient(circle at 50% 86%, rgba(19, 188, 131, 0.08) 0%, transparent 54%);
}

/* Voile de grain satiné tactile */
.ambient-noise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.035;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.interactive-grid-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  transform: translateZ(0);
}

/* Conteneur principal */
.legal-container {
  display: grid;
  grid-template-areas: "stack";
  max-width: 960px;
  margin: 0 auto;
  padding: 104px var(--space-5) var(--space-8);
  position: relative;
  width: 100%;
  z-index: 1;
}

.legal-back,
.legal-section {
  grid-area: stack;
}

/* ===== Bouton Retour « Portfolio » en Verre Flottant Harmonisé ===== */
.legal-back {
  align-items: center;
  align-self: start;
  backdrop-filter: blur(24px) saturate(135%);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  background: rgba(14, 20, 32, 0.65);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
  display: inline-flex;
  gap: 10px;
  height: 48px;
  justify-content: center;
  justify-self: start;
  margin-top: -72px;
  padding: 0 20px;
  position: sticky;
  top: 24px;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.legal-back::before {
  content: '';
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  pointer-events: none;
  border-radius: 9999px;
}

.legal-back:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-light);
  transform: translateX(-4px);
  box-shadow: 0 12px 32px rgba(29, 121, 216, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.legal-back svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: transform 0.25s ease;
}

.legal-back:hover svg {
  transform: translateX(-3px);
}

.legal-back span,
.legal-back__text {
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Header */
.legal-header {
  margin-bottom: var(--space-7);
}

.legal-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  background: rgba(29, 121, 216, 0.12);
  border: 1px solid rgba(29, 121, 216, 0.3);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.legal-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--space-3);
}

.legal-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 680px;
}

/* Sections & Cartes en verre dépoli Mica */
.legal-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.legal-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(28px) saturate(135%);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.65), inset 0 1px 1px 0 rgba(255, 255, 255, 0.22);
  overflow: hidden;
  transition: border-color 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, background 0.35s ease;
}

.legal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.35) 30%, rgba(255, 255, 255, 0.1) 70%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}

.legal-card:hover {
  border-color: rgba(29, 121, 216, 0.45);
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 48px -8px rgba(0, 0, 0, 0.75), inset 0 1px 2px 0 rgba(255, 255, 255, 0.35);
}

.legal-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-card__number {
  font-family: 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary-light);
}

.legal-card__title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.legal-card__body {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.legal-card__body p {
  margin-bottom: var(--space-3);
}

.legal-card__body p:last-child {
  margin-bottom: 0;
}

.legal-card__body ul {
  list-style: none;
  padding-left: 0;
  margin: var(--space-3) 0;
}

.legal-card__body li {
  position: relative;
  padding-left: var(--space-5);
  margin-bottom: var(--space-2);
}

.legal-card__body li::before {
  content: '•';
  position: absolute;
  left: var(--space-3);
  color: var(--color-primary-light);
  font-weight: bold;
}

.legal-card__body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.legal-card__body a {
  color: var(--color-primary-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.legal-card__body a:hover {
  color: #FFFFFF;
}

/* Callout RGPD / Note importante */
.legal-callout {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-top: var(--space-4);
}

.legal-callout svg {
  flex-shrink: 0;
  stroke: var(--color-emerald);
  margin-top: 2px;
}

.legal-callout__text {
  font-size: 0.875rem;
  color: rgba(245, 247, 250, 0.9);
  line-height: 1.55;
}

.legal-callout__text strong {
  color: var(--color-emerald);
}

/* Footer légal */
.legal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.legal-footer__links {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.legal-footer__links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-footer__links a:hover {
  color: var(--color-primary-light);
}

@media (max-width: 768px) {
  .legal-container {
    padding: calc(72px + env(safe-area-inset-top, 0px)) var(--space-4) var(--space-7);
  }
  .legal-back {
    height: 42px;
    margin-top: -56px;
    padding: 0 16px;
    top: calc(12px + env(safe-area-inset-top, 0px));
  }
  .legal-back span,
  .legal-back__text {
    font-size: 13px;
  }
  .legal-card {
    padding: var(--space-5);
  }
  .legal-footer {
    flex-direction: column;
    text-align: center;
  }
}
