/* ============================================
   ATELIER IA BERNAY — Styles spécifiques pages légales
   Mentions légales, Confidentialité, CGU/CGV
   ============================================ */

.legal-content {
  background: linear-gradient(180deg, #fafbfd, #fff);
}

/* Layout 2 colonnes : sommaire + contenu */
.legal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
}

/* === Sommaire sticky === */
.legal-toc {
  position: sticky;
  top: 110px;
  padding: 26px 24px;
  background: #fff;
  border: 1px solid rgba(15, 42, 74, 0.06);
}

.legal-toc h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--gold-dark);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(201, 166, 107, 0.3);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

.legal-toc ol {
  list-style: none;
  counter-reset: toc;
  padding: 0;
  margin: 0;
}

.legal-toc ol li {
  counter-increment: toc;
  margin-bottom: 12px;
  position: relative;
  padding-left: 28px;
  line-height: 1.4;
}

.legal-toc ol li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  color: var(--gold-dark);
  font-size: 0.92rem;
}

.legal-toc ol li a {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.25s ease;
  display: inline-block;
}

.legal-toc ol li a:hover {
  color: var(--navy);
  text-decoration: none;
}

.legal-toc ol li a:hover::after {
  content: " →";
  color: var(--gold);
}

/* === Article === */
.legal-article {
  background: #fff;
  border: 1px solid rgba(15, 42, 74, 0.06);
  border-radius: 20px;
  padding: 48px 56px;
  box-shadow: 0 12px 36px rgba(15, 42, 74, 0.05);
  scroll-padding-top: 100px;
}

.legal-article section {
  scroll-margin-top: 100px;
  padding-bottom: 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid rgba(15, 42, 74, 0.06);
}

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

.legal-article h2 {
  font-size: 1.7rem;
  color: var(--navy);
  margin-bottom: 18px;
  position: relative;
  padding-bottom: 10px;
  letter-spacing: -0.01em;
}

.legal-article h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background: var(--gold);
}

.legal-article h3 {
  font-size: 1.15rem;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  color: var(--navy);
  margin: 24px 0 12px;
}

.legal-article p {
  font-size: 0.96rem;
  line-height: 1.75;
  color: #334155;
  margin-bottom: 14px;
}

.legal-article a {
  color: var(--gold-dark);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(201, 166, 107, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.25s ease;
}

.legal-article a:hover {
  text-decoration-color: var(--gold-dark);
}

/* === Listes légales === */
.legal-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 18px;
}

.legal-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 0.96rem;
  line-height: 1.7;
  color: #334155;
}

.legal-list li::before {
  content: "›";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  font-weight: 700;
  font-size: 1.1rem;
}

/* === Bloc d'information === */
.legal-block {
  background: linear-gradient(180deg, #fafbfd, #fff);
  border-left: 3px solid var(--gold);
  padding: 20px 24px;
  border-radius: 0 10px 10px 0;
  margin: 18px 0;
}

.legal-block p {
  margin-bottom: 0;
  line-height: 1.8;
}

.legal-block strong {
  color: var(--navy);
}

/* === Tableau récap (politique confidentialité) === */
.legal-table-wrap {
  margin: 20px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(15, 42, 74, 0.06);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.94rem;
}

.legal-table th {
  background: var(--navy);
  color: #fff;
  padding: 14px 16px;
  text-align: left;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1rem;
}

.legal-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 42, 74, 0.06);
  line-height: 1.6;
}

.legal-table tr:last-child td {
  border-bottom: none;
}

.legal-table tr:hover td {
  background: rgba(201, 166, 107, 0.04);
}

/* === Cartes des droits (politique confidentialité) === */
.rights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 22px 0;
}

.right-card {
  background: #fff;
  border: 1px solid rgba(15, 42, 74, 0.06);
  border-radius: 12px;
  padding: 20px 22px;
  transition: all 0.3s var(--ease-out);
  position: relative;
}

.right-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 12px 12px 0 0;
}

.right-card:hover {
  border-color: rgba(201, 166, 107, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(15, 42, 74, 0.08);
}

.right-card h3 {
  font-size: 1rem;
  margin: 0 0 8px;
  color: var(--navy);
}

.right-card p {
  font-size: 0.88rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

/* === Offer summary (CGU) === */
.offer-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 18px 0;
}

.offer-summary .legal-block {
  font-size: 0.94rem;
  line-height: 1.7;
}

.offer-summary .legal-block strong {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.08rem;
  display: inline-block;
  margin-bottom: 4px;
}

/* === Notes de mise à jour === */
.legal-update {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed rgba(15, 42, 74, 0.15);
  font-style: italic;
  font-size: 0.85rem;
}

.small {
  font-size: 0.86rem;
  line-height: 1.6;
}

/* === Responsive === */
@media (max-width: 980px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .legal-toc {
    position: static;
    padding: 22px 20px;
  }
  .legal-toc ol {
    columns: 2;
    column-gap: 20px;
  }
  .legal-toc ol li {
    break-inside: avoid;
  }
  .legal-article {
    padding: 36px 32px;
  }
}

@media (max-width: 720px) {
  .legal-article {
    padding: 28px 22px;
    border-radius: 14px;
  }
  .legal-toc ol {
    columns: 1;
  }
  .legal-article h2 {
    font-size: 1.4rem;
  }
  .legal-article h3 {
    font-size: 1.05rem;
  }
  .legal-article section {
    padding-bottom: 28px;
    margin-bottom: 28px;
  }
  .rights-grid {
    grid-template-columns: 1fr;
  }
  .legal-table {
    font-size: 0.86rem;
  }
  .legal-table th,
  .legal-table td {
    padding: 10px 12px;
  }
  .legal-block {
    padding: 16px 18px;
  }
}
