/* ============================================================
   #POURQUITUVOTES — Cookie Consent CMP (CNIL-compliant)
   Charte graphique : Montserrat (titres) + DM Sans (corps)
   Couleurs : --bleu #002395, --bleu-fonce #001a6e
   ============================================================ */

/* --- Banner overlay (centered modal) --- */
.consent-banner-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.consent-banner-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.consent-banner {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 32px 28px;
  max-width: 520px;
  width: calc(100% - 32px);
  text-align: center;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s ease;
}
.consent-banner-overlay--visible .consent-banner {
  transform: translateY(0) scale(1);
}
.consent-banner__brand {
  margin-bottom: 10px;
  text-align: left;
}
.consent-banner__icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
  line-height: 1;
  color: #002395;
}
.consent-banner__title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: #1e293b;
  margin-bottom: 8px;
}
.consent-banner__desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 24px;
}
.consent-banner__desc a {
  color: #002395;
  text-decoration: underline;
}
.consent-banner__actions {
  display: flex;
  gap: 10px;
}

/* --- Buttons (equal visual weight = CNIL) --- */
.consent-btn {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 12px 20px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
  text-align: center;
  line-height: 1.3;
  flex: 1;
}
.consent-btn:active {
  transform: scale(0.97);
}
.consent-btn--refuse {
  background: #fff;
  color: #1e293b;
  border-color: #cbd5e1;
}
.consent-btn--refuse:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.consent-btn--customize {
  background: #fff;
  color: #002395;
  border-color: #002395;
}
.consent-btn--customize:hover {
  background: #f0f4ff;
}
.consent-btn--accept {
  background: #002395;
  color: #fff;
  border-color: #002395;
}
.consent-btn--accept:hover {
  background: #001a6e;
}
.consent-btn--save {
  background: #002395;
  color: #fff;
  border-color: #002395;
}
.consent-btn--save:hover {
  background: #001a6e;
}

/* --- Modal overlay (personalization) --- */
.consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.consent-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

/* --- Modal card --- */
.consent-modal {
  background: #fff;
  border-radius: 20px;
  max-width: 560px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 32px;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
.consent-overlay--visible .consent-modal {
  transform: translateY(0);
}
.consent-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.consent-modal__title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.consent-modal__title i {
  color: #002395;
  font-size: 1.3rem;
}
.consent-modal__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #64748b;
  transition: background 0.2s;
  flex-shrink: 0;
}
.consent-modal__close:hover {
  background: #e2e8f0;
}
.consent-modal__desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 20px;
}
.consent-modal__desc a {
  color: #002395;
  text-decoration: underline;
}

/* --- Cookie category --- */
.consent-category {
  padding: 16px 0;
  border-top: 1px solid #e2e8f0;
}
.consent-category:last-of-type {
  border-bottom: 1px solid #e2e8f0;
}
.consent-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.consent-category__name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.consent-category__name i {
  color: #002395;
  font-size: 1.1rem;
}
.consent-category__badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 35, 149, 0.08);
  color: #002395;
  margin-left: 8px;
  white-space: nowrap;
}
.consent-category__desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.55;
}

/* --- Toggle switch --- */
.consent-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.consent-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.consent-toggle__track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.consent-toggle__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.consent-toggle input:checked + .consent-toggle__track {
  background: #002395;
}
.consent-toggle input:checked + .consent-toggle__track::after {
  transform: translateX(20px);
}
.consent-toggle input:disabled + .consent-toggle__track {
  background: #10b981;
  opacity: 0.7;
  cursor: not-allowed;
}
.consent-toggle input:disabled + .consent-toggle__track::after {
  transform: translateX(20px);
}

/* --- Modal actions --- */
.consent-modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
}
.consent-modal__actions .consent-btn {
  flex: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .consent-banner {
    padding: 24px 20px;
    max-width: none;
    width: calc(100% - 24px);
    border-radius: 16px;
  }
  .consent-banner__actions {
    flex-direction: column;
  }
  .consent-modal {
    padding: 24px 20px;
    max-height: 85vh;
  }
  .consent-modal__title {
    font-size: 1.1rem;
  }
  .consent-modal__actions {
    flex-direction: column;
  }
}
