/* ============================================================
   DBAI — Cookie consent (Loi 25)
   Banner + manage panel. Reuses tokens from styles.css.
   Loaded on every page (landing + legal).
   ============================================================ */

.dbai-consent,
.dbai-consent * { box-sizing: border-box; }

/* hidden until JS decides whether to show */
.dbai-consent[hidden] { display: none !important; }

/* ---------- Banner ---------- */
.cc-banner {
  position: fixed;
  left: 50%;
  bottom: clamp(14px, 3vw, 26px);
  transform: translateX(-50%) translateY(14px);
  z-index: 1000;
  width: min(680px, calc(100vw - 28px));
  background: color-mix(in srgb, var(--surface, #15151a) 96%, transparent);
  border: 1px solid var(--line, rgba(255,255,255,0.11));
  border-radius: var(--r-lg, 20px);
  box-shadow: 0 30px 70px -28px rgba(0,0,0,0.85), 0 10px 24px -16px rgba(0,0,0,0.6);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  padding: clamp(18px, 2.4vw, 24px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease, ease), transform .35s var(--ease-out, ease);
  font-family: var(--font, system-ui, sans-serif);
}
.cc-banner.is-shown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.cc-banner-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.cc-banner-ico {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft, rgba(160,110,210,0.2));
  color: var(--accent-2, #c79be8);
}
.cc-banner-ico svg { width: 17px; height: 17px; }
.cc-banner-head h2 {
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink, #f3f3f1); margin: 0;
}
.cc-banner-body {
  font-size: 14px; line-height: 1.6;
  color: var(--ink-2, #b7b7be); margin: 0 0 16px;
}
.cc-banner-body a {
  color: var(--accent-2, #c79be8);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.cc-banner-body a:hover { color: var(--ink, #f3f3f1); }

.cc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cc-actions .cc-btn { flex: 1 1 auto; }

/* ---------- Buttons (self-contained, theme-aware) ---------- */
.cc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px;
  font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: -0.005em;
  border-radius: 11px; border: 1px solid transparent; cursor: pointer;
  white-space: nowrap;
  transition: transform .16s var(--ease-out, ease), background .18s ease, border-color .18s ease, box-shadow .2s ease;
}
.cc-btn:hover { transform: translateY(-1px); }
.cc-btn:active { transform: translateY(0); }
.cc-btn-primary {
  background: var(--accent, #9b6bd2); color: #fff;
  box-shadow: 0 10px 26px -12px var(--accent-glow, rgba(150,90,210,0.5));
}
.cc-btn-primary:hover { box-shadow: 0 14px 30px -10px var(--accent-glow, rgba(150,90,210,0.55)); }
.cc-btn-ghost {
  background: var(--surface, #15151a); color: var(--ink, #f3f3f1);
  border-color: var(--line, rgba(255,255,255,0.13));
}
.cc-btn-ghost:hover { background: var(--bg-tint, #17171c); border-color: rgba(255,255,255,0.24); }
.cc-btn-text {
  background: transparent; color: var(--ink-2, #b7b7be);
  border-color: var(--line-2, rgba(255,255,255,0.07));
}
.cc-btn-text:hover { color: var(--ink, #f3f3f1); border-color: var(--line, rgba(255,255,255,0.13)); }

/* ---------- Manage panel (modal) ---------- */
.cc-scrim {
  position: fixed; inset: 0; z-index: 1100;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(4,4,6,0.6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity .25s var(--ease, ease), visibility .25s var(--ease, ease);
}
.cc-scrim.is-shown { opacity: 1; visibility: visible; }

.cc-panel {
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  display: flex; flex-direction: column;
  background: var(--bg-soft, #101014);
  border: 1px solid var(--line, rgba(255,255,255,0.12));
  border-radius: var(--r-lg, 20px);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.85);
  font-family: var(--font, system-ui, sans-serif);
  transform: translateY(12px) scale(0.99);
  transition: transform .28s var(--ease-out, ease);
}
.cc-scrim.is-shown .cc-panel { transform: none; }

.cc-panel-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line-2, rgba(255,255,255,0.07));
}
.cc-panel-head .cc-h-txt { flex: 1; }
.cc-panel-head h2 {
  font-size: 19px; font-weight: 600; letter-spacing: -0.015em;
  color: var(--ink, #f3f3f1); margin: 0 0 5px;
}
.cc-panel-head p {
  font-size: 13.5px; line-height: 1.55; color: var(--ink-3, #7c7c86); margin: 0;
}
.cc-x {
  flex: none; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface, #15151a); border: 1px solid var(--line, rgba(255,255,255,0.11));
  color: var(--ink-2, #b7b7be); cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.cc-x:hover { color: var(--ink, #f3f3f1); border-color: rgba(255,255,255,0.24); background: var(--bg-tint, #17171c); }
.cc-x svg { width: 17px; height: 17px; }

.cc-panel-body {
  padding: 8px 24px 4px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cc-cat {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-2, rgba(255,255,255,0.07));
}
.cc-cat:last-child { border-bottom: none; }
.cc-cat-txt { flex: 1; }
.cc-cat-txt h3 {
  font-size: 15px; font-weight: 600; color: var(--ink, #f3f3f1);
  margin: 0 0 5px; display: flex; align-items: center; gap: 9px;
}
.cc-tag {
  font-family: var(--mono, monospace); font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px;
  background: var(--accent-soft, rgba(160,110,210,0.18)); color: var(--accent-2, #c79be8);
}
.cc-cat-txt p { font-size: 13px; line-height: 1.55; color: var(--ink-3, #7c7c86); margin: 0; }

/* ---------- Toggle switch ---------- */
.cc-switch { flex: none; position: relative; width: 46px; height: 27px; margin-top: 2px; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--surface, #1c1c22); border: 1px solid var(--line, rgba(255,255,255,0.14));
  transition: background .2s ease, border-color .2s ease;
}
.cc-track::after {
  content: ""; position: absolute; top: 50%; left: 3px; transform: translateY(-50%);
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--ink-3, #8a8a92);
  transition: transform .22s var(--ease-out, ease), background .2s ease;
}
.cc-switch input:checked + .cc-track { background: var(--accent, #9b6bd2); border-color: transparent; }
.cc-switch input:checked + .cc-track::after { transform: translate(19px, -50%); background: #fff; }
.cc-switch input:focus-visible + .cc-track { outline: 2px solid var(--accent-2, #c79be8); outline-offset: 2px; }
.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch input:disabled + .cc-track { opacity: 0.65; }
.cc-switch input:disabled:checked + .cc-track { background: color-mix(in srgb, var(--accent, #9b6bd2) 55%, var(--surface, #15151a)); }

.cc-panel-foot {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 18px 24px 22px;
  border-top: 1px solid var(--line-2, rgba(255,255,255,0.07));
}
.cc-panel-foot .cc-btn { flex: 1 1 160px; }

/* ---------- Footer re-open link ---------- */
.cc-reopen { background: none; border: none; padding: 0; font: inherit; cursor: pointer; }

@media (max-width: 540px) {
  .cc-actions { flex-direction: column; }
  .cc-actions .cc-btn { width: 100%; }
  .cc-panel-foot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-scrim, .cc-panel, .cc-btn { transition: none !important; }
}
