/* Animations des pages Opendexa (site et pages d'accueil des modules) — source unique :
   opendexa-platform/shared/motion.css (copiée par apply_navbar.py). Jamais chargée dans les dashboards Streamlit.
   Coupées quand le système demande moins d'animations ; le contenu reste visible sans JavaScript. */

/* Écran d'ouverture : posé par intro.js à la première page de la visite, retiré au bout de 0,85 s (3 s au plus
   si le script s'arrête). Fond, logo et barre : body::before, body::after, html::after. */
@keyframes odx-intro-logo { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes odx-intro-sweep { from { background-position: -100% 0, 0 0; } to { background-position: 200% 0, 0 0; } }
@keyframes odx-intro-safety { to { opacity: 0; visibility: hidden; } }
html.odx-intro body::before, html.odx-intro body::after, html.odx-intro::after {
  content: ""; position: fixed; pointer-events: none; z-index: 2147483000;
  transition: opacity .45s ease, visibility .45s; animation: odx-intro-safety 0s 3s forwards; }
html.odx-intro body::before { inset: 0; background: #0f1b3d; }
html.odx-intro body::after { left: 50%; top: 50%; width: 64px; height: 64px; margin: -52px 0 0 -32px; z-index: 2147483001;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%234F46E5'/%3E%3Cpath d='M15 11h2M21 15v2' stroke='%23fff' stroke-width='2'/%3E%3Crect x='7' y='7' width='8' height='8' rx='2' fill='%23fff'/%3E%3Crect x='17' y='7' width='8' height='8' rx='2' fill='%23fff'/%3E%3Crect x='7' y='17' width='8' height='8' rx='2' fill='%2322D3EE'/%3E%3Crect x='17' y='17' width='8' height='8' rx='2' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: odx-intro-logo .45s cubic-bezier(.2, .7, .2, 1) both, odx-intro-safety 0s 3s forwards; }
html.odx-intro::after { left: 50%; top: calc(50% + 34px); width: 168px; height: 4px; margin-left: -84px; border-radius: 4px;
  z-index: 2147483001;
  background: linear-gradient(90deg, transparent, #8ea7ff, transparent) 0 0 / 50% 100% no-repeat, rgba(255, 255, 255, .16);
  animation: odx-intro-sweep .9s ease-in-out infinite, odx-intro-safety 0s 3s forwards; }
html.odx-intro-out body::before, html.odx-intro-out body::after, html.odx-intro-out::after { opacity: 0; visibility: hidden; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes odx-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

  /* Chargement : le haut de page (titre, accroche, boutons) monte en fondu, élément par élément ; après l'écran
     d'ouverture quand il y en a un */
  :root { --odx-start: 0s; }
  html.odx-intro { --odx-start: .85s; }
  main > .hero .wrap > * { animation: odx-rise .6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--odx-start); }
  main > .hero .wrap > :nth-child(2) { animation-delay: calc(var(--odx-start) + .08s); }
  main > .hero .wrap > :nth-child(3) { animation-delay: calc(var(--odx-start) + .16s); }
  main > .hero .wrap > :nth-child(4) { animation-delay: calc(var(--odx-start) + .24s); }
  main > .hero .wrap > :nth-child(n+5) { animation-delay: calc(var(--odx-start) + .32s); }

  /* Défilement : sections et cartes sous la ligne de flottaison, posées par motion.js */
  .odx-reveal { opacity: 0; transform: translateY(18px);
    transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--odx-delay, 0s); }
  .odx-reveal.odx-shown { opacity: 1; transform: none; }
}
@media print {
  .odx-reveal { opacity: 1 !important; transform: none !important; }
  html.odx-intro body::before, html.odx-intro body::after, html.odx-intro::after { display: none; }
}
