:root {
  --cookie-consent-z-index: 1200;
}

.cookie-consent-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cookie-consent-manage {
  position: fixed;
  right: 1rem;
  left: auto;
  bottom: 1rem;
  z-index: var(--cookie-consent-z-index);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: #025282;
  color: #ffffff;
  font-family: "Sora", "Nunito", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(2, 82, 130, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cookie-consent-manage:hover,
.cookie-consent-manage:focus-visible {
  background: #0d6ab0;
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(2, 82, 130, 0.28);
}

.cookie-consent-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--cookie-consent-z-index) + 1);
  background: rgba(7, 21, 43, 0.46);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cookie-consent-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Pop-up centrée à l'écran (auparavant : barre glissant depuis le bas de la fenêtre). */
.cookie-consent-banner {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: calc(var(--cookie-consent-z-index) + 2);
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  transform: translate(-50%, -50%) scale(0.96);
  opacity: 0;
  border-radius: 20px;
  border: 1px solid rgba(2, 82, 130, 0.14);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 56px rgba(7, 21, 43, 0.18);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.cookie-consent-banner.is-visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.cookie-consent-panel {
  padding: 24px 28px;
}

.cookie-consent-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: #e8f2fc;
  color: #025282;
  font-family: "Sora", "Nunito", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cookie-consent-title {
  margin: 0 0 0.5rem;
  color: #1a1f36;
  font-family: "Nunito", sans-serif;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  font-weight: 900;
  line-height: 1.15;
}

.cookie-consent-copy {
  margin: 0;
  color: #4a5568;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
}

.cookie-consent-copy a {
  color: #025282;
  font-weight: 700;
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.cookie-consent-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 0.95rem;
  font-family: "Sora", "Nunito", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cookie-consent-button:hover,
.cookie-consent-button:focus-visible {
  transform: translateY(-1px);
}

.cookie-consent-button--accept {
  background: #025282;
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(2, 82, 130, 0.22);
}

.cookie-consent-button--reject {
  background: #eef3f8;
  color: #1a1f36;
}

.cookie-consent-button--secondary {
  background: transparent;
  color: #025282;
  border: 1px solid rgba(2, 82, 130, 0.22);
}

.cookie-consent-modal {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: calc(var(--cookie-consent-z-index) + 3);
  width: min(680px, calc(100vw - 2rem));
  transform: translate(-50%, -40%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.cookie-consent-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.cookie-consent-modal-card {
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 28px 60px rgba(7, 21, 43, 0.24);
  overflow: hidden;
}

.cookie-consent-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.5rem 1rem;
  border-bottom: 1px solid #e5e9f2;
}

.cookie-consent-modal-head h2 {
  margin: 0;
  color: #1a1f36;
  font-family: "Nunito", sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
}

.cookie-consent-close {
  appearance: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #eef3f8;
  color: #1a1f36;
  font-size: 1.3rem;
  cursor: pointer;
}

.cookie-consent-modal-body {
  padding: 1.35rem 1.5rem 1.5rem;
}

.cookie-consent-setting {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem 0;
  border-bottom: 1px solid #eef3f8;
}

.cookie-consent-setting:last-of-type {
  border-bottom: 0;
}

.cookie-consent-setting h3 {
  margin: 0 0 0.3rem;
  color: #1a1f36;
  font-family: "Sora", "Nunito", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
}

.cookie-consent-setting p {
  margin: 0;
  color: #4a5568;
  font-family: "Inter", sans-serif;
  font-size: 0.92rem;
  line-height: 1.65;
}

.cookie-consent-switch {
  position: relative;
  display: inline-flex;
  width: 58px;
  height: 34px;
}

.cookie-consent-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.cookie-consent-switch-track {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #d8e0ea;
  transition: background 0.2s ease;
}

.cookie-consent-switch-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 5px 12px rgba(7, 21, 43, 0.16);
  transition: transform 0.2s ease;
}

.cookie-consent-switch input:checked + .cookie-consent-switch-track {
  background: #025282;
}

.cookie-consent-switch input:checked ~ .cookie-consent-switch-thumb {
  transform: translateX(24px);
}

.cookie-consent-switch input:disabled + .cookie-consent-switch-track {
  background: #9fb7cf;
  cursor: not-allowed;
}

.cookie-consent-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.35rem;
}

@media (max-width: 720px) {
  .cookie-consent-banner {
    width: calc(100vw - 1.5rem);
  }

  .cookie-consent-panel,
  .cookie-consent-modal-body,
  .cookie-consent-modal-head {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .cookie-consent-actions,
  .cookie-consent-modal-actions {
    flex-direction: column;
  }

  .cookie-consent-button {
    width: 100%;
  }

  .cookie-consent-manage {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    justify-content: center;
  }

  .cookie-consent-setting {
    grid-template-columns: 1fr;
  }
}
