/* ==========================================================================
   Zéro Tache — consentement aux témoins et page « Politique de confidentialité »
   Aucun style en ligne (compatible avec la CSP du site). Les couleurs et les
   rayons viennent des variables de style.css.
   ========================================================================== */

/* ---------- Fenêtre de consentement ---------- */

.cc {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: calc(100% - 44px);
  max-width: 540px;
  max-height: calc(100vh - 44px);
  max-height: calc(100dvh - 44px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.55;
  animation: cc-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.cc[hidden],
.cc [hidden] {
  display: none;
}

@keyframes cc-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc {
    animation: none;
  }
}

.cc-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.cc-title:focus {
  outline: none;
}

.cc-title svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--teal);
}

.cc p {
  margin: 0 0 12px;
  color: var(--ink-soft);
}

.cc a {
  color: var(--teal-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* « Tout refuser » et « Tout accepter » ont le même poids visuel. */
.cc-btn {
  flex: 1 1 150px;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--teal);
  border-radius: 999px;
  background: var(--white);
  color: var(--teal-dark);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cc-btn:hover {
  background: var(--teal);
  color: var(--white);
}

.cc-btn:focus-visible,
.cc-switch:focus-visible,
.site-footer__cc:focus-visible {
  outline: 3px solid var(--sun-dark);
  outline-offset: 3px;
}

/* « Enregistrer mes choix » occupe sa propre ligne. */
.cc-btn-wide {
  flex-basis: 100%;
}

.cc-btn-link {
  flex: 1 1 100%;
  min-height: 0;
  padding: 6px 4px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--teal-dark);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cc-btn-link:hover {
  background: none;
  color: var(--ink);
}

/* Catégories de témoins */

.cc-cats {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.cc-cat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.cc-cat-name {
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.cc-cat-desc {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.88rem;
}

.cc-cat-state {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal-dark);
  white-space: nowrap;
}

/* Interrupteur : une vraie case à cocher, restylée. */
.cc-switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--mint);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.cc-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink-soft);
  transition: transform 0.15s, background 0.15s;
}

.cc-switch:checked {
  border-color: var(--teal);
  background: var(--teal);
}

.cc-switch:checked::before {
  transform: translateX(20px);
  background: var(--white);
}

@media (max-width: 760px) {
  .cc {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 20px;
  }
}

/* ---------- Pied de page : bouton « Gérer les témoins » ---------- */

.site-footer__cc {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.85;
}

.site-footer__cc:hover {
  opacity: 1;
}

/* ---------- Page « Politique de confidentialité » ---------- */

.legal {
  max-width: 820px;
  margin: 0 auto;
}

.legal h1 {
  margin: 0 0 12px;
}

.legal-meta {
  margin: 0 0 28px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.legal h2 {
  margin: 40px 0 12px;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
}

.legal h3 {
  margin: 24px 0 8px;
  font-size: 1.1rem;
}

.legal p,
.legal li {
  color: var(--ink-soft);
  line-height: 1.65;
}

.legal p strong,
.legal li strong {
  color: var(--ink);
}

.legal ul {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

.legal li {
  margin-bottom: 6px;
}

.legal li::marker {
  color: var(--teal);
}

.legal a:not(.btn) {
  color: var(--teal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal address {
  margin: 0 0 1em;
  padding: 16px 20px;
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--mint);
  font-style: normal;
  color: var(--ink);
}

.legal .table-wrap {
  margin: 0 0 1em;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.legal table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.legal caption {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--ink);
}

.legal th,
.legal td {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  color: var(--ink-soft);
}

.legal thead th {
  background: var(--foam);
  color: var(--ink);
}

.legal tbody th {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.legal .btn {
  margin: 4px 0 1em;
}
