/* ==========================================================================
   WpointM — habillage et animations
   Charte imposée : vert #05512B / #00491F, rouge #FF2C00, police BrownPro.
   Toutes les animations sont neutralisées si prefers-reduced-motion.
   ========================================================================== */

:root {
  --wpm-red: #ff2c00;
  --wpm-green-deep: #00491f;
  --wpm-ease: cubic-bezier(0.16, 1, 0.3, 1); /* expo.out : entrées franches */
  --wpm-fast: 180ms;
}

/* --------------------------------------------------------------------------
   1. Bandeau de lettres défilant (décoratif, aria-hidden dans le HTML)
   -------------------------------------------------------------------------- */
.wpm-marquee {
  position: relative;
  overflow: hidden;
  padding: clamp(10px, 2.2vw, 18px) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  /* fondu sur les bords : le ruban entre et sort sans coupure nette */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  animation: wpm-fade 700ms var(--wpm-ease) backwards;
}

.wpm-marquee-track {
  display: flex;
  width: max-content;
  /* deux exemplaires identiques : -50% ramène exactement le second sur le
     premier, la boucle est donc invisible quelles que soient les largeurs */
  animation: wpm-slide 48s linear infinite;
}

/* <picture> est un conteneur inline par défaut : sans ça il introduit un
   espace parasite entre les deux exemplaires et casse la jointure. */
.wpm-marquee-track picture {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
}

.wpm-marquee-img {
  display: block;
  height: clamp(42px, 8.5vw, 70px);
  width: auto;
  max-width: none; /* neutralise le max-width:100% de foundation */
}

@keyframes wpm-slide {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* pause au survol : laisse le temps de lire le lettrage */
.wpm-marquee:hover .wpm-marquee-track {
  animation-play-state: paused;
}

/* --------------------------------------------------------------------------
   2. Entrées en scène (CSS pur : reste visible même sans JS)
   -------------------------------------------------------------------------- */
@keyframes wpm-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes wpm-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* fill "backwards" et non "both" : l'état masqué ne s'applique que pendant le
   délai. Si l'animation ne tourne jamais (moteur ancien, impression, onglet
   jamais peint), l'élément reste dans son état naturel donc visible. */
.title,
img.image,
.content,
.footer {
  animation: wpm-rise 560ms var(--wpm-ease) backwards;
}

.title           { animation-delay: 80ms; }
img.image        { animation-delay: 180ms; }
.content         { animation-delay: 280ms; }
.content + .content { animation-delay: 360ms; }
.footer          { animation-delay: 460ms; }

/* --------------------------------------------------------------------------
   3. Accroche : taille fluide calée sur le nombre de lignes voulu.
      19 px sur mobile (3 lignes) -> 22 px dès 1024 px (2 lignes).
   -------------------------------------------------------------------------- */
.wpm-tagline {
  font-size: clamp(1.1875rem, 0.9rem + 0.8vw, 1.375rem);
  line-height: 1.3;
  display: inline-block;
  text-wrap: balance;
}

@media screen and (max-width: 20em) {
  .wpm-tagline { font-size: 1rem; }
}

/* Rythme vertical : le gabarit Warner réserve 30px fixes, trop lâche sur
   mobile où la hauteur d'écran est comptée. */
@media screen and (max-width: 39.9375em) {
  .grid-x.padding-large-vertical {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .margin-large-bottom {
    margin-bottom: 1rem;
  }
}

/* --------------------------------------------------------------------------
   4. Logo généré : fondu enchaîné au changement d'initiales
   -------------------------------------------------------------------------- */
img.image {
  transition: opacity 240ms var(--wpm-ease);
}

img.image.wpm-swapping {
  opacity: 0;
}

/* --------------------------------------------------------------------------
   5. Formulaire — regroupement visuel et confort tactile
   -------------------------------------------------------------------------- */
form[data-wmgsdk-form] {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: clamp(16px, 3vw, 24px);
}

/* Uniquement les intitulés de champ : cibler tous les <label> mettrait aussi
   le texte de consentement en majuscules, illisible sur un paragraphe. */
form[data-wmgsdk-form] [data-wmgsdk-field] > label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 6px;
}

