/* =============================================================================
   AURYVO Business — le mouvement (js/mouvement.js, core.js echelonner/compter, graphiques).
   Grammaire unique : ressort doux pour ce qui se déplace, sortie rapide pour ce qui s'en va, 0,6 s au plus.
   Tout disparaît si l'utilisateur demande moins d'animations (règle globale d'app.css + garde-fous ici).
   ============================================================================= */
:root {
  --mv-ressort: cubic-bezier(.3, 1.25, .45, 1);     /* dépasse à peine, puis se pose */
  --mv-sortie: cubic-bezier(.4, 0, 1, 1);
  --mv-doux: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- entrée d'une page : les blocs montent l'un après l'autre ---------- */
@keyframes mv-monte { from { opacity: 0; transform: translateY(10px); } }
.view-enter .stagger { animation: mv-monte .42s var(--mv-doux) both; animation-delay: calc(var(--i, 0) * 30ms); }   /* toute la page est là en 0,65 s */

/* sous-page de la même rubrique (Banque → Vue d'ensemble…) : un fondu court, la navigation ne bouge pas */
@keyframes mv-fondu { from { opacity: 0; transform: translateY(5px); } }
.mv-fondu > :not(.subnav) { animation: mv-fondu .3s var(--mv-doux) both; }
.mv-fondu > :nth-child(2) { animation-delay: 25ms; } .mv-fondu > :nth-child(3) { animation-delay: 50ms; } .mv-fondu > :nth-child(n+4) { animation-delay: 75ms; }

/* blocs plus bas : ils apparaissent quand on les atteint */
.mv-revele { opacity: 0; transform: translateY(22px); }
.mv-revele.mv-vu { opacity: 1; transform: none; transition: opacity .6s var(--mv-doux), transform .7s var(--mv-doux); transition-delay: calc(var(--j, 0) * 60ms); }
@media print { .mv-revele { opacity: 1 !important; transform: none !important; } }

/* ---------- pastille glissante (segments, barre latérale) ---------- */
.mv-relatif { position: relative; }
.mv-fantome { position: absolute; z-index: 0; pointer-events: none; box-sizing: border-box; will-change: transform; }
.mv-glisse > :not(.mv-fantome) { position: relative; z-index: 1; }
.mv-cache { background: transparent !important; box-shadow: none !important; border-left-color: transparent !important; transition: none !important; }

/* ---------- barre latérale : la rubrique qui s'ouvre se déplie, ses pages arrivent ---------- */
.cs-v-groupe.mv-deplie .cs-v-pages a { animation: mv-glisse-g .34s var(--mv-doux) both; }
.cs-v-groupe.mv-deplie .cs-v-pages a:nth-child(2) { animation-delay: 30ms; } .cs-v-groupe.mv-deplie .cs-v-pages a:nth-child(3) { animation-delay: 60ms; }
.cs-v-groupe.mv-deplie .cs-v-pages a:nth-child(n+4) { animation-delay: 90ms; }
@keyframes mv-glisse-g { from { opacity: 0; transform: translateX(-6px); } }
.cs-v-chev { transition: transform .32s var(--mv-ressort); }
.cs-pastille { transition: transform .3s var(--mv-ressort), background .2s; }
.cs-pastille.mv-change { animation: mv-pouls .5s var(--mv-ressort); }
@keyframes mv-pouls { 40% { transform: scale(1.28); } }

/* ---------- fenêtres : elles se ferment aussi en douceur (ordinateur ; le téléphone a ses feuilles iOS) ---------- */
@media (min-width: 821px) {
  .modal-bg.sortie { animation: mv-fond-out .22s var(--mv-sortie) both; pointer-events: none; }
  .modal-bg.sortie .modal { animation: mv-modal-out .22s var(--mv-sortie) both; }
}
@keyframes mv-fond-out { to { opacity: 0; } }
@keyframes mv-modal-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }
.modal .modal-body > *, .modal .modal-foot { animation: mv-monte .42s var(--mv-doux) backwards; animation-delay: 90ms; }   /* backwards : aucun contexte d'empilement laissé après coup */
.modal .modal-foot { animation-delay: 140ms; }

/* ---------- jauges et barres simples : elles se remplissent à l'affichage ---------- */
@keyframes mv-remplit { from { transform: scaleX(0); } }
@keyframes mv-pousse { from { transform: scaleY(0); } }
.pf-dep-b i, .pf-as-c i, .pf-pm-b i, .pf-ob-b i, .progress > div, .meter > div, .bm-av-b i, .rp-progression i, .pf-part i::after {
  transform-origin: left center; animation: mv-remplit .9s var(--mv-doux) both; animation-delay: .12s; }
.pf-mini i { transform-origin: bottom; animation: mv-pousse .7s var(--mv-doux) both; }
.pf-mini span:nth-child(n) i { animation-delay: calc(.1s + var(--k, 0) * 25ms); }
.pf-mini span:nth-child(2) i { --k: 1; } .pf-mini span:nth-child(3) i { --k: 2; } .pf-mini span:nth-child(4) i { --k: 3; } .pf-mini span:nth-child(5) i { --k: 4; }
.pf-mini span:nth-child(6) i { --k: 5; } .pf-mini span:nth-child(7) i { --k: 6; } .pf-mini span:nth-child(8) i { --k: 7; } .pf-mini span:nth-child(9) i { --k: 8; }
.pf-mini span:nth-child(10) i { --k: 9; } .pf-mini span:nth-child(11) i { --k: 10; } .pf-mini span:nth-child(12) i { --k: 11; }

