/*
 * Backplate Studio — styles du bandeau de consentement et du panneau de
 * préférences. Reprend l'identité du site : fond sombre, typographie Inter,
 * texte blanc/gris clair, angles et espacements cohérents.
 */

:root {
  --cc-surface: #151515;
  --cc-panel: #202020;
  --cc-border: rgba(255, 255, 255, 0.12);
  --cc-text: #ffffff;
  --cc-muted: rgba(255, 255, 255, 0.66);
  --cc-accent: #fdc500;
  --cc-accent-text: #141414;
  --cc-neutral: #3a3a3a;
}

/* ----------------------------- Bandeau ----------------------------- */

.cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--cc-surface);
  border-top: 1px solid var(--cc-border);
  box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.55);
  color: var(--cc-text);
  font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif);
}
.cc-banner[hidden] { display: none; }

.cc-banner__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cc-banner__text {
  flex: 1 1 460px;
  max-width: 680px;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--cc-muted);
}

.cc-inline-link {
  color: var(--cc-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(253, 197, 0, 0.5);
}
.cc-inline-link:hover { border-bottom-color: var(--cc-accent); }

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

.cc-banner__actions .cc-btn {
  min-width: 132px;
  text-align: center;
}

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

.cc-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1;
  padding: 12px 20px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.cc-btn--primary {
  background: var(--cc-accent);
  color: var(--cc-accent-text);
}
.cc-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(253, 197, 0, 0.28); }
.cc-btn--reject {
  background: var(--cc-neutral);
  color: var(--cc-text);
  border-color: rgba(255, 255, 255, 0.22);
}
.cc-btn--reject:hover { background: #474747; transform: translateY(-1px); }
.cc-btn--ghost {
  background: transparent;
  color: var(--cc-text);
  border-color: rgba(255, 255, 255, 0.28);
}
.cc-btn--ghost:hover { background: rgba(255, 255, 255, 0.08); }

.cc-btn:focus-visible,
.cc-inline-link:focus-visible,
.cc-panel__close:focus-visible,
.cc-footer-link:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

/* ----------------------- Panneau de préférences -------------------- */

.cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
  font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif);
}
.cc-overlay[hidden] { display: none; }
.cc-locked .content-viewport { overflow: hidden; }

.cc-panel {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--cc-panel);
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  padding: 26px 26px 22px;
  color: var(--cc-text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

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

.cc-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.cc-panel__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0;
}
.cc-panel__close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--cc-border);
  background: transparent;
  color: var(--cc-text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease;
}
.cc-panel__close:hover { background: rgba(255, 255, 255, 0.08); }

.cc-panel__intro {
  margin: 12px 0 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--cc-muted);
}

.cc-cats { list-style: none; margin: 0 0 20px; padding: 0; }

.cc-cat {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--cc-border);
}
.cc-cat:last-child { border-bottom: 1px solid var(--cc-border); }

.cc-cat__info { flex: 1 1 auto; }
.cc-cat__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cc-text);
}
.cc-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--cc-accent);
  border: 1px solid rgba(253, 197, 0, 0.4);
  border-radius: 999px;
  padding: 2px 8px;
}
.cc-cat__desc {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--cc-muted);
  max-width: 380px;
}

/* Interrupteurs */

.cc-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  margin-top: 2px;
}
.cc-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch__track {
  position: absolute;
  inset: 0;
  background: #454545;
  border-radius: 999px;
  transition: background 0.18s ease;
  pointer-events: none;
}
.cc-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.18s ease;
}
.cc-switch input:checked + .cc-switch__track { background: var(--cc-accent); }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(20px); }
.cc-switch input:disabled + .cc-switch__track { opacity: 0.55; }
.cc-switch input:focus-visible + .cc-switch__track {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

.cc-panel__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 4px;
}
.cc-panel__policy {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--cc-muted);
}

/* --------------------- Emplacement réservé (embed) ----------------- */

.cc-gated { visibility: hidden; }

.cc-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: var(--cc-panel);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif);
}
.cc-placeholder__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 340px;
}
.cc-placeholder__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cc-accent);
}
.cc-placeholder__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--cc-muted);
}
.cc-placeholder__btn { width: auto; }

/* ------------------ Lien « Gestion des cookies » ------------------- */

.cc-footer-policy,
.cc-footer-link {
  display: block;
  margin: 3px auto 0;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.cc-footer-policy:hover,
.cc-footer-link:hover { color: #ffffff; }
.cc-footer-policy:focus-visible { outline: 2px solid var(--cc-accent); outline-offset: 2px; }

/* ----------------------- Pages légales (FR/EN) --------------------- */

.legal-canvas { padding: 0; }

.legal-doc {
  width: 744px;
  margin: 118px auto 0;
  padding: 38px 42px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif);
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
}
.legal-doc h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; color: #ffffff; }
.legal-doc h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin: 24px 0 8px;
  color: #ffffff;
}
.legal-doc p { margin: 0 0 10px; }
.legal-doc ul { margin: 0 0 10px; padding-left: 20px; }
.legal-doc li { margin-bottom: 4px; }
.legal-doc a { color: var(--cc-accent); text-decoration: none; border-bottom: 1px solid rgba(253, 197, 0, 0.5); }
.legal-doc a:hover { border-bottom-color: var(--cc-accent); }
.legal-meta { font-size: 12px; color: var(--cc-muted); margin-bottom: 22px; }
.legal-todo { color: var(--cc-muted); font-style: italic; }
.legal-links { margin-top: 26px; margin-bottom: 0; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.legal-copyright { text-align: center; margin: 36px auto 70px; }

/* ------------------------------- Mobile ---------------------------- */

@media (max-width: 768px) {
  .cc-banner__inner {
    flex-direction: column;
    align-items: stretch;
    padding: 18px 18px 20px;
    gap: 16px;
  }
  .cc-banner__text { flex: 1 1 auto; font-size: 12.5px; }
  .cc-banner__actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .cc-btn { width: 100%; text-align: center; }

  .cc-panel { padding: 20px 18px 18px; }
  .cc-panel__actions { flex-direction: column-reverse; }
  .cc-panel__actions .cc-btn { width: 100%; }
  .cc-cat__desc { max-width: none; }

  .legal-doc { width: auto; margin: 90px 16px 0; padding: 24px 20px; }
  .legal-copyright { margin: 28px 16px 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-btn,
  .cc-switch__track,
  .cc-switch__track::after,
  .cc-panel__close { transition: none; }
}
