/* ========================================
   MÉDIATION GRATUITE — Legal Pages CSS
   Shared styles for Politique de confidentialité
   & Conditions d'utilisation
   ======================================== */

/* ==========================================
   LEGAL HEADER
   ========================================== */
.legal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.legal-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.legal-logo-link img {
  height: 40px;
  width: auto;
  display: block;
}

.legal-header .btn-ghost {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.legal-header .btn-ghost:hover {
  color: var(--primary);
  background: var(--primary-light, rgba(0, 102, 204, 0.06));
}

/* ==========================================
   LEGAL MAIN LAYOUT
   ========================================== */
.legal-page {
  background: var(--bg, #fafafa);
  min-height: 100vh;
}

.legal-main {
  padding: 3rem 0 5rem;
}

.legal-main .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.legal-article {
  background: var(--surface, #ffffff);
  border-radius: 16px;
  border: 1px solid var(--border, #e5e7eb);
  padding: 3rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ==========================================
   LEGAL HERO (page title area)
   ========================================== */
.legal-hero {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.legal-hero .section-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--primary, #0066cc);
  padding: 0.35rem 1rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.legal-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--text-primary, #111827);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.legal-updated {
  font-size: 0.875rem;
  color: var(--text-tertiary, #9ca3af);
  margin: 0;
}

/* ==========================================
   TABLE OF CONTENTS
   ========================================== */
.legal-toc {
  background: var(--bg, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 3rem;
}

.legal-toc h2 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 1rem;
}

.legal-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 2rem;
}

.legal-toc li {
  break-inside: avoid;
  margin-bottom: 0.5rem;
}

.legal-toc a {
  font-size: 0.9rem;
  color: var(--primary, #0066cc);
  text-decoration: none;
  transition: color 0.2s;
  line-height: 1.5;
}

.legal-toc a:hover {
  color: var(--primary-dark, #004d99);
  text-decoration: underline;
}

/* ==========================================
   CONTENT SECTIONS
   ========================================== */
.legal-article section {
  margin-bottom: 2.5rem;
}

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

.legal-article h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary, #0066cc);
  display: inline-block;
}

.legal-article section h2 {
  display: block;
  border-bottom: 2px solid var(--primary, #0066cc);
}

.legal-article h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin: 1.5rem 0 0.75rem;
}

.legal-article p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary, #4b5563);
  margin: 0 0 1rem;
}

.legal-article ul,
.legal-article ol {
  padding-left: 1.5rem;
  margin: 0 0 1rem;
}

.legal-article li {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary, #4b5563);
  margin-bottom: 0.4rem;
}

.legal-article a {
  color: var(--primary, #0066cc);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-article a:hover {
  text-decoration: underline;
  color: var(--primary-dark, #004d99);
}

.legal-article strong {
  color: var(--text-primary, #111827);
  font-weight: 600;
}

/* ==========================================
   LEGAL CARD (highlight boxes — blue bg, white text)
   ========================================== */
.legal-card {
  background: var(--primary, #0066cc);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 1.5rem;
}

.legal-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #ffffff;
}

.legal-card strong {
  color: #ffffff;
}

.legal-card a {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
}

.legal-card a:hover {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.8);
}

/* ==========================================
   LEGAL NOTICE BOX (important notices)
   ========================================== */
.legal-notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.legal-notice p {
  color: #92400e;
  font-size: 0.9rem;
  margin: 0;
}

.legal-notice strong {
  color: #78350f;
}

/* ==========================================
   FOOTER (simplified for legal pages)
   ========================================== */
.legal-page .premium-footer {
  background: var(--text-primary, #111827);
  padding: 1.5rem 0;
}

.legal-page .footer-bottom-bar {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.legal-page .footer-bottom-bar p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  margin: 0;
}

.footer-legal-links {
  display: flex;
  gap: 1.5rem;
}

.footer-legal-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-legal-links a:hover {
  color: #ffffff;
}

.footer-legal-links a[aria-current="page"] {
  color: #ffffff;
  font-weight: 600;
}

/* ==========================================
   DARK MODE
   ========================================== */
html[data-theme="dark"] .legal-header {
  background: rgba(17, 24, 39, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .legal-page {
  background: #0f1117;
}

html[data-theme="dark"] .legal-article {
  background: #1a1d27;
  border-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .legal-hero {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .legal-hero h1,
html[data-theme="dark"] .legal-article h2,
html[data-theme="dark"] .legal-article h3,
html[data-theme="dark"] .legal-article strong {
  color: #f3f4f6;
}

html[data-theme="dark"] .legal-hero .section-eyebrow {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

html[data-theme="dark"] .legal-updated {
  color: #6b7280;
}

html[data-theme="dark"] .legal-toc {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .legal-toc h2 {
  color: #9ca3af;
}

html[data-theme="dark"] .legal-toc a {
  color: #60a5fa;
}

html[data-theme="dark"] .legal-article p,
html[data-theme="dark"] .legal-article li {
  color: #d1d5db;
}

html[data-theme="dark"] .legal-article a {
  color: #60a5fa;
}

html[data-theme="dark"] .legal-card {
  background: #2563eb;
}

html[data-theme="dark"] .legal-notice {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

html[data-theme="dark"] .legal-notice p {
  color: #fbbf24;
}

html[data-theme="dark"] .legal-notice strong {
  color: #f59e0b;
}

html[data-theme="dark"] .legal-article section h2 {
  border-bottom-color: #3b82f6;
}

html[data-theme="dark"] .legal-header .btn-ghost {
  color: #9ca3af;
}

html[data-theme="dark"] .legal-header .btn-ghost:hover {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.08);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 640px) {
  .legal-article {
    padding: 1.75rem 1.25rem;
    border-radius: 12px;
  }

  .legal-hero h1 {
    font-size: 1.5rem;
  }

  .legal-toc ol {
    columns: 1;
  }

  .legal-toc {
    padding: 1.25rem 1.25rem;
  }

  .legal-article h2 {
    font-size: 1.2rem;
  }

  .legal-main {
    padding: 2rem 0 3rem;
  }

  .legal-page .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
  }

  .footer-legal-links {
    justify-content: center;
  }
}

/* ==========================================
   PRINT
   ========================================== */
@media print {
  .legal-header,
  .premium-footer {
    display: none;
  }

  .legal-article {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  .legal-toc {
    border: 1px solid #ccc;
  }

  .legal-card {
    border-left: 3px solid #333;
    background: #f5f5f5;
  }

  .legal-article a {
    color: #000;
    text-decoration: underline;
  }

  .legal-article a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}
