/* Couche d'arrière-plan translucide commune aux popups légales */
.popup-legal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(15, 66, 135, 0.45);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10000;
}

/* État actif : l'overlay devient interactif et visible */
.popup-legal.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Conteneur de contenu avec animation scale/fade */
.popup-legal-content {
  background: #ffffff;
  color: #0f4287;
  border-radius: 16px;
  padding: 2.25rem 2rem;
  width: min(700px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 18px 40px rgba(15, 66, 135, 0.25);
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Animation d'apparition alignée sur le design des autres modales */
.popup-legal.is-active .popup-legal-content {
  transform: scale(1);
  opacity: 1;
}

/* Bouton de fermeture dans l’angle supérieur droit */
.popup-legal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: #0f4287;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.2s ease;
}

.popup-legal-close:hover {
  transform: scale(1.1);
}

/* Zone de contenu textuel */
#popup-legal-body {
  display: grid;
  gap: 1rem;
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.65;
  font-size: 0.98rem;
}

#popup-legal-body h2,
#popup-legal-body h3 {
  margin: 0;
  color: #0f4287;
  font-size: 1.4rem;
}

#popup-legal-body h4 {
  margin: 1rem 0 0.5rem;
  color: #0f4287;
  font-size: 1.1rem;
}

#popup-legal-body p,
#popup-legal-body ul,
#popup-legal-body ol {
  margin: 0;
  color: #19325f;
}

#popup-legal-body a {
  color: #0f4287;
  font-weight: 600;
  text-decoration: underline;
}

/* Scroll personnalisé */
.popup-legal-content::-webkit-scrollbar {
  width: 8px;
}

.popup-legal-content::-webkit-scrollbar-thumb {
  background-color: rgba(15, 66, 135, 0.3);
  border-radius: 10px;
}

@media (max-width: 600px) {
  .popup-legal {
    padding: 1.5rem;
  }

  .popup-legal-content {
    padding: 1.75rem 1.5rem;
  }
}
