/* Fenêtre de consentement (js/consent.js) — site web uniquement.
   Fichier identique CRM / Prospector ; jetons de css/index.css (thèmes clair et sombre). */

.consent-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
  background: rgba(5, 6, 10, 0.55);
  backdrop-filter: blur(3px);
}
.consent-box {
  width: min(640px, 100%);
  max-height: calc(100vh - 32px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px 24px 18px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-body);
}
.consent-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.consent-intro { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-muted); max-width: 62ch; }

.consent-cats { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); }
.consent-cat { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; }
.consent-cat + .consent-cat { border-top: 1px solid var(--border); }
.consent-cat-head { display: flex; align-items: center; gap: 10px; }
.consent-cat-title { font-weight: 600; font-size: 14px; flex: 1; cursor: pointer; }
.consent-cat-state { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--text-dim); }
.consent-cat-text { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.consent-cat-details { margin: 0; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; color: var(--text-dim); overflow-wrap: anywhere; }

/* Interrupteur accessible (case à cocher native restylée) */
.consent-switch {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 36px; height: 20px; margin: 0; border-radius: 999px; cursor: pointer;
  background: var(--bg-hover); border: 1px solid var(--border); position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.consent-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-muted); transition: transform 0.15s, background 0.15s;
}
.consent-switch:checked { background: var(--accent); border-color: var(--accent); }
.consent-switch:checked::after { transform: translateX(16px); background: #fff; }
.consent-switch:disabled { cursor: not-allowed; opacity: 0.6; }
.consent-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.consent-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* « Tout refuser » et « Tout accepter » : même poids visuel, volontairement. */
.consent-choice {
  flex: 1 1 160px; justify-content: center;
  background: var(--bg-surface); color: var(--text);
  border: 1px solid var(--border-hi);
  font-weight: 600;
}
.consent-choice:hover { background: var(--accent-soft); }
.consent-custom { flex: 0 0 auto; }
.consent-foot { margin: 0; font-size: 12px; color: var(--text-dim); }

/* Bouton « Cookies » de l'en-tête (masqué en bureau par js/consent.js) */
#consent-manage[hidden], .consent-cats[hidden] { display: none !important; }
#consent-manage { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; width: auto; padding: 0 10px; }

@media (max-width: 520px) {
  .consent-box { padding: 18px 16px 14px; }
  .consent-choice { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .consent-switch, .consent-switch::after { transition: none; }
}
