/* =====================================================================
   ASSOPERFORM : le mouvement du site (complète site.css, chargé APRÈS lui)
   Fil conducteur : la flèche verte montante du logo. Elle signe
   l'ouverture, accompagne la lecture, s'allume étape par étape et conclut
   dans le pied de page. Les retours au pointeur (boutons, cartes) et à la
   saisie (formulaire) restent discrets.

   Règles :
   - Tout est rattaché à la classe .mouvement posée sur <html> par
     mouvement.js. Sans JavaScript, ou si le visiteur demande moins de
     mouvement, la page reste celle d'avant, complète et immobile.
   - Ce qui suit le pointeur est réservé à la souris (hover: hover et
     pointer: fine) : rien au toucher.
   - Propriétés animées : transform, translate, scale, opacity, clip-path,
     background-position, background-size, et le tracé des petits SVG
     (stroke-dashoffset), déjà présent dans le site.
   ===================================================================== */

:root {
  /* Ressort doux : léger dépassement puis retour au repos. */
  --ressort: cubic-bezier(.34, 1.4, .64, 1);
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ressort: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%,
                      .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.6%, 1);
  }
}

/* ------------------------------------------------ 1. Fil de lecture fléché */
.fil {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  pointer-events: none;
}
.fil__tete {
  position: absolute;
  left: 0; top: -6px;
  width: 15px; height: 15px;
  margin-left: -13px;
  color: var(--vert-500);
  opacity: 0;
  transition: opacity .3s;
}
.fil__tete svg { width: 100%; height: 100%; }
.mouvement .fil__tete.est-visible { opacity: 1; }
.fil__jalon {
  position: absolute;
  top: -2px;
  width: 7px; height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--papier);
  box-shadow: inset 0 0 0 1.5px #b9b2a2;
  transition: background-color .35s, box-shadow .35s, transform .35s var(--courbe);
}
.fil__jalon.est-passe {
  background: var(--vert-500);
  box-shadow: inset 0 0 0 1.5px var(--vert-500), 0 0 0 3px rgba(28, 164, 60, .18);
  transform: scale(1.15);
}

/* ------------------------------------------------ 2. Trajectoires (ouverture et sections)
   La pointe de flèche glisse au bout du trait, orientée selon la courbe,
   allume deux jalons à son passage, puis une onde marque l'arrivée. */