/* Mentions de consentement : phrase longue, donc casse et taille normales. */
form[data-wmgsdk-form] [data-wmgsdk-optin] label {
  font-size: 0.8rem;
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
  opacity: 0.72;
}

/* Resserre le bloc consentement + mentions RGPD, trop aéré par défaut. */
form[data-wmgsdk-form] [data-wmgsdk-optin-container] {
  margin-top: 4px;
}

form[data-wmgsdk-form] .wmgsdk-optinsimple-prompt,
form[data-wmgsdk-form] .wmgsdk-optinsimple-prompt + div {
  margin-top: 0;
}

form[data-wmgsdk-form] p {
  font-size: 0.8rem;
  line-height: 1.45;
  opacity: 0.72;
  margin-bottom: 0.6rem;
}

/* 48px : au-dessus du minimum tactile de 44px (39px auparavant) */
form[data-wmgsdk-form] input[type="text"],
form[data-wmgsdk-form] input[type="email"],
form[data-wmgsdk-form] input[type="tel"],
form[data-wmgsdk-form] select {
  height: 48px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 6px;
  box-shadow: none;
  transition: border-color var(--wpm-fast) ease-out,
              box-shadow var(--wpm-fast) ease-out;
}

form[data-wmgsdk-form] input:focus,
form[data-wmgsdk-form] select:focus {
  border-color: var(--wpm-red);
  box-shadow: 0 0 0 3px rgba(255, 44, 0, 0.28);
  outline: none;
}

/* le focus clavier reste visible même hors champ de saisie */
form[data-wmgsdk-form] :focus-visible {
  outline: 2px solid var(--wpm-red);
  outline-offset: 2px;
}

/* Le conteneur du bouton hérite d'un rembourrage du gabarit Warner qui
   laissait 62px de vide au bas du panneau. */
form[data-wmgsdk-form] .wmgsdk-button {
  padding-bottom: 0;
  margin-bottom: 0;
}

form[data-wmgsdk-form] > *:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   6. Bouton principal — unique CTA de la page
      Fond blanc conservé : contraste maximal avec le texte noir (21:1).
   -------------------------------------------------------------------------- */
button.button {
  width: 100%;
  min-height: 52px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform var(--wpm-fast) var(--wpm-ease),
              box-shadow var(--wpm-fast) ease-out,
              background-color var(--wpm-fast) ease-out;
}

button.button:hover:not([disabled]) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

button.button:active:not([disabled]) {
  transform: scale(0.975);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

button.button[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

/* indicateur d'attente pendant la génération / l'envoi */
.wpm-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 9px;
  vertical-align: -2px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: wpm-spin 700ms linear infinite;
}

@keyframes wpm-spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   7. Message de statut sous le bouton
   -------------------------------------------------------------------------- */
.wpm-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  line-height: 1.35;
  min-height: 1.2em;
  opacity: 0.85;
  transition: color var(--wpm-fast) ease-out;
}

.wpm-note.wpm-ok    { color: #8ce8b0; opacity: 1; }
.wpm-note.wpm-error { color: #ffb9a8; opacity: 1; }

/* --------------------------------------------------------------------------
   8. Pied de page — liens légaux plus lisibles
   -------------------------------------------------------------------------- */
.footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity var(--wpm-fast) ease-out;
}

.footer a:hover {
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   9. Respect du réglage système « animations réduites »
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .wpm-marquee,
  .wpm-marquee-track,
  .title,
  img.image,
  .content,
  .footer,
  .wpm-spinner {
    animation: none !important;
  }

  img.image,
  button.button {
    transition: none !important;
  }

  button.button:hover:not([disabled]),
  button.button:active:not([disabled]) {
    transform: none;
  }
}
