/* =============================================================================
   BarroTech - Bandeau et panneau de gestion des traceurs
   -----------------------------------------------------------------------------
   Feuille externe et non pas styles inline : la Content-Security-Policy du site
   autorise 'self' pour les feuilles, et l'ANSSI recommande de proscrire les
   contenus inline (R15 du guide « maitriser les standards de securite cote
   navigateur »). Aucune regle ici n'est appliquee tant que js/consent.js n'a
   pas cree les elements correspondants.

   Les deux boutons « Tout accepter » et « Tout refuser » partagent la classe
   .bt-btn--equal : meme taille, meme fond, meme contraste. La CNIL sanctionne
   les bandeaux ou le refus est visuellement moins accessible que l'acceptation.
   Ne pas dissocier leur apparence.
   ========================================================================== */

.bt-consent {
  --bt-surface: #0B1424;
  --bt-surface-high: #121D31;
  --bt-line: rgba(255, 255, 255, 0.10);
  --bt-text: #F2F5FA;
  --bt-muted: rgba(242, 245, 250, 0.70);
  --bt-accent: #DCB28A;
  --bt-accent-deep: #A87D55;
  --bt-on-accent: #1A1208;
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--bt-text);
}

.bt-consent[hidden] { display: none !important; }

/* --- Bandeau ------------------------------------------------------------- */
/* Ancre en bas de page, jamais en plein ecran : le site reste consultable et
   navigable sans avoir a se prononcer. Un bandeau qui bloque l'acces au
   contenu est un « cookie wall », que la CNIL n'admet que sous conditions
   strictes non reunies ici. */

.bt-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 9000;
  background: var(--bt-surface);
  border-top: 1px solid var(--bt-line);
  box-shadow: 0 -18px 48px rgba(2, 6, 14, 0.55);
}

.bt-banner__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px clamp(18px, 3vw, 44px) calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 18px clamp(20px, 3vw, 44px);
}

.bt-banner__body { flex: 1 1 320px; min-width: 0; }

.bt-banner__title {
  margin: 0 0 6px;
  font-family: Archivo, Manrope, sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.012em;
}

.bt-banner__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--bt-muted);
}

.bt-banner__actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* --- Boutons ------------------------------------------------------------- */

.bt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background 200ms ease, border-color 180ms ease, color 180ms ease;
}

/* Accepter et refuser : strictement identiques. */
.bt-btn--equal {
  flex: 1 1 auto;
  min-width: 152px;
  color: var(--bt-on-accent);
  background: linear-gradient(122deg, var(--bt-accent), #C89B72 58%, var(--bt-accent-deep));
}

.bt-btn--equal:hover {
  background: linear-gradient(122deg, #E7C4A0, #D3A87E 58%, #B98C63);
}

.bt-btn--ghost {
  color: var(--bt-text);
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
}

.bt-btn--ghost:hover { border-color: rgba(255, 255, 255, 0.48); }

.bt-consent :focus-visible {
  outline: 2px solid var(--bt-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Panneau de reglage fin ---------------------------------------------- */

.bt-panel {
  position: fixed;
  inset: 0;
  z-index: 9010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 32px);
  background: rgba(2, 6, 14, 0.72);
  backdrop-filter: blur(6px);
}

.bt-panel__dialog {
  width: 100%;
  max-width: 620px;
  max-height: min(84vh, 760px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bt-surface-high), var(--bt-surface));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(2, 6, 14, 0.6);
}

.bt-panel__head {
  padding: 22px clamp(18px, 3vw, 30px) 16px;
  border-bottom: 1px solid var(--bt-line);
}

.bt-panel__title {
  margin: 0;
  font-family: Archivo, Manrope, sans-serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.015em;
}

.bt-panel__intro {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--bt-muted);
}

.bt-panel__body {
  padding: 8px clamp(18px, 3vw, 30px) 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.bt-panel__foot {
  padding: 16px clamp(18px, 3vw, 30px) 22px;
  border-top: 1px solid var(--bt-line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bt-panel__foot .bt-btn { flex: 1 1 auto; min-width: 140px; }

.bt-panel a { color: var(--bt-accent); }

/* --- Categories ---------------------------------------------------------- */

.bt-cat {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.bt-cat:last-child { border-bottom: 0; }

.bt-cat__text { flex: 1 1 auto; min-width: 0; }

.bt-cat__name {
  display: block;
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 700;
}

.bt-cat__desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--bt-muted);
}

.bt-cat__meta {
  margin: 8px 0 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: rgba(242, 245, 250, 0.48);
}

/* Interrupteur : une vraie case a cocher, stylee. Pas de div avec role, le
   clavier et les technologies d'assistance fonctionnent nativement. */

.bt-switch { flex: 0 0 auto; position: relative; width: 50px; height: 28px; }

.bt-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.bt-switch__track {
  display: block;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 180ms ease, border-color 180ms ease;
  pointer-events: none;
}

.bt-switch__track::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  margin: 3px 0 0 3px;
  border-radius: 50%;
  background: #F2F5FA;
  transition: transform 180ms ease;
}

.bt-switch input:checked + .bt-switch__track {
  background: linear-gradient(122deg, var(--bt-accent), var(--bt-accent-deep));
  border-color: transparent;
}

.bt-switch input:checked + .bt-switch__track::after { transform: translateX(22px); }

.bt-switch input:focus-visible + .bt-switch__track {
  outline: 2px solid var(--bt-accent);
  outline-offset: 3px;
}

.bt-switch input:disabled { cursor: default; }

.bt-switch input:disabled + .bt-switch__track {
  background: rgba(220, 178, 138, 0.38);
  border-color: transparent;
}

.bt-switch input:disabled + .bt-switch__track::after {
  transform: translateX(22px);
  background: rgba(255, 255, 255, 0.72);
}

/* --- Zone d'annonce pour les lecteurs d'ecran ---------------------------- */

.bt-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Bouton « Gerer mes cookies » injecte dans le pied de page ----------- */

.bt-footer-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: color 170ms ease;
}

.bt-footer-link:hover { color: #fff; }

/* --- Telephone et tablette ----------------------------------------------- */

@media (max-width: 860px) {
  .bt-banner__inner { flex-direction: column; align-items: stretch; }
  .bt-banner__actions { width: 100%; }
  .bt-btn--equal { min-width: 0; }
}

@media (max-width: 460px) {
  .bt-banner__actions { flex-direction: column; align-items: stretch; }
  .bt-panel__foot { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .bt-consent * { transition: none !important; animation: none !important; }
}
