/* =====================================================================
   EDERLÉ FORMATION — CMP (Consent Management Platform)
   Bandeau + modale de consentement aux cookies.
   Conforme CNIL : boutons accept/refuse/customize au même poids visuel.
   Tokens hérités de vitrine.css (--emerald, --lime, --orange, --cream...).
   ===================================================================== */

/* --- Lock scroll quand la modale est ouverte ----------------------- */
html.efv-cmp-modal-open,
html.efv-cmp-modal-open body { overflow: hidden; }

/* =====================================================================
   BANDEAU (niveau 1)
   ===================================================================== */
.efv-cmp-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9000;
  background: var(--charcoal, #1A1A1A);
  color: #fff;
  padding: 20px 24px;
  border-top: 3px solid var(--lime, #C8E64A);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
  font-family: var(--font-body, 'DM Sans', 'Segoe UI', sans-serif);
  animation: efv-cmp-slide-up 0.35s ease-out;
}

@keyframes efv-cmp-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.efv-cmp-banner[hidden] { display: none; }

.efv-cmp-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

.efv-cmp-banner__body { padding-right: 16px; }

.efv-cmp-banner__title {
  display: block;
  font-family: var(--font-heading, 'Bebas Neue', sans-serif);
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--lime, #C8E64A);
  margin: 0 0 6px;
}

.efv-cmp-banner__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}

