/* =========================================================
   NEXALY — pages légales
   S'appuie sur les tokens et composants de styles.css
   ========================================================= */

.header--solid {
  position: sticky;
  background: rgba(4, 6, 14, .82);
  border-bottom-color: var(--line);
  backdrop-filter: blur(18px) saturate(140%);
}

.legal {
  position: relative;
  padding-block: clamp(48px, 7vw, 88px) clamp(64px, 8vw, 110px);
  overflow: hidden;
}

.legal__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.legal__bg::before {
  content: "";
  position: absolute;
  top: -30%;
  left: 50%;
  width: min(900px, 120%);
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(124, 107, 255, .18), transparent 65%);
  filter: blur(60px);
}

.legal__inner {
  max-width: 820px;
  margin-inline: auto;
}

.legal__back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-mute);
  font-size: .9375rem;
  font-weight: 500;
}
.legal__back svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .3s var(--ease);
}
.legal__back:hover { color: var(--accent); }
.legal__back:hover svg { transform: translateX(-3px); }

.legal__title {
  margin-top: 26px;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  letter-spacing: -.03em;
}

.legal__meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  color: var(--text-mute);
  font-size: .875rem;
}
.legal__updated {
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(255, 255, 255, .03);
}

/* ---------------- Sommaire ---------------- */

.toc {
  margin-top: 40px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .025);
}
.toc h2 {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.toc ol {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 9px 26px;
  counter-reset: toc;
}
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: 10px;
  color: var(--text-soft);
  font-size: .9375rem;
}
.toc a::before {
  content: counter(toc) ".";
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--text); }

/* ---------------- Corps du texte ---------------- */

.legal__body { margin-top: 12px; }

.legal__body section {
  padding-top: clamp(38px, 5vw, 52px);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.legal__body h2 {
  position: relative;
  padding-left: 18px;
  font-size: clamp(1.35rem, 2.6vw, 1.65rem);
}
.legal__body h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: .16em;
  bottom: .16em;
  width: 3px;
  border-radius: 3px;
  background: var(--grad);
}

.legal__body h3 {
  margin-top: 30px;
  font-size: 1.075rem;
  color: var(--text);
}

.legal__body p,
.legal__body li {
  color: var(--text-soft);
  font-size: 1rem;
}
.legal__body p { margin-top: 16px; }

.legal__body a:not(.btn) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(69, 224, 255, .4);
}
.legal__body a:not(.btn):hover { text-decoration-color: var(--accent); }

.legal__body strong { color: var(--text); font-weight: 600; }

.legal__body ul {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}
.legal__body ul li {
  position: relative;
  padding-left: 22px;
}
.legal__body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 11px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

/* ---------------- Encarts ---------------- */

.note {
  margin-top: 26px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: rgba(69, 224, 255, .05);
}
.note p { margin-top: 0; }
.note p + p { margin-top: 12px; }
.note--warn {
  border-left-color: #ffc861;
  background: rgba(255, 200, 97, .06);
}

/* Bloc d'identité (éditeur, hébergeur…) */
.identity {
  margin-top: 20px;
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .025);
  overflow: hidden;
}
.identity div {
  display: grid;
  grid-template-columns: minmax(150px, 32%) 1fr;
  gap: 16px;
  padding: 14px 22px;
}
.identity div + div { border-top: 1px solid var(--line-soft); }
.identity dt {
  color: var(--text-mute);
  font-size: .875rem;
}
.identity dd {
  margin: 0;
  color: var(--text);
  font-size: .9375rem;
}

/* ---------------- Tableau des cookies ---------------- */

.table-wrap {
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: .875rem;
}

/* Tableau des cookies : 5 colonnes */
table.cookies col:nth-child(1) { width: 17%; }
table.cookies col:nth-child(2) { width: 16%; }
table.cookies col:nth-child(3) { width: 34%; }
table.cookies col:nth-child(4) { width: 16%; }
table.cookies col:nth-child(5) { width: 17%; }
thead th {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
}
tbody td { overflow-wrap: anywhere; }

table.cookies thead th {
  font-size: .72rem;
  letter-spacing: .02em;
}

tbody td {
  padding: 14px 18px;
  color: var(--text-soft);
  vertical-align: top;
}
tbody tr + tr td { border-top: 1px solid var(--line-soft); }
tbody td:first-child { color: var(--text); font-weight: 500; }

/* ---------------- Pied de page légal ---------------- */

.legal__cta {
  margin-top: clamp(48px, 6vw, 70px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(155deg, rgba(17, 24, 50, .7), rgba(5, 8, 18, .7));
  text-align: center;
}
.legal__cta h2 { font-size: 1.3rem; }
.legal__cta p {
  margin-top: 12px;
  color: var(--text-soft);
  font-size: .9375rem;
}
.legal__cta .btn { margin-top: 22px; }

.legal-links {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-size: .9375rem;
}
.legal-links a { color: var(--text-mute); }
.legal-links a:hover { color: var(--accent); }
.legal-links a[aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

@media (max-width: 560px) {
  .identity div { grid-template-columns: 1fr; gap: 4px; }
  .toc { padding: 22px 20px; }
}