.mouvement .trajectoire__trait { animation: none; }
.mouvement .trajectoire__fleche { display: none; }
.trajectoire__tete {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity .25s;
}
.trajectoire__anneau {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.mouvement .trajectoire.est-arrive .trajectoire__anneau { animation: anneau 1.3s var(--courbe) both; }
@keyframes anneau { from { opacity: .9; transform: scale(.2); } to { opacity: 0; transform: scale(1.6); } }

.trajectoire__jalon {
  fill: var(--jalon-fond, var(--papier));
  stroke: currentColor;
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .35s var(--courbe), transform .5s cubic-bezier(.34, 1.56, .64, 1), fill .35s;
}
.mouvement .trajectoire__jalon.est-franchi { opacity: 1; transform: none; fill: currentColor; }

/* Ouverture : la trajectoire traverse l'accueil, derrière le contenu, du
   bas à gauche vers la lueur verte en haut à droite. Les épaisseurs sont
   ramenées en pixels par le script (le motif est très agrandi ici). */
.motif--hero { display: none; }
.mouvement .motif--hero {
  display: block;
  left: -3%;
  bottom: -8%;
  width: 106%;
  color: rgba(111, 212, 127, .3);
  --jalon-fond: var(--marine-900);
}
.mouvement .motif--hero .trajectoire__pointilles { opacity: .35; }
/* Sur une colonne, le bas de l'accueil est sous la ligne de flottaison :
   le geste se joue en haut, derrière le titre, très atténué (le texte
   blanc garde tout son contraste). */
@media (max-width: 960px) {
  .mouvement .motif--hero { top: 2px; bottom: auto; left: auto; right: -4vw; width: 84vw; color: rgba(111, 212, 127, .22); }
}

/* Sections : la pointe, chute du geste, doit rester à l'écran. */
.motif--appel { --jalon-fond: #1a5a46; }
.mouvement .motif--services { right: 2vw; width: min(40vw, 560px); }
.mouvement .motif--appel { right: 4vw; }
@media (max-width: 760px) {
  /* Dans la marge du haut de section, au-dessus du surtitre : la courbe ne
     passe plus derrière le texte. */
  .mouvement .motif--services { top: 6px; right: 3vw; width: 52vw; }
  .mouvement .motif--appel { right: 2vw; width: 70vw; bottom: 4%; }
  .mouvement .motif--contact { left: -12vw; }
}

/* ------------------------------------------------ 3. Le dossier se complète */
.fiche__statut {
  position: absolute;
  top: -14px; right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 9px;
  border-radius: 999px;
  background: var(--vert-700);
  color: var(--blanc);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 10px 22px -10px rgba(21, 122, 46, .8);
  opacity: 0;
  transform: translateY(6px) scale(.86) rotate(-3deg);
  transition: opacity .35s var(--courbe), transform .5s cubic-bezier(.34, 1.56, .64, 1);
}
.fiche__statut .ico { width: 15px; height: 15px; stroke-width: 2.8; }
.fiche__liste .encours .ico { display: none; }

.mouvement .fiche--avant.est-complete .fiche__statut { opacity: 1; transform: rotate(-3deg); }
.mouvement .fiche--avant.est-complete .encours { color: var(--encre); transition: color .4s; }
.mouvement .fiche--avant.est-complete .encours .point { display: none; }
.mouvement .fiche--avant.est-complete .encours .ico {
  display: block;
  width: 22px; height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: var(--vert-100);
  color: var(--vert-700);
  stroke-width: 2.6;
  animation: coche-pose .45s var(--courbe) both;
}
.mouvement .fiche--avant.est-complete .encours .ico path { stroke-dasharray: 22; animation: coche-trace .5s .1s var(--courbe) both; }
@keyframes coche-pose { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes coche-trace { from { stroke-dashoffset: 22; } to { stroke-dashoffset: 0; } }

/* La jauge passe de 75 % à 100 % avec la lecture (propriété scale, pilotée
   par le script ; l'entrée de page garde son animation « remplit »). */
.mouvement .fiche__jauge span { width: 100%; scale: .75 1; }
.mouvement .fiche--avant.est-complete .fiche__jauge span { background: linear-gradient(90deg, var(--vert-700), var(--vert-500)); }

/* Profondeur : la photo et la fiche glissent à deux vitesses (grand
   écran). L'entrée « pose » ne retient plus « translate » une fois finie
   (son état final est déjà l'état de repos) ; « flotte » reste intacte. */
.mouvement .visuel--accueil { animation-fill-mode: backwards; }
.mouvement .fiche--avant { animation-fill-mode: backwards, none; }

/* ------------------------------------------------ 4. Le parcours s'allume */
.parcours { position: relative; isolation: isolate; }
.parcours__rail { display: none; }
.mouvement .parcours__rail {
  display: block;
  position: absolute;
  z-index: 1;
  left: 55px; top: 56px;
  width: 2px;
  height: 0;              /* posés par le script : du 1er au dernier numéro */
  background: repeating-linear-gradient(rgba(28, 164, 60, .45) 0 6px, transparent 6px 12px);
  pointer-events: none;
}
.parcours__plein {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--vert-500), var(--vert-700));
  border-radius: 2px;
  transform: scaleY(0);
  transform-origin: top;
}
.parcours__tete {
  position: absolute;
  left: -5px; top: -6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--vert-500);
  box-shadow: 0 0 0 5px rgba(28, 164, 60, .2), 0 0 16px 2px rgba(28, 164, 60, .45);
  opacity: 0;
}
/* Le connecteur pointillé animé en boucle laisse la place au rail. */
.mouvement .etape:not(:last-child)::after { display: none; }
.mouvement .etape__numero {
  position: relative;
  z-index: 2;
  transition: background-color .45s var(--courbe), color .45s, box-shadow .45s;
}
.mouvement .etape { transition: background-color .5s var(--courbe), box-shadow .5s var(--courbe); }
.mouvement .etape:not(.est-allumee) .etape__numero {
  background: var(--blanc);
  color: var(--marine-800);
  box-shadow: inset 0 0 0 2px var(--marine-100);
}
.mouvement .etape.est-allumee { background: var(--blanc); box-shadow: inset 0 0 0 1px rgba(28, 164, 60, .35), var(--ombre-douce); }
.mouvement .etape.est-allumee .etape__numero { background: var(--vert-700); color: var(--blanc); animation: onde 1.4s ease-out; }
.mouvement .etape.est-allumee .etape__icone .ico { animation: rebond .6s .1s var(--courbe); }
/* L'onde d'apparition du site d'origine laisse la place à celle de l'allumage. */
.mouvement .etape.est-vu:not(.est-allumee) .etape__numero { animation: none; }
@media (max-width: 480px) {
  .mouvement .parcours__rail { display: none; }
}

