/* ═══════════════════════════════════════════════════════════════
   DigitPilote — Feuille de style partagée · Pages légales
   Branding : --bg:#F6FAF7 · --green-d:#2F4F3E · --gold:#C8A96B
   Police : Libre Baskerville (titres) + Inter (corps)
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg:       #F6FAF7;
  --bg2:      #EEF5F0;
  --green-d:  #2F4F3E;
  --green-m:  #3D6B55;
  --green-l:  #7FA88B;
  --gold:     #C8A96B;
  --gold-d:   #A07840;
  --white:    #FFFFFF;
  --text1:    #1A2E24;
  --text2:    #3D5248;
  --text3:    #6B8070;
  --border:   rgba(47,79,62,0.12);
  --shadow:   0 2px 16px rgba(47,79,62,0.08);
  --radius:   12px;
  --transition: all 0.2s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text1);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar / Navbar ── */
.legal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--green-d);
  border-bottom: 1px solid rgba(200,169,107,0.2);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.legal-nav-logo img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 7px;
}

.legal-nav-logo span {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.legal-nav-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  transition: var(--transition);
}

.legal-nav-back:hover {
  color: var(--gold);
  border-color: rgba(200,169,107,0.4);
}

/* ── Hero de page légale ── */
.legal-hero {
  background: var(--green-d);
  padding: 52px 32px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.legal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(200,169,107,0.08) 0%, transparent 65%),
    radial-gradient(ellipse 50% 70% at 20% 50%, rgba(127,168,139,0.10) 0%, transparent 60%);
  pointer-events: none;
}

.legal-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(200,169,107,0.12);
  border: 1px solid rgba(200,169,107,0.25);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.legal-hero h1 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 14px;
  position: relative;
}

.legal-hero-meta {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  position: relative;
}

.legal-hero-meta strong {
  color: rgba(255,255,255,0.75);
}

/* ── Contenu principal ── */
.legal-main {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

/* ── Sidebar nav interne ── */
.legal-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 72px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 80px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.legal-toc h3 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  margin-bottom: 14px;
}

.legal-toc ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-toc ul li a {
  display: block;
  font-size: 0.8rem;
  color: var(--text2);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: var(--transition);
  line-height: 1.4;
}

.legal-toc ul li a:hover,
.legal-toc ul li a.active {
  background: rgba(47,79,62,0.07);
  color: var(--green-d);
  font-weight: 600;
}

/* ── Article légal ── */
.legal-article {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 44px;
  box-shadow: var(--shadow);
}

/* Articles / sections */
.legal-article section {
  margin-bottom: 44px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

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

.legal-article h2 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green-d);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  scroll-margin-top: 90px;
}

.legal-article h2 .art-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  background: rgba(200,169,107,0.15);
  color: var(--gold-d);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}

.legal-article h3 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text1);
  margin: 20px 0 10px;
}

.legal-article p {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.85;
  margin-bottom: 12px;
}

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

.legal-article ul,
.legal-article ol {
  margin: 10px 0 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legal-article ul li,
.legal-article ol li {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.75;
}

.legal-article strong {
  color: var(--text1);
  font-weight: 600;
}

.legal-article a {
  color: var(--green-m);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-article a:hover { color: var(--gold-d); }

/* Identité société */
.legal-identity {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 14px 0;
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.8;
}

.legal-identity strong {
  display: block;
  font-size: 0.9rem;
  color: var(--green-d);
  font-weight: 700;
  margin-bottom: 4px;
}

/* Callout info / attention */
.legal-callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 0.84rem;
  line-height: 1.6;
}

.legal-callout.info {
  background: rgba(47,79,62,0.06);
  border: 1px solid rgba(47,79,62,0.15);
  color: var(--text2);
}

.legal-callout.warn {
  background: rgba(200,169,107,0.08);
  border: 1px solid rgba(200,169,107,0.25);
  color: var(--text2);
}

.legal-callout .icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Table cookies */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.legal-table th {
  background: var(--green-d);
  color: rgba(255,255,255,0.9);
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.legal-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: top;
  line-height: 1.6;
}

.legal-table tr:last-child td { border-bottom: none; }
.legal-table tr:nth-child(even) td { background: var(--bg2); }

/* Badge durée / type cookie */
.cookie-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.cookie-badge.essential { background: rgba(47,79,62,0.1); color: var(--green-d); }
.cookie-badge.analytics  { background: rgba(200,169,107,0.15); color: var(--gold-d); }
.cookie-badge.marketing  { background: rgba(139,92,246,0.1); color: #6d28d9; }

/* ── Footer légal ── */
.legal-footer {
  background: var(--green-d);
  padding: 36px 32px;
  margin-top: auto;
}

.legal-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

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

.legal-footer-links a:hover { color: var(--gold); }

.legal-footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .legal-layout {
    grid-template-columns: 1fr;
    padding: 24px 16px 48px;
    gap: 20px;
  }

  .legal-toc {
    position: static;
    order: -1;
  }

  .legal-article {
    padding: 24px 20px;
  }

  .legal-hero {
    padding: 36px 20px 30px;
  }

  .legal-nav {
    padding: 0 16px;
  }

  .legal-footer {
    padding: 24px 20px;
  }

  .legal-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}