.efv-cmp-banner__link {
  color: var(--lime, #C8E64A);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.efv-cmp-banner__link:hover { color: #fff; }

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

.efv-cmp-banner__close {
  position: absolute;
  top: 10px; right: 12px;
  width: 32px; height: 32px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.efv-cmp-banner__close:hover,
.efv-cmp-banner__close:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: 2px solid var(--lime, #C8E64A);
  outline-offset: 2px;
}

/* =====================================================================
   BOUTONS CMP — CNIL : même taille, même poids
   ===================================================================== */
.efv-cmp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 160px;
  padding: 12px 22px;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.efv-cmp-btn:focus-visible {
  outline: 3px solid var(--lime, #C8E64A);
  outline-offset: 2px;
}

/* « Tout accepter » : couleur primaire */
.efv-cmp-btn--accept {
  background: var(--lime, #C8E64A);
  color: var(--emerald, #0A3D2F);
  border-color: var(--lime, #C8E64A);
}
.efv-cmp-btn--accept:hover {
  background: #d9f06b;
  border-color: #d9f06b;
  color: var(--emerald, #0A3D2F);
}

/* « Tout refuser » : outline blanc — MÊME taille, MÊME poids, contraste équivalent */
.efv-cmp-btn--reject {
  background: transparent;
  color: #fff;
  border-color: #fff;
}
.efv-cmp-btn--reject:hover {
  background: #fff;
  color: var(--charcoal, #1A1A1A);
}

/* « Personnaliser » : outline (sur fond sombre) */
.efv-cmp-btn--customize {
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.55);
}
.efv-cmp-btn--customize:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  color: #fff;
}

/* Variantes sur fond clair (modale) */
.efv-cmp-btn--accept-light {
  background: var(--emerald, #0A3D2F);
  color: #fff;
  border-color: var(--emerald, #0A3D2F);
}
.efv-cmp-btn--accept-light:hover {
  background: var(--emerald-light, #12664E);
  border-color: var(--emerald-light, #12664E);
}

.efv-cmp-btn--save {
  background: var(--orange, #F26522);
  color: #fff;
  border-color: var(--orange, #F26522);
}
.efv-cmp-btn--save:hover {
  background: var(--orange-light, #FF8A50);
  border-color: var(--orange-light, #FF8A50);
}

/* =====================================================================
   MODALE (niveau 2)
   ===================================================================== */
.efv-cmp-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.efv-cmp-modal[hidden] { display: none; }

.efv-cmp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: efv-cmp-fade-in 0.25s ease-out;
}

@keyframes efv-cmp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.efv-cmp-modal__dialog {
  position: relative;
  background: var(--cream, #FAF7F2);
  color: var(--charcoal, #1A1A1A);
  max-width: 640px;
  width: 100%;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  border-top: 4px solid var(--lime, #C8E64A);
  animation: efv-cmp-pop-in 0.3s ease-out;
}

@keyframes efv-cmp-pop-in {
  from { transform: translateY(20px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.efv-cmp-modal__header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--sand, #EDE8DF);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.efv-cmp-modal__title {
  font-family: var(--font-heading, 'Bebas Neue', sans-serif);
  font-size: 26px;
  letter-spacing: 2px;
  color: var(--emerald, #0A3D2F);
  margin: 0;
}

.efv-cmp-modal__close {
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--slate, #4A5568);
  color: var(--charcoal, #1A1A1A);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.efv-cmp-modal__close:hover,
.efv-cmp-modal__close:focus-visible {
  background: var(--charcoal, #1A1A1A);
  color: #fff;
  outline: 2px solid var(--lime, #C8E64A);
  outline-offset: 2px;
}

.efv-cmp-modal__body {
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.efv-cmp-modal__intro {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--slate, #4A5568);
}

/* =====================================================================
   CATÉGORIES
   ===================================================================== */
.efv-cmp-cat {
  padding: 16px 0;
  border-bottom: 1px solid var(--sand, #EDE8DF);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: flex-start;
}
.efv-cmp-cat:last-child { border-bottom: 0; }

.efv-cmp-cat__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.efv-cmp-cat__title {
  font-family: var(--font-heading, 'Bebas Neue', sans-serif);
  font-size: 17px;
  letter-spacing: 1.5px;
  color: var(--emerald, #0A3D2F);
  margin: 0;
}

.efv-cmp-cat__badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--lime, #C8E64A);
  color: var(--emerald, #0A3D2F);
}

.efv-cmp-cat__desc {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--slate, #4A5568);
}

.efv-cmp-cat__more {
  font-size: 12px;
  color: var(--emerald, #0A3D2F);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.efv-cmp-cat__more:hover { color: var(--orange, #F26522); }

/* =====================================================================
   SWITCH (interrupteur ARIA)
   ===================================================================== */
.efv-cmp-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  background: var(--slate, #4A5568);
  border: 2px solid var(--slate, #4A5568);
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.efv-cmp-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.efv-cmp-switch[aria-checked="true"],
.efv-cmp-switch.is-on {
  background: var(--emerald, #0A3D2F);
  border-color: var(--emerald, #0A3D2F);
}
.efv-cmp-switch[aria-checked="true"]::before,
.efv-cmp-switch.is-on::before {
  transform: translateX(24px);
}

.efv-cmp-switch[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
  background: var(--green, #38A169);
  border-color: var(--green, #38A169);
}

.efv-cmp-switch:focus-visible {
  outline: 3px solid var(--lime, #C8E64A);
  outline-offset: 2px;
}

/* Texte visuellement masqué (label SR) */
.efv-cmp-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =====================================================================
   FOOTER DE LA MODALE
   ===================================================================== */
.efv-cmp-modal__footer {
  padding: 18px 28px 24px;
  border-top: 1px solid var(--sand, #EDE8DF);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  background: #fff;
}

/* =====================================================================
   MOBILE (≤ 640px)
   ===================================================================== */
@media (max-width: 640px) {
  .efv-cmp-banner {
    padding: 18px 16px 18px;
  }
  .efv-cmp-banner__inner {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .efv-cmp-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .efv-cmp-btn {
    width: 100%;
    min-width: 0;
  }
  .efv-cmp-banner__close {
    top: 8px; right: 8px;
  }

  .efv-cmp-modal { padding: 0; }
  .efv-cmp-modal__dialog {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-top: 0;
  }
  .efv-cmp-modal__footer {
    flex-direction: column-reverse;
  }
  .efv-cmp-modal__footer .efv-cmp-btn { width: 100%; }
}

/* =====================================================================
   prefers-reduced-motion
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .efv-cmp-banner,
  .efv-cmp-modal__backdrop,
  .efv-cmp-modal__dialog {
    animation: none !important;
  }
  .efv-cmp-switch,
  .efv-cmp-switch::before,
  .efv-cmp-btn {
    transition: none !important;
  }
}
