/* ==========================================================================
   MODALE POP-UP : MENTIONS LÉGALES & POLITIQUE DE CONFIDENTIALITÉ (Option A)
   Happy Facilitation — Design Sobre, Accessible & Épuré
   ========================================================================== */

/* Arrière-plan sombre avec flou d'arrière-plan (Backdrop) */
.legal-modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 35, 18, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.26s ease, visibility 0.26s ease;
}

.legal-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Boîte de dialogue centrée */
.legal-modal-dialog {
  background: #FFFFFF;
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-light, #E2ECE2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.legal-modal-backdrop.active .legal-modal-dialog {
  transform: scale(1) translateY(0);
}

/* En-tête fixe avec titre et bouton de fermeture */
.legal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-light, #E2ECE2);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.legal-modal-header-text {
  padding-right: 1rem;
}

.legal-modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--vert-foncé, #165319);
  line-height: 1.25;
  margin: 0 0 0.25rem 0;
}

.legal-modal-subtitle {
  font-size: 0.92rem;
  color: var(--texte-muted, #415743);
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

/* Bouton de fermeture croix (WCAG 2.5.5 Touch Target) */
.legal-modal-close {
  background: #F1F8F1;
  border: 1px solid #D8EADB;
  color: var(--vert-foncé, #165319);
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.legal-modal-close svg {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}

.legal-modal-close:hover {
  background: var(--vert-moyen, #258C21);
  color: #FFFFFF;
  border-color: var(--vert-moyen, #258C21);
}

.legal-modal-close:active {
  transform: scale(0.94);
}

.legal-modal-close:focus-visible {
  outline: 2px solid var(--vert-moyen, #258C21);
  outline-offset: 3px;
}

/* Corps défilable de la modale */
.legal-modal-body {
  padding: 2rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  background-color: var(--fond-alt, #F9FAF9);
}

/* Cartes des mentions */
.legales-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light, #E2ECE2);
  border-radius: var(--radius-md, 16px);
  padding: 1.8rem 2rem;
  box-shadow: var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.04));
  transition: box-shadow 0.2s ease;
}

.legales-card:hover {
  box-shadow: var(--shadow-card, 0 8px 30px rgba(27, 94, 32, 0.08));
}

.legales-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light, #E2ECE2);
}

.legales-card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--vert-très-clair, #F1F8F1);
  color: var(--vert-moyen, #258C21);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  flex-shrink: 0;
}

.legales-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--vert-foncé, #165319);
  margin: 0;
}

.legales-card-body p {
  color: var(--texte, #1F3320);
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.legales-card-body p:last-child {
  margin-bottom: 0;
}

.legales-card-body strong {
  color: var(--vert-foncé, #165319);
  font-weight: 700;
}

.legales-card-body a {
  color: var(--vert-moyen, #258C21);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.legales-card-body a:hover {
  color: var(--vert-hover, #1c7219);
}

.legales-card-body ul {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.legales-card-body li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--texte, #1F3320);
}

.legales-card-body li::before {
  content: "•";
  position: absolute;
  left: 0.3rem;
  color: var(--vert-moyen, #258C21);
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1;
}

/* Pied de la modale */
.legal-modal-footer {
  padding: 1.1rem 2rem;
  background: #FFFFFF;
  border-top: 1px solid var(--border-light, #E2ECE2);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.legal-modal-footer .btn-action-vert {
  padding: 0.65rem 1.6rem;
  font-size: 0.95rem;
}

/* ==========================================================================
   RESPONSIVE MODALE (Mobiles & Petits Écrans)
   ========================================================================== */
@media (max-width: 640px) {
  .legal-modal-backdrop {
    padding: 0.75rem;
  }

  .legal-modal-dialog {
    max-height: 92vh;
    border-radius: 18px;
  }

  .legal-modal-header {
    padding: 1.1rem 1.25rem;
  }

  .legal-modal-title {
    font-size: 1.18rem;
  }

  .legal-modal-subtitle {
    font-size: 0.84rem;
  }

  .legal-modal-close {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .legal-modal-close svg {
    width: 16px;
    height: 16px;
  }

  .legal-modal-body {
    padding: 1.25rem 1rem;
    gap: 1.25rem;
  }

  .legales-card {
    padding: 1.4rem 1.15rem;
    border-radius: 14px;
  }

  .legales-card-title {
    font-size: 1.1rem;
  }

  .legales-card-body p,
  .legales-card-body li {
    font-size: 0.92rem;
  }

  .legal-modal-footer {
    padding: 0.9rem 1.25rem;
  }

  .legal-modal-footer .btn-action-vert {
    width: 100%;
    text-align: center;
  }
}