/* ---------- graphiques : la courbe se trace de gauche à droite, les barres poussent ---------- */
@keyframes mv-balaye { from { clip-path: inset(-24px 100% -24px -24px); } to { clip-path: inset(-24px -24px -24px -24px); } }
.gr-anim .gr-courbes { animation: mv-balaye 1.15s cubic-bezier(.55, 0, .25, 1) backwards; animation-delay: .1s; }
.gr-anim .gr-barre { transform-box: fill-box; transform-origin: center bottom; animation: mv-pousse .7s var(--mv-doux) backwards; animation-delay: .35s; }
.gr-anim .gr-bas-etiq, .gr-anim .gr-seuil text { animation: mv-apparait .4s var(--mv-doux) backwards; animation-delay: 1.05s; }
@keyframes mv-apparait { from { opacity: 0; transform: translateY(4px); } }
.gb-anim .gb-barre { transform-box: fill-box; transform-origin: center bottom; animation: mv-pousse .75s var(--mv-ressort) backwards; }
.gb-anim .gb-barre.negatif:not(.total) { transform-origin: center top; }
.gb-anim.gb-horizontal .gb-barre { transform-origin: left center; animation-name: mv-remplit; }
.gb-anim .gb-val, .gb-anim .gb-val-l { animation: mv-apparait .4s var(--mv-doux) backwards; animation-delay: .45s; }
/* survol d'un graphique : l'info-bulle arrive en glissant */
.gr-bulle:not([hidden]), .ga-bulle:not([hidden]) { animation: mv-apparait .18s var(--mv-doux); }

/* ---------- grand chiffre en points : les points s'allument en vague, de gauche à droite ---------- */
svg.points circle:not(.eteint) { transform-box: fill-box; transform-origin: center; animation: mv-point .55s var(--mv-ressort) backwards;
  animation-delay: calc(120ms + var(--d, 0) * 16ms); }
@keyframes mv-point { from { opacity: 0; transform: scale(.15); } }

/* ---------- micro-interactions : tout ce qui se clique répond au doigt ---------- */
.icon-btn, .gr-btn, .ga-plein, .gr-leg, .circle, .chip, .cs-v-act, .cs-v-soph, .card-head > a, .card-head a.small {
  transition: transform .3s var(--mv-ressort), background .2s, color .2s, box-shadow .25s, opacity .2s, border-color .2s; }
.icon-btn:active, .gr-btn:active, .ga-plein:active, .circle:active, .cs-v-act:active, .cs-v-soph:active, .card-head > a:active { transform: scale(.94); transition-duration: .08s; }
.seg button:active, .segment :is(button, a):active, .gr-periodes button:active, .gr-seg button:active, .ga-echelle button:active, .subnav a:active { transform: scale(.96); transition: transform .08s; }
.cs-v-pages a, .cs-v-seul, .cs-v-groupe > button { transition: background .2s, color .2s, transform .3s var(--mv-ressort); }
.cs-v-pages a:active, .cs-v-seul:active, .cs-v-groupe > button:active { transform: scale(.98); }
/* une flèche « voir plus » avance d'un cran au survol */
:is(.pf-tl, .pf-gr-pied a, .pf-ob-aj, .bm-dec-l, .card-head > a) svg.i { transition: transform .3s var(--mv-ressort); }
:is(.pf-tl, .pf-gr-pied a, .pf-ob-aj, .bm-dec-l, .card-head > a):hover svg.i { transform: translateX(3px); }
/* cartes cliquables : elles se soulèvent d'un rien */
a.card:hover, .card.cliquable:hover, .pf-tuile[href]:hover, a.pf-tuile:hover { transform: translateY(-2px); box-shadow: var(--sh-float); }
/* lignes de tableau et listes : le survol glisse au lieu de clignoter */
.t tbody tr td, .bq-op, .todo, .pf-as-l a, .pf-sg-l li { transition: background .22s var(--mv-doux), transform .3s var(--mv-ressort); }
.bq-op:active, .todo:active { transform: scale(.995); }

/* ---------- changement d'apparence : fondu de tout l'écran ---------- */
html.mv-theme::view-transition-old(root), html.mv-theme::view-transition-new(root) { animation-duration: .38s; animation-timing-function: var(--mv-doux); }

/* ---------- menus flottants : sortie un peu plus vive que l'entrée ---------- */
.pop.off { transition-duration: .14s !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-delay: 0s !important; }      /* rien n'attend son tour : tout est là d'emblée */
  .mv-revele { opacity: 1 !important; transform: none !important; }
  .mv-fantome { display: none; }
  .gr-anim .gr-courbes, .gr-anim .gr-barre, .gb-anim .gb-barre { animation: none !important; }
}
