/* ============================================================
   Savoira — Refonte : gabarit légal (Politique de confidentialité)
   Resservira pour /conditions. Complète redesign.css +
   refonte-formations.css (en-tête .page-head / .breadcrumb).
   ============================================================ */

/* ---------- En-tête légal (§2.1) ---------- */

.legal-head { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.legal-head .h1 { font-size: clamp(34px, 4.4vw, 52px); margin-top: 16px; max-width: 760px; }
.legal-head .ph-sub { max-width: 640px; }

.legal-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 26px; }
.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--body);
  white-space: nowrap;
}
.meta-pill svg { color: var(--green-deep); flex: none; }

/* ---------- Grille [TOC | contenu] ---------- */

.legal-body { padding: 56px 0 104px; }
.legal-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* ---------- Sommaire latéral (§2.2) ---------- */

.legal-toc {
  position: sticky;
  top: 88px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 14px 8px;
}
.legal-toc .toc-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding: 0 8px 12px;
  display: block;
}
.legal-toc ol { list-style: none; margin: 0; padding: 0; }
.legal-toc ol a {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--body);
  transition: background .15s ease, color .15s ease;
}
.legal-toc ol a .tn {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--green-deep);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.legal-toc ol a:hover { background: #F0F2EF; color: var(--ink); }
.legal-toc ol a.on { background: var(--mint); color: var(--green-deep); font-weight: 500; }
.legal-toc .toc-actions {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding: 6px 0;
}
.legal-toc .toc-actions a,
.legal-toc .toc-actions button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--body);
  border-radius: var(--r-sm);
  text-align: left;
  transition: background .15s ease, color .15s ease;
}
.legal-toc .toc-actions a + a,
.legal-toc .toc-actions button + a { border-top: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); }
.legal-toc .toc-actions a:hover,
.legal-toc .toc-actions button:hover { background: #F0F2EF; color: var(--ink); }
.legal-toc .toc-actions svg { color: var(--green-deep); flex: none; }

/* ---------- TOC mobile : chips scrollables (§5) ---------- */

.toc-chips-bar {
  display: none;
  position: sticky;
  top: 64px;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.toc-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 24px;
  scrollbar-width: none;
}
.toc-chips::-webkit-scrollbar { display: none; }
.toc-chips a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  font-size: 13px;
  font-weight: 500;
  color: var(--body);
  white-space: nowrap;
  flex: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.toc-chips a .tn {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green-deep);
  font-variant-numeric: tabular-nums;
}
.toc-chips a.on { background: var(--mint); border-color: var(--mint-line); color: var(--green-deep); }
.chips-actions {
  display: flex;
  gap: 18px;
  padding: 0 24px 10px;
}
.chips-actions a, .chips-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: none;
  padding: 4px 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--body);
}
.chips-actions a:hover, .chips-actions button:hover { color: var(--ink); }
.chips-actions svg { color: var(--green-deep); }

/* ---------- Cartes promesses (§2.3) ---------- */

.promises {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 56px;
}
.promise {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.promise .p-ico {
  width: 36px;
  height: 36px;
  border-radius: var(--r-btn);
  background: var(--mint);
  border: 1px solid var(--mint-line);
  color: var(--green-deep);
  display: grid;
  place-items: center;
  flex: none;
}
.promise .p-ico svg { width: 20px; height: 20px; }
.promise .p-t { font-size: 14.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.promise .p-d { font-size: 13px; color: var(--muted); line-height: 1.55; margin-top: 3px; }

/* ---------- Sections numérotées (§2.4) ---------- */

.legal-content { max-width: 720px; min-width: 0; }
.legal-section { border-top: 1px solid var(--line); padding-top: 28px; margin-top: 56px; scroll-margin-top: 110px; }
.legal-section:first-of-type { margin-top: 0; }
.legal-section .sec-head {
  display: flex;
  align-items: baseline;
  gap: 13px;
  margin-bottom: 16px;
}
.legal-section .sec-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--green-deep);
  letter-spacing: 0.10em;
  font-variant-numeric: tabular-nums;
}
.legal-section h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}
.legal-section p { font-size: 15px; line-height: 1.7; color: var(--body); margin: 0 0 14px; }
.legal-section p:last-child { margin-bottom: 0; }
.legal-section h3 { font-size: 15px; font-weight: 600; color: var(--ink); margin: 24px 0 10px; letter-spacing: -0.01em; }
.legal-section strong { color: var(--ink); font-weight: 600; }
.legal-section a { color: var(--green-deep); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.legal-section a:hover { color: var(--pine); }
.legal-section ul { list-style: none; margin: 0 0 16px; padding: 0; }
.legal-section ul li {
  position: relative;
  padding: 5px 0 5px 20px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--body);
}
.legal-section ul li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 15px;
  width: 4px;
  height: 4px;
  background: var(--green);
}

