/**
 * @file
 * Skin V3 du bandeau CNIL (module contrib eu_cookie_compliance).
 * Surcharge css/eu_cookie_compliance.css (bg gradient.png + texte blanc,
 * boutons gris dégradé). Le module génère ce markup en JS (voir
 * js/eu_cookie_compliance.min.js) : pas de template Twig à surcharger,
 * uniquement du CSS ciblant les classes stables du module.
 */

/* ── Bandeau ─────────────────────────────────────────────────────────────── */

#sliding-popup {
  background: var(--tw-color-surface-highest);
  border-top: 1px solid var(--tw-color-outline-low);
  box-shadow: 0 -2px 8px 0 rgba(0, 0, 0, 0.12);
}

.eu-cookie-compliance-banner {
  padding: var(--tw-spacing-spa-sd) var(--tw-spacing-spa-sd);
}

.eu-cookie-compliance-content {
  max-width: 960px;
}

/* ── Message ─────────────────────────────────────────────────────────────── */

.eu-cookie-compliance-message {
  max-width: 100%;
}

.eu-cookie-compliance-message h1,
.eu-cookie-compliance-message h2,
.eu-cookie-compliance-message h3,
.eu-cookie-compliance-message p,
.eu-cookie-compliance-message button {
  color: var(--tw-color-content-main-alt);
  font-family: var(--tw-font-ff-body);
  text-shadow: none;
}

.eu-cookie-compliance-message h2 {
  font-family: var(--tw-font-ff-heading);
  font-weight: 700;
  font-size: var(--tw-text-fs-sd);
  line-height: var(--tw-text-fs-sd--line-height);
}

.eu-cookie-compliance-message p {
  font-size: var(--tw-text-fs-sm);
}

/* "More info" — lien texte, pas un bouton dégradé.
   Blanc : le bouton s'affiche sur le fond uno (c1-500) du bandeau, un texte
   sombre y est illisible. */
.eu-cookie-compliance-message .eu-cookie-compliance-more-button {
  color: var(--tw-color-surface-highest);
  font-family: var(--tw-font-ff-body);
  font-size: var(--tw-text-fs-sm);
  text-decoration: underline;
}

.eu-cookie-compliance-message .eu-cookie-compliance-more-button:hover {
  color: var(--tw-color-c1-25);
}

/* ── Catégories ──────────────────────────────────────────────────────────── */

.eu-cookie-compliance-categories {
  border-top: 1px solid var(--tw-color-outline-low);
}

.eu-cookie-compliance-category-description {
  color: var(--tw-color-content-complement);
  font-family: var(--tw-font-ff-body);
  font-size: var(--tw-text-fs-sm);
  margin: 2px 0 var(--tw-spacing-spa-xs) 32px;
}

.eu-cookie-compliance-category > div {
  position: relative;
  display: flex;
  align-items: center;
}

.eu-cookie-compliance-category label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding-left: 32px;
  color: var(--tw-color-content-main-alt);
  font-family: var(--tw-font-ff-body);
  font-size: var(--tw-text-fs-sd);
  line-height: var(--tw-text-fs-sd--line-height);
  cursor: pointer;
}

/* Case native masquée visuellement, alignée sous la boîte custom (::before) —
   reste au clavier/lecteur d'écran, le label{for} pilote le clic. */
.eu-cookie-compliance-category-checkbox {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

/* Boîte — même tracé que components/atoms/checkbox/checkbox.css */
.eu-cookie-compliance-category label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  border: 2px solid var(--tw-color-content-main-alt);
  border-radius: 4px;
  background-color: var(--tw-color-surface-highest);
  transition: background-color 150ms, border-color 150ms;
}

.eu-cookie-compliance-category-checkbox:checked + label::before {
  border-color: var(--tw-color-surface-highest);
  background-color: transparent;
}

.eu-cookie-compliance-category-checkbox:focus-visible + label::before {
  box-shadow: 0 0 0 2px var(--tw-color-surface-highest), 0 0 0 4px var(--tw-color-surface-action-uno);
}

/* Coche blanche (checked) */
.eu-cookie-compliance-category label::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 50%;
  width: 4px;
  height: 8px;
  border: 2px solid var(--tw-color-surface-highest);
  border-top: none;
  border-left: none;
  transform: translateY(-65%) rotate(45deg);
  opacity: 0;
  transition: opacity 100ms;
}

.eu-cookie-compliance-category-checkbox:checked + label::after {
  opacity: 1;
}

/* ── Boutons ─────────────────────────────────────────────────────────────── */

.eu-cookie-compliance-buttons,
.eu-cookie-compliance-categories-buttons {
  display: flex;
  gap: var(--tw-spacing-spa-xs);
  align-items: center;
}

.eu-cookie-compliance-banner button {
  box-shadow: none;
  background-image: none;
  text-shadow: none;
  border-radius: var(--tw-radius-full);
  font-family: var(--tw-font-ff-click);
  font-weight: 600;
  letter-spacing: var(--tw-tracking-ls-md);
  cursor: pointer;
  transition: background-color 150ms, border-color 150ms, color 150ms;
}

/* Modèle "outline-uno" (components/atoms/button/button.twig) pour tous les
   boutons du bandeau : "OK, tout accepter" / "Tout supprimer" / "Sauver mes
   préférences". */
.eu-cookie-compliance-default-button,
.eu-cookie-withdraw-button,
.eu-cookie-compliance-save-preferences-button {
  border: 1px solid var(--tw-color-surface-action-uno);
  padding: var(--tw-spacing-spa-xs) var(--tw-spacing-spa-sd);
  background-color: var(--tw-color-surface-highest);
  color: var(--tw-color-content-uno);
}

.eu-cookie-compliance-default-button:hover,
.eu-cookie-withdraw-button:hover,
.eu-cookie-compliance-save-preferences-button:hover {
  background-color: var(--tw-color-c1-25);
}

.eu-cookie-compliance-banner button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--tw-color-surface-highest), 0 0 0 4px var(--tw-color-c1-200);
}

/* Onglet "Cookies" (ré-ouverture du bandeau) */
.eu-cookie-withdraw-tab {
  border: none;
  background-color: var(--tw-color-surface-action-uno);
  color: var(--tw-color-surface-highest);
  font-family: var(--tw-font-ff-click);
  font-size: var(--tw-text-fs-sm);
}

@media screen and (max-width: 600px) {
  .eu-cookie-compliance-buttons,
  .eu-cookie-compliance-categories-buttons {
    flex-wrap: wrap;
  }
}
