/* =================================================================
   WCB — Cookie consent v2 — Max-accept-rate (CNIL-compliant)
   ================================================================= */

/* ============ CONSENT MODAL ============ */
#cc-main .cm,
.cm {
  max-width: 420px !important;
  font-family: Inter, -apple-system, "Segoe UI", sans-serif !important;
  border-radius: 18px !important;
  box-shadow: 0 16px 48px rgba(14, 42, 58, 0.20),
              0 4px 12px rgba(53, 136, 161, 0.10) !important;
  border: 1px solid rgba(53, 136, 161, 0.18) !important;
  padding: 1.3rem 1.4rem 1.1rem !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%) !important;
  animation: wcbCmSlide 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) !important;
}

@keyframes wcbCmSlide {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cm__title {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: #0e2a3a !important;
  margin-bottom: 0.5rem !important;
  font-family: Inter, sans-serif !important;
  letter-spacing: -0.01em !important;
}

.cm__desc {
  font-size: 0.85rem !important;
  color: #4a5568 !important;
  line-height: 1.55 !important;
  margin-bottom: 0.95rem !important;
}

.cm__desc strong {
  color: #0e2a3a !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

.cm__btns {
  gap: 0.55rem !important;
  padding: 0.4rem 0 0 !important;
  flex-wrap: wrap !important;
  align-items: center !important;
}

/* Boutons consent modal — base */
#cc-main .cm__btn,
.cm__btn {
  font-size: 0.88rem !important;
  padding: 0.7rem 1.1rem !important;
  font-weight: 700 !important;
  border-radius: 11px !important;
  transition: transform 0.18s, box-shadow 0.25s, background 0.2s, border-color 0.2s !important;
  letter-spacing: 0.005em !important;
  min-height: 44px !important;
  flex: 1 1 auto !important;
  cursor: pointer !important;
}

/* Accept all — WCB BLEU GRADIENT premium + animation pulse subtile */
#cc-main .cm__btn[data-role="all"],
.cm__btn[data-role="all"],
.cm__btn--primary {
  background: linear-gradient(135deg, #3588A1 0%, #2a6b80 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 5px 18px rgba(53, 136, 161, 0.42),
              inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
  border: none !important;
  font-weight: 800 !important;
  position: relative !important;
  animation: wcbAcceptPulse 2.4s ease-in-out infinite !important;
}

@keyframes wcbAcceptPulse {
  0%, 100% {
    box-shadow: 0 5px 18px rgba(53, 136, 161, 0.42),
                inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }
  50% {
    box-shadow: 0 5px 18px rgba(53, 136, 161, 0.42),
                0 0 0 6px rgba(53, 136, 161, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }
}

#cc-main .cm__btn[data-role="all"]:hover,
.cm__btn[data-role="all"]:hover,
.cm__btn--primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 26px rgba(53, 136, 161, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  animation: none !important;
  background: linear-gradient(135deg, #3a92ad 0%, #2f7388 100%) !important;
}

/* Refuser — outline neutre, même taille mais visuellement secondaire */
.cm__btn[data-role="necessary"],
.cm__btn--secondary {
  background: #ffffff !important;
  color: #6b7280 !important;
  border: 1.5px solid #e5e7eb !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}

.cm__btn[data-role="necessary"]:hover {
  background: #f9fafb !important;
  color: #4b5563 !important;
  border-color: #d1d5db !important;
  transform: translateY(-1px) !important;
}

/* Personnaliser — lien text discret (mais accessible) */
.cm__btn[data-role="show"],
.cm__btn--tertiary {
  background: transparent !important;
  color: #3588A1 !important;
  border: none !important;
  text-decoration: underline !important;
  text-decoration-thickness: 1.5px !important;
  text-underline-offset: 3px !important;
  font-weight: 600 !important;
  padding: 0.45rem 0.6rem !important;
  min-height: auto !important;
  flex: 0 0 auto !important;
  box-shadow: none !important;
  width: 100% !important;
  text-align: center !important;
  margin-top: 0.3rem !important;
}

.cm__btn[data-role="show"]:hover {
  color: #0e2a3a !important;
  text-decoration-thickness: 2px !important;
}

/* Microcopy "modifiable à tout moment" géré dans la description */

/* ============ PREFERENCES MODAL ============ */
.pm {
  font-family: Inter, -apple-system, "Segoe UI", sans-serif !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 70px rgba(14, 42, 58, 0.28) !important;
}

.pm__title {
  font-weight: 800 !important;
  color: #0e2a3a !important;
  font-size: 1.3rem !important;
  letter-spacing: -0.01em !important;
}

.pm__close-btn {
  background: #f3f4f6 !important;
  border-radius: 10px !important;
  width: 36px !important;
  height: 36px !important;
}

.pm__close-btn:hover {
  background: #e5e7eb !important;
}

.pm__section {
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  background: #fafbfc !important;
  margin-bottom: 0.6rem !important;
  transition: border-color 0.2s, background 0.2s !important;
}

.pm__section:hover {
  border-color: rgba(53, 136, 161, 0.25) !important;
  background: #f8fbfc !important;
}

.pm__section-title {
  font-weight: 700 !important;
  color: #0e2a3a !important;
  font-size: 0.97rem !important;
}

.pm__section-desc {
  font-size: 0.86rem !important;
  color: #4a5568 !important;
  line-height: 1.6 !important;
}

.pm__section-desc strong {
  color: #0e2a3a !important;
  font-weight: 700 !important;
}

.pm__badge {
  background: rgba(53, 136, 161, 0.12) !important;
  color: #3588A1 !important;
  border: 1px solid rgba(53, 136, 161, 0.28) !important;
  font-weight: 700 !important;
  font-size: 0.7rem !important;
  padding: 0.2rem 0.5rem !important;
  border-radius: 6px !important;
  margin-left: 0.5rem !important;
  letter-spacing: 0.02em !important;
}

/* Boutons preferences modal */
#cc-main .pm__btn,
.pm__btn {
  font-size: 0.92rem !important;
  padding: 0.75rem 1.2rem !important;
  font-weight: 700 !important;
  border-radius: 11px !important;
  transition: transform 0.18s, box-shadow 0.25s !important;
  letter-spacing: 0.005em !important;
  min-height: 46px !important;
}

/* Accept all (preferences) — WCB BLEU + pulse */
#cc-main .pm__btn[data-role="all"],
.pm__btn[data-role="all"],
.pm__btn--primary {
  background: linear-gradient(135deg, #3588A1 0%, #2a6b80 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 5px 18px rgba(53, 136, 161, 0.42),
              inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
  border: none !important;
  font-weight: 800 !important;
}

.pm__btn[data-role="all"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 26px rgba(53, 136, 161, 0.55) !important;
}

/* Tout rejeter (preferences) — outline neutre */
.pm__btn[data-role="necessary"],
.pm__btn--secondary {
  background: #ffffff !important;
  color: #6b7280 !important;
  border: 1.5px solid #e5e7eb !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}

.pm__btn[data-role="necessary"]:hover {
  background: #f9fafb !important;
  color: #4b5563 !important;
}

/* Sauvegarder — WCB BLEU plein */
.pm__btn[data-role="save"] {
  background: #3588A1 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(53, 136, 161, 0.32) !important;
  border: none !important;
}

.pm__btn[data-role="save"]:hover {
  background: #2a6b80 !important;
  box-shadow: 0 6px 18px rgba(53, 136, 161, 0.45) !important;
}

/* Toggles WCB blue */
.pm__section .pm__toggle input:checked + .pm__toggle-label {
  background: #3588A1 !important;
}

.pm__section .pm__toggle-label {
  background: #d1d5db !important;
  transition: background 0.2s !important;
}

/* Liens internes */
.cc__link,
.pm a,
.cm a {
  color: #3588A1 !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

.cc__link:hover {
  color: #0e2a3a !important;
}

/* ============ RESPONSIVE MOBILE ============ */
@media (max-width: 720px) {
  .cm {
    max-width: calc(100vw - 16px) !important;
    margin: 8px !important;
    padding: 1.1rem 1.2rem !important;
  }
  .cm__title { font-size: 1rem !important; }
  .cm__desc { font-size: 0.83rem !important; }

  /* Sur mobile : Accept en premier (top), Refuser en dessous */
  .cm__btns {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  .cm__btn {
    width: 100% !important;
    flex: 1 1 100% !important;
    order: 0 !important;
  }
  /* Accept en premier visuellement */
  .cm__btn[data-role="all"] { order: -1 !important; }
  /* Personnaliser en dernier */
  .cm__btn[data-role="show"] { order: 99 !important; }

  .pm { max-height: 92vh !important; }
  .pm__title { font-size: 1.15rem !important; }
}


/* ============ DELAY-FRIENDLY INITIAL STATE ============ */
/* Évite le flash + permet le delay 3s contrôlé par JS */
#cc-main {
  transition: opacity 0.5s ease-out !important;
}

/* ============ FOOTER LINK COOKIE MGR ============ */
#wcb-cookie-mgr-link:hover {
  color: #0e2a3a !important;
  border-color: rgba(53, 136, 161, 0.45) !important;
  background: rgba(255, 255, 255, 1) !important;
}

@media (max-width: 720px) {
  #wcb-cookie-mgr-link {
    bottom: 8px !important;
    left: 8px !important;
    font-size: 0.72rem !important;
    padding: 5px 10px !important;
  }
}