/* ---------- Tableaux (§2.5) ---------- */

.legal-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
  overflow-x: auto;
  margin: 18px 0 20px;
}
.legal-table { width: 100%; border-collapse: collapse; }
.legal-table thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: #F7F9F6;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.legal-table tbody td {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--body);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.legal-table tbody tr:last-child td { border-bottom: none; }
.legal-table tbody td:first-child { font-weight: 500; color: var(--ink); }

/* ---------- Panneaux (§2.6) ---------- */

.panel {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: var(--r-card);
  padding: 15px 16px;
  margin: 18px 0;
  font-size: 13.5px;
  line-height: 1.6;
}
.panel .pn-ico { flex: none; display: inline-flex; margin-top: 2px; }
.panel .pn-title { font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.panel p { font-size: 13.5px !important; margin: 0 !important; }
.panel-info { background: var(--mint); border: 1px solid var(--mint-line); color: var(--pine); }
.panel-info p { color: var(--pine); }
.panel-info .pn-ico { color: var(--green-deep); }
.panel-warn { background: var(--amber-bg); border: 1px solid #F2DDBC; color: #6B3E12; }
.panel-warn p { color: #6B3E12; }
.panel-warn .pn-ico { color: var(--amber-ink); }
.panel-warn .pn-title { color: var(--amber-ink); }

/* ---------- Cartes lettrées — base légale (§2.7) ---------- */

.bases {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 4px;
}
.base-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px;
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
.base-card .b-tag {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mint);
  border: 1px solid var(--mint-line);
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex: none;
}
.base-card .b-t { font-size: 14.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.base-card .b-d { font-size: 13px; color: var(--muted); line-height: 1.55; margin-top: 3px; }

/* ---------- Cartes tiers — partage (§2.8) ---------- */

.shares {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 8px;
}
.share-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px;
}
.share-card .s-ico {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--mint);
  border: 1px solid var(--mint-line);
  color: var(--green-deep);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}
.share-card .s-t { font-size: 14.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 5px; }
.share-card .s-d { font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ---------- Timeline de conservation (§2.9) ---------- */

.retention { margin: 20px 0 6px; }
.ret-row {
  display: grid;
  grid-template-columns: 84px 16px minmax(0, 1fr);
  gap: 16px;
  position: relative;
  padding-bottom: 22px;
}
.ret-row::after {
  content: "";
  position: absolute;
  left: calc(84px + 16px + 7.5px);
  top: 16px;
  bottom: -2px;
  width: 1px;
  background: var(--line);
}
.ret-row:last-child { padding-bottom: 0; }
.ret-row:last-child::after { display: none; }
.ret-when {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-deep);
  text-align: right;
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}
.ret-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  justify-self: center;
  margin-top: 7px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 3px var(--paper);
}
.ret-what { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; }
.ret-detail { font-size: 13px; color: var(--muted); line-height: 1.55; margin-top: 3px; }

/* ---------- Grille des droits (§2.10) ---------- */

.rights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 22px;
}
.right-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  padding: 14px 15px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.right-card .r-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--green-deep);
  padding-top: 2px;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.right-card .r-t { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; }
.right-card .r-d { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }

/* ---------- Mini-cartes contact (§2.11) ---------- */

.contacts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.contact-card .c-k {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}
.contact-card .c-d { font-size: 12.5px; color: var(--body); line-height: 1.55; margin-bottom: 14px; }
.contact-card .c-mail {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-top: auto;
  align-self: flex-start;
}
.contact-card .c-mail:hover { color: var(--pine); }

/* ---------- Responsive (§5) ---------- */

@media (max-width: 1000px) {
  .legal-grid { grid-template-columns: 1fr; gap: 0; }
  .legal-toc { display: none; }
  .toc-chips-bar { display: block; }
  .legal-body { padding-top: 40px; }
  .legal-section { scroll-margin-top: 170px; }
}

@media (max-width: 880px) {
  .shares { grid-template-columns: 1fr; }
  .contacts { grid-template-columns: 1fr; }
  .bases { grid-template-columns: 1fr; }
  .legal-table { min-width: 560px; }
}

@media (max-width: 600px) {
  .legal-head { padding: 40px 0 32px; }
  .promises { grid-template-columns: 1fr; gap: 10px; margin-bottom: 44px; }
  .rights { grid-template-columns: 1fr; }
  .legal-section { margin-top: 44px; }
  .toc-chips { padding: 10px 24px; }
  /* Timeline : plage au-dessus du contenu */
  .ret-row { grid-template-columns: 16px minmax(0, 1fr); gap: 12px; }
  .ret-row::after { left: 7.5px; }
  .ret-when { grid-column: 2; text-align: left; order: -1; padding-top: 0; }
  .ret-dot { grid-row: 2; }
  .ret-body { grid-row: 2; }
}
