/* ==========================================================================
   PilotScale — pages légales : mentions, confidentialité, CGVU

   Trois pages de texte long, même gabarit : un en-tête, un sommaire ancré
   qui se colle en haut sur grand écran, puis des articles numérotés. Les
   valeurs qui restent à renseigner avant la mise en ligne portent la classe
   .tofill, visible exprès.
   ========================================================================== */

.legal-page { padding: 48px 0 72px; }
.legal-wrap { max-width: 1040px; }

/* ---------- en-tête ---------- */
.legal-head { max-width: 680px; margin-bottom: 34px; }
.legal-head h1 { font-size: 30px; margin-bottom: 12px; }
@media(min-width:900px){ .legal-head h1{ font-size:36px; } }
.legal-meta {
  font-family: var(--font-num); font-size: 12px; color: var(--ink-45);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px;
}
.legal-intro { font-size: 15px; color: var(--ink-70); }

/* ---------- avertissement d'édition ---------- */
.legal-notice {
  background: var(--amber-bg); border: 1.5px solid color-mix(in srgb, var(--amber) 35%, transparent);
  border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 32px;
  font-size: 13px; color: var(--ink); line-height: 1.6; max-width: 760px;
}
.legal-notice b { color: var(--amber); }

/* Une valeur encore à renseigner. Surlignée pour qu'un oubli se voie. */
.tofill {
  background: var(--amber-bg); color: var(--amber); font-weight: 600;
  padding: 1px 7px; border-radius: 6px; font-size: .94em;
  border: 1px dashed color-mix(in srgb, var(--amber) 45%, transparent);
}

/* ---------- sommaire + corps ---------- */
.legal-grid { display: grid; gap: 34px; align-items: start; }
/* min-width:0 sur les deux colonnes : sans lui, un tableau plus large que
   l'écran élargit la piste et fait déborder la page au lieu de défiler. */
.legal-grid > * { min-width: 0; }
@media(min-width:960px){ .legal-grid{ grid-template-columns:232px 1fr; gap:48px; } }

.legal-toc {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px;
}
@media(min-width:960px){ .legal-toc{ position:sticky; top:92px; max-height:calc(100vh - 120px); overflow-y:auto; } }
.legal-toc h2 {
  font-size: 11.5px; font-weight: 700; color: var(--teal); text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 14px;
}
.legal-toc ol { list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 9px; }
.legal-toc li { counter-increment: toc; font-size: 13px; line-height: 1.45; }
.legal-toc a { color: var(--ink-70); text-decoration: none; display: flex; gap: 8px; }
.legal-toc a:before {
  content: counter(toc); font-family: var(--font-num); font-size: 11px;
  color: var(--ink-45); flex-shrink: 0; min-width: 14px;
}
.legal-toc a:hover { color: var(--teal); }

/* ---------- articles ---------- */
.legal-body { max-width: 720px; min-width: 0; }
.legal-body section { padding-top: 8px; margin-bottom: 34px; scroll-margin-top: 88px; }
.legal-body h2 {
  font-size: 19px; margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.legal-body h3 { font-size: 15px; margin: 22px 0 8px; }
.legal-body p { font-size: 14px; color: var(--ink-70); line-height: 1.72; margin-bottom: 12px; }
.legal-body p:last-child { margin-bottom: 0; }
.legal-body strong { color: var(--ink); font-weight: 600; }
.legal-body a { color: var(--teal); font-weight: 600; }

.legal-body ul, .legal-body ol { margin: 0 0 14px 0; padding-left: 0; list-style: none; }
.legal-body li {
  font-size: 14px; color: var(--ink-70); line-height: 1.68;
  padding-left: 22px; position: relative; margin-bottom: 8px;
}
.legal-body ul > li:before {
  content: ""; position: absolute; left: 4px; top: 9px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--teal-dim);
}
.legal-body ol { counter-reset: art; }
.legal-body ol > li { counter-increment: art; }
.legal-body ol > li:before {
  content: counter(art) "."; position: absolute; left: 0; top: 0;
  font-family: var(--font-num); font-size: 12px; color: var(--teal); font-weight: 600;
}

/* ---------- fiche d'identité et tableaux ---------- */
.legal-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 18px;
}
.legal-dl { display: grid; gap: 12px; }
@media(min-width:620px){ .legal-dl{ grid-template-columns:190px 1fr; gap:12px 20px; } }
.legal-dl dt { font-size: 13px; font-weight: 600; color: var(--ink); }
.legal-dl dd { font-size: 13.5px; color: var(--ink-70); line-height: 1.6; }

.legal-table-scroll { overflow-x: auto; margin-bottom: 18px; }
.legal-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.legal-table th, .legal-table td {
  text-align: left; padding: 11px 14px; font-size: 13px; line-height: 1.55;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.legal-table th { font-weight: 600; color: var(--ink); background: var(--surface-2); }
.legal-table td { color: var(--ink-70); }
.legal-table td b { color: var(--ink); font-weight: 600; }
.legal-table .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Sous 640 px, un tableau à trois ou six colonnes ne défile pas : il se lit en
   liste. Chaque cellule reprend son en-tête par data-label, posé dans le HTML —
   sans lui, « 30 jours » ne dirait pas de quel délai il s'agit. */
@media(max-width:640px){
  .legal-table-scroll{ overflow-x:visible; }
  .legal-table{ min-width:0; display:block; }
  .legal-table thead{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  .legal-table tbody, .legal-table tr, .legal-table td{ display:block; width:100%; }
  .legal-table tr{
    border-bottom:1px solid var(--line); padding:14px 0;
  }
  .legal-table tr:last-child{ border-bottom:none; }
  .legal-table td{ border:none; padding:0; font-size:13.5px; }
  .legal-table td + td{ margin-top:7px; }
  .legal-table td:before{
    content:attr(data-label); display:block; font-size:11px; font-weight:700;
    text-transform:uppercase; letter-spacing:.06em; color:var(--ink-45); margin-bottom:2px;
  }
  /* La première cellule porte le sujet de la ligne : son étiquette est redondante. */
  .legal-table td:first-child{ font-size:14.5px; color:var(--ink); font-weight:600; }
  .legal-table td:first-child:before{ display:none; }
  .legal-table td.num{ white-space:normal; }
}

/* ---------- encadré de mise en garde dans le texte ---------- */
.legal-callout {
  background: var(--mint-50); border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 16px 18px; margin: 0 0 16px;
}
.legal-callout p { margin-bottom: 0; font-size: 13.5px; }

/* ---------- passerelle entre les trois documents ---------- */
.legal-siblings { margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--line); }
.legal-siblings h2 { font-size: 15px; margin-bottom: 16px; }
.legal-sibling-grid { display: grid; gap: 12px; }
@media(min-width:760px){ .legal-sibling-grid{ grid-template-columns:repeat(3,1fr); } }
.legal-sibling {
  display: block; text-decoration: none; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px;
  transition: border-color .15s ease, transform .15s ease;
}
.legal-sibling:hover { border-color: var(--teal); transform: translateY(-2px); }
.legal-sibling b { display: block; font-size: 14px; margin-bottom: 4px; }
.legal-sibling span { font-size: 12.5px; color: var(--ink-70); line-height: 1.55; }
.legal-sibling[aria-current="page"] { border-color: var(--teal-dim); background: var(--mint-50); }
