/* ============================================================
   FORMULAIRE DE CONTACT (le même sur toutes les pages, juste avant
   le pied de page)
   Une carte bleu ciel posée à cheval sur le pied de page bleu (comme
   « Artefacts/slide contact.png »). Texte à gauche, formulaire blanc
   à droite. Pas encore branché (SOP 5) : rien n'est envoyé.
   ============================================================ */
.contact {
  /* Le haut a le fond de la page, le bas est du même bleu
     que le pied de page juste en dessous, avec les mêmes marges de
     10px : la carte a l'air posée sur le pied de page. */
  margin: 0 10px;
  padding: 3rem 1.5rem 0;
  background: linear-gradient(transparent 55%, #1D3FC4 55%);
}
.contact-carte {
  max-width: 1120px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 3.5rem;
  border-radius: 40px;
  background: #D9E2F8;
  display: flex;
  align-items: flex-start;
  gap: 3.5rem;
}
.contact-gauche {
  flex: 1 1 0;
  min-width: 0;
}

/* Le titre « Formulaire de contact », tout en haut à gauche : une
   pastille blanche avec un point rouge et une ombre bleue en dessous
   (comme « Artefacts/Bouton 2 formulaire de contact.png ») */
.contact-pastille {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0;
  padding: 0.45em 1.1em 0.45em 0.9em;
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow: 0 6px 0 #C3CDF2;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1D3FC4;
}
.contact-pastille::before {
  content: "";
  flex: none;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: #DC4B3A;
}
.contact-pastille + .contact-question {
  margin-top: 1.75rem;
}

/* Les 3 étapes de l'audit : un chiffre rouge dans un rond blanc
   (comme « Artefacts/trois boutons contact.png ») */
.contact-etapes {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  font-size: 1.1rem;
  color: #1A1A1A;
}
.contact-etapes li {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.contact-etapes li span {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: #FFFFFF;
  color: #DC4B3A;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}
.contact-etapes p {
  margin: 0;
}
.contact-etapes strong {
  color: #1D3FC4;
}

/* La question au-dessus du grand titre */
.contact-question {
  margin: 0;
  max-width: 22em;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1D3FC4;
}

/* Le grand titre en bleu, sur une seule ligne (il peut passer à la
   ligne sur téléphone) : « gratuit » en blanc dans une étiquette rouge,
   « 12 h » en rouge (comme « Artefacts/audit gratuit.png ») */
.contact-titre {
  margin: 1rem 0 0;
  white-space: nowrap;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1D3FC4;
}
.contact-titre-etiquette {
  padding: 0 0.22em 0.04em;
  border-radius: 0.25em;
  background: #DC4B3A;
  color: #FFFFFF;
}
.contact-titre-rouge {
  color: #DC4B3A;
}

/* WhatsApp, email, Instagram : côte à côte, chacun avec sa petite
   icône devant (comme « Artefacts/bouton message.png ») */
.contact-liens {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
}
.contact-liens a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #1D3FC4;
  text-decoration: none;
}
.contact-liens a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.contact-liens a:focus-visible {
  outline: 3px solid #1D3FC4;
  outline-offset: 3px;
}

/* La carte blanche du formulaire : les 4 champs sur deux colonnes */
.contact-formulaire {
  flex: 0 0 440px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1rem;
  background: #FFFFFF;
  color: #1A1A1A;
  border-radius: 28px;
  padding: 2rem 1.75rem 1.5rem;
  box-shadow: 0 20px 40px rgba(29, 63, 196, 0.12);
}
.contact-champ {
  margin-bottom: 1.1rem;
}
.contact-champ label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.contact-champ input {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 2px solid #E3E8F5;
  border-radius: 12px;
  font: inherit;
  color: #1A1A1A;
  background: #F8FAFE;
}
.contact-champ input:focus-visible,
.contact-champ textarea:focus-visible {
  outline: 3px solid #1D3FC4;
  outline-offset: 1px;
  border-color: #1D3FC4;
}
/* La pastille « Réponse sous 12 h » en haut du formulaire */
.contact-delai {
  grid-column: 1 / -1;
  justify-self: start;
  margin: 0 0 1.25rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: #E8EEFC;
  color: #1D3FC4;
  font-size: 0.9rem;
  font-weight: 700;
}
/* L'astérisque rouge des champs obligatoires */
.contact-champ label span {
  color: #DC3426;
}
/* Le grand champ du message, sur toute la largeur */
.contact-champ-message {
  grid-column: 1 / -1;
}
.contact-champ textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border: 2px solid #E3E8F5;
  border-radius: 12px;
  font: inherit;
  color: #1A1A1A;
  background: #F8FAFE;
  resize: vertical;
}
.contact-champ label small {
  font-size: 0.85rem;
  font-weight: 400;
  color: #6E7487;
}

/* Le bouton rouge du formulaire, sur toute la largeur */
.contact-bouton {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 16px 20px;
  border: 0;
  border-radius: 999px;
  background: #DC3426;
  color: #FFFFFF;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}
.contact-bouton:hover {
  background: #C42B1E;
}
.contact-bouton:focus-visible {
  outline: 3px solid #1D3FC4;
  outline-offset: 3px;
}

/* La phrase sur les données personnelles, sous le bouton */
.contact-rgpd {
  grid-column: 1 / -1;
  margin: 0.9rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #6E7487;
}
.contact-rgpd a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Le bouton réagit : il grossit un peu sous la souris ou la touche Tab,
   et s'enfonce un instant au clic. Miettes bleues sur la carte blanche
   (pour les pages qui ont la morsure « bouton-croque »). */
.contact-bouton {
  position: relative;
  transition: scale 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  --fond-croc: #FFFFFF;
  --miette-croc: #1D3FC4;
}
.contact-bouton:focus-visible {
  scale: 1.03;
}
.contact-bouton:active {
  scale: 0.97;
  transition-duration: 0.1s;
}
@media (hover: hover) {
  .contact-bouton:hover {
    scale: 1.03;
  }
}
@media (prefers-reduced-motion: reduce) {
  .contact-bouton,
  .contact-bouton:hover,
  .contact-bouton:focus-visible,
  .contact-bouton:active {
    scale: none;
    transition: none;
  }
}

/* Petits ordinateurs : un peu moins d'espace pour que le grand titre
   tienne toujours sur une ligne à côté du formulaire */
@media (max-width: 1240px) {
  .contact-carte {
    gap: 2rem;
    padding: 3rem 2.5rem;
  }
  .contact-pastille {
    font-size: 1.35rem;
  }
  .contact-titre {
    font-size: 1.8rem;
  }
}

/* Tablette et téléphone : le formulaire passe sous le texte */
@media (max-width: 1024px) {
  .contact {
    background: linear-gradient(transparent 75%, #1D3FC4 75%);
  }
  .contact-carte {
    flex-direction: column;
    align-items: stretch;
    padding: 2.5rem 2rem;
  }
  .contact-formulaire {
    flex: none;
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
  }
}
@media (max-width: 600px) {
  .contact {
    margin: 0 6px;
    padding: 2rem 0.5rem 0;
  }
  .contact-carte {
    padding: 2rem 1.25rem;
    border-radius: 28px;
  }
  .contact-pastille {
    font-size: 1.1rem;
  }
  .contact-question {
    font-size: 1.3rem;
  }
  .contact-titre {
    white-space: normal;
    font-size: 2rem;
  }
  /* Les champs l'un sous l'autre */
  .contact-formulaire {
    grid-template-columns: 1fr;
    padding: 1.5rem 1.25rem 1.25rem;
  }
}


/* ============================================================
   LE POP-UP « NOUS CONTACTER » (ouvert par popup-contact.js)
   La même carte que le formulaire du bas, par-dessus la page.
   Animation « la bouchée qui s'ouvre » : la carte sort du bouton
   rouge en grandissant, avec un petit rebond, puis le contenu arrive
   en cascade. À la fermeture, l'inverse, en plus rapide.
   Sur téléphone, la carte monte depuis le bas de l'écran.
   ============================================================ */
.popup-contact {
  box-sizing: border-box;
  width: min(980px, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 40px;
  background: #D9E2F8;
  color: #1A1A1A;
  overflow: hidden;
}
/* La page derrière ne défile pas tant que le pop-up est ouvert */
html:has(.popup-contact[open]) {
  overflow: hidden;
}
/* Le fond : bleu nuit translucide, un peu flou */
.popup-contact::backdrop {
  background: rgba(18, 30, 90, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
/* La carte copiée : elle défile à l'intérieur si l'écran est bas */
.popup-contact .contact-carte {
  max-width: none;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 3.75rem 2.75rem 2.75rem;
  gap: 2.25rem;
  border-radius: 0;
}
/* La carte est plus étroite que celle du bas : textes un peu plus petits,
   formulaire un peu plus étroit */
.popup-contact .contact-pastille {
  font-size: 1.25rem;
  white-space: nowrap;
}
.popup-contact .contact-titre {
  white-space: normal;
  font-size: 1.8rem;
}
@media (min-width: 1025px) {
  .popup-contact .contact-formulaire {
    flex-basis: 410px;
  }
}

/* La croix ronde, en haut à droite */
.popup-fermer {
  position: absolute;
  z-index: 1;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #FFFFFF;
  color: #1D3FC4;
  box-shadow: 0 6px 16px rgba(29, 63, 196, 0.18);
  cursor: pointer;
  transition: scale 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.popup-fermer svg {
  width: 20px;
  height: 20px;
}
.popup-fermer:hover {
  scale: 1.08;
}
.popup-fermer:focus-visible {
  outline: 3px solid #1D3FC4;
  outline-offset: 3px;
}

/* ---------- L'ouverture : la carte sort du bouton ---------- */
@keyframes popup-bouchee {
  from { opacity: 0; transform: scale(0.2); border-radius: 120px; }
  to   { opacity: 1; transform: scale(1);   border-radius: 40px; }
}
@keyframes popup-fond-apparait {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.popup-contact[open] {
  animation: popup-bouchee 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.popup-contact[open]::backdrop {
  animation: popup-fond-apparait 0.25s ease-out both;
}

/* ---------- La fermeture : la carte retourne dans le bouton ---------- */
@keyframes popup-bouchee-fin {
  from { opacity: 1; transform: scale(1);   border-radius: 40px; }
  to   { opacity: 0; transform: scale(0.2); border-radius: 120px; }
}
@keyframes popup-fond-disparait {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.popup-contact[open].fermeture {
  animation: popup-bouchee-fin 0.25s cubic-bezier(0.5, 0, 0.75, 0) both;
}
.popup-contact[open].fermeture::backdrop {
  animation: popup-fond-disparait 0.25s ease-in both;
}

/* ---------- Le contenu arrive en cascade, juste après la carte ---------- */
/* « gratuit » : l'étiquette rouge se dessine de gauche à droite.
   Le mot est bleu tant que le rouge n'est pas passé dessous. */
@keyframes popup-surligne {
  from { background-size: 0% 100%;   color: #1D3FC4; }
  to   { background-size: 100% 100%; color: #FFFFFF; }
}
.popup-contact .contact-titre-etiquette {
  background: linear-gradient(#DC4B3A, #DC4B3A) no-repeat 0 0 / 100% 100%;
}
.popup-contact[open] .contact-titre-etiquette {
  animation: popup-surligne 0.4s cubic-bezier(0.6, 0, 0.3, 1) 0.3s both;
}
/* Les pastilles 1, 2, 3 : l'une après l'autre (0,08 s d'écart) */
@keyframes popup-pastille {
  from { opacity: 0; scale: 0.4; }
  to   { opacity: 1; scale: 1; }
}
.popup-contact[open] .contact-etapes li span {
  animation: popup-pastille 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.popup-contact[open] .contact-etapes li:nth-child(1) span { animation-delay: 0.3s; }
.popup-contact[open] .contact-etapes li:nth-child(2) span { animation-delay: 0.38s; }
.popup-contact[open] .contact-etapes li:nth-child(3) span { animation-delay: 0.46s; }
/* Les champs montent de 10 px en fondu, l'un après l'autre,
   puis le bouton rouge arrive en dernier */
@keyframes popup-monte-un-peu {
  from { opacity: 0; translate: 0 10px; }
  to   { opacity: 1; translate: 0 0; }
}
.popup-contact[open] .contact-delai,
.popup-contact[open] .contact-champ,
.popup-contact[open] .contact-bouton {
  animation: popup-monte-un-peu 0.35s ease-out both;
}
.popup-contact[open] .contact-delai { animation-delay: 0.3s; }
.popup-contact[open] .contact-champ:nth-of-type(1) { animation-delay: 0.36s; }
.popup-contact[open] .contact-champ:nth-of-type(2) { animation-delay: 0.42s; }
.popup-contact[open] .contact-champ:nth-of-type(3) { animation-delay: 0.48s; }
.popup-contact[open] .contact-champ:nth-of-type(4) { animation-delay: 0.54s; }
.popup-contact[open] .contact-champ:nth-of-type(5) { animation-delay: 0.6s; }
.popup-contact[open] .contact-bouton { animation-delay: 0.7s; }

/* ---------- Sur téléphone : tout l'écran, la carte monte du bas ---------- */
@keyframes popup-monte {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes popup-descend {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}
@media (max-width: 699px) {
  .popup-contact {
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
  .popup-contact .contact-carte {
    height: 100%;
    max-height: none;
    box-sizing: border-box;
    /* la place de la croix en haut */
    padding: 4.5rem 1.25rem 2rem;
    border-radius: 0;
  }
  .popup-contact[open] {
    animation: popup-monte 0.45s cubic-bezier(0.34, 1.2, 0.64, 1) both;
  }
  .popup-contact[open].fermeture {
    animation: popup-descend 0.25s cubic-bezier(0.5, 0, 0.75, 0) both;
  }
}

/* ---------- Mouvement réduit : un simple fondu, sans zoom ni cascade ---------- */
@media (prefers-reduced-motion: reduce) {
  .popup-contact[open],
  .popup-contact[open]::backdrop {
    animation: popup-fond-apparait 0.15s ease-out both;
  }
  .popup-contact[open].fermeture,
  .popup-contact[open].fermeture::backdrop {
    animation: popup-fond-disparait 0.15s ease-in both;
  }
  .popup-contact[open] .contact-titre-etiquette,
  .popup-contact[open] .contact-etapes li span,
  .popup-contact[open] .contact-delai,
  .popup-contact[open] .contact-champ,
  .popup-contact[open] .contact-bouton {
    animation: none;
  }
}