/* ------------------------------------------------ 5. La rime « performer » et la photo du bandeau */
.souligne--appel { color: inherit; }
.souligne--appel path { stroke: var(--vert-300); stroke-width: 5; animation: none; stroke-dashoffset: 0; }
.mouvement .souligne--appel.a-tracer path,
.mouvement .souligne--appel.est-trace path { stroke-dashoffset: 320; }
.mouvement .souligne--appel.est-trace path { animation: trace 1.2s .35s var(--courbe) forwards; }
/* La photo suit la lecture au lieu de zoomer en boucle ; agrandie de 18 %
   pour ne jamais découvrir de bord (le script règle la translation). */
.mouvement .appel__fond { animation: none; transform: scale(1.18); will-change: transform; }

/* ------------------------------------------------ 6. Le symbole se construit (pied de page)
   1er temps : le symbole (le A, la flèche, les personnages, 70 % du haut
   de l'image) se dévoile en diagonale, du bas à gauche vers le haut à
   droite, dans le sens de la flèche. 2e temps : le nom et le slogan se
   dévoilent de gauche à droite. */
.mouvement .pied__logo.a-construire {
  clip-path: polygon(-300% -200%, -272% -200%, -2% 70%, -2% 70%, -2% 100%, -300% 100%);
}
.mouvement .pied__logo.est-construit { animation: construit 1.7s both; }
@keyframes construit {
  0%   { clip-path: polygon(-300% -200%, -272% -200%, -2% 70%, -2% 70%, -2% 100%, -300% 100%); animation-timing-function: cubic-bezier(.45, 0, .2, 1); }
  58%  { clip-path: polygon(-300% -200%, -98% -200%, 172% 70%, -2% 70%, -2% 100%, -300% 100%); animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
  100% { clip-path: polygon(-300% -200%, -98% -200%, 172% 70%, 101% 70%, 101% 100%, -300% 100%); }
}

/* ------------------------------------------------ 7. Boutons : pression à ressort (tous appareils) */
.mouvement .bouton {
  transition: transform .25s var(--courbe), background-color .25s, box-shadow .25s, color .25s, scale .5s var(--ressort);
}
.mouvement .bouton:active {
  transform: none;
  scale: .97;
  transition-duration: .25s, .25s, .25s, .25s, .12s;
}

/* Boutons : lumière qui suit la souris, flèche « relais » (souris seulement) */
@media (hover: hover) and (pointer: fine) {
  .mouvement .bouton:hover .ico,
  .mouvement .bouton:focus-visible .ico { transform: none; }
  .mouvement .bouton:not([aria-busy="true"]):hover .ico,
  .mouvement .bouton:not([aria-busy="true"]):focus-visible .ico { animation: relais .62s var(--courbe); }

  /* Le reflet qui balayait devient une lumière ronde qui suit le pointeur. */
  .mouvement .bouton:not(.bouton--fantome):not(.bouton--fantome-sombre)::after {
    left: 0;
    width: 100%;
    transform: none;
    background: radial-gradient(140px circle at var(--lx, 50%) var(--ly, 50%), rgba(255, 255, 255, .28), transparent 70%);
    opacity: 0;
    transition: opacity .35s var(--courbe);
  }
  .mouvement .bouton--blanc:not(.bouton--fantome):not(.bouton--fantome-sombre)::after {
    background: radial-gradient(140px circle at var(--lx, 50%) var(--ly, 50%), rgba(28, 164, 60, .16), transparent 70%);
  }
  .mouvement .bouton:not(.bouton--fantome):not(.bouton--fantome-sombre):hover::after { animation: none; opacity: 1; }
  .mouvement .bouton--fantome.est-eclaire {
    background-image: radial-gradient(120px circle at var(--lx, 50%) var(--ly, 50%), rgba(111, 212, 127, .22), transparent 70%);
  }
}
@keyframes relais {
  0%   { transform: translateX(0);      opacity: 1; }
  38%  { transform: translateX(.85em);  opacity: 0; }
  39%  { transform: translateX(-.85em); opacity: 0; }
  100% { transform: translateX(0);      opacity: 1; }
}

/* ------------------------------------------------ 8. Cartes des domaines qui s'allument */
/* Le numéro en contour se remplit de bas en haut : au survol (souris),
   ou une fois, quand la carte est lue (toucher). */
.mouvement .service__numero {
  background: linear-gradient(0deg, var(--vert-100) 0 50%, transparent 50% 100%) 0 0 / 100% 200% no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  transition: background-position .8s var(--courbe), -webkit-text-stroke-color .5s;
}
.mouvement .service.est-lu .service__numero { background-position: 0 100%; -webkit-text-stroke-color: var(--vert-500); }

@media (hover: hover) and (pointer: fine) {
  .mouvement .service:hover .service__numero { background-position: 0 100%; -webkit-text-stroke-color: var(--vert-500); }

  /* Bordure lumineuse de 1,5 px allumée autour du pointeur seulement, et
     halo très pâle sur le fond de la carte. */
  .mouvement .service::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 1.5px;
    border-radius: inherit;
    background: radial-gradient(340px circle at var(--px, 50%) var(--py, 50%), rgba(28, 164, 60, .85), rgba(28, 164, 60, 0) 62%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity .45s var(--courbe);
    pointer-events: none;
  }
  .mouvement .service.est-eclaire::after { opacity: 1; }
  .mouvement .service.est-eclaire {
    background-image: radial-gradient(520px circle at var(--px, 50%) var(--py, 50%), rgba(28, 164, 60, .05), transparent 65%);
  }
}

/* ------------------------------------------------ 9. Champs du formulaire vivants */
.mouvement .champ label { transition: color .25s; }
.mouvement .champ:focus-within > label { color: var(--vert-700); }

/* Trait vert qui se trace sous le champ à la prise de focus. */
.mouvement .champ input,
.mouvement .champ select,
.mouvement .champ textarea {
  background-image: linear-gradient(var(--vert-500), var(--vert-500));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: border-color .2s, background-color .2s, box-shadow .35s, background-size .6s var(--courbe);
}
.mouvement .champ input:focus,
.mouvement .champ select:focus,
.mouvement .champ textarea:focus {
  background-image: linear-gradient(var(--vert-500), var(--vert-500));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 2px;
}
.mouvement .champ input[aria-invalid="true"],
.mouvement .champ textarea[aria-invalid="true"] { background-image: none; }

/* Coche de validité au bout de l'étiquette (mêmes règles que le serveur). */
.mouvement .champ > label::after {
  content: "";
  display: inline-block;
  width: 1.05em; height: 1.05em;
  margin-left: .45em;
  vertical-align: -.16em;
  border-radius: 50%;
  background: var(--vert-100) no-repeat center / 70% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23157a2e' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  opacity: 0;
  scale: .4;
  transition: opacity .3s, scale .45s var(--ressort);
}
.mouvement .champ.est-valide > label::after { opacity: 1; scale: 1; }
/* Champ refusé (par le navigateur ou le serveur) : jamais de coche. Sur un
   navigateur sans :has(), cette règle est ignorée, sans autre effet. */
.mouvement .champ:has([aria-invalid="true"]) > label::after { opacity: 0; scale: .4; }

/* Jauge des 10 caractères du message. */
.mouvement #aide-message {
  position: relative;
  padding-left: 54px;
  transition: color .3s;
}
.mouvement #aide-message::before,
.mouvement #aide-message::after {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 42px; height: 4px;
  margin-top: -2px;
  border-radius: 4px;
  background: var(--filet);
}
.mouvement #aide-message::after {
  background: var(--vert-500);
  transform: scaleX(var(--remplissage, 0));
  transform-origin: left;
  transition: transform .35s var(--courbe);
}
.mouvement .champ.est-suffisant #aide-message { color: var(--vert-700); }

/* ------------------------------------------------ Impression */
@media print {
  .fil { display: none !important; }
}

/* Fil de lecture : pointe horizontale (capsule verte, flèche blanche) dans
   le sens de la lecture, posée au bout de la barre, avec un halo discret. */
.fil__tete {
  top: -7px;
  width: 28px; height: 16px;
  margin-left: -26px;
  color: var(--vert-700);
  filter: drop-shadow(0 2px 6px rgba(21, 122, 46, .45));
}
