/* =============================================================================
   FORPRO – Écran de chargement et de traitement aux couleurs du MEFPT (v1)
   ============================================================================= */
#mefpt-loader {
  position: fixed; inset: 0; z-index: 100000;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(250, 246, 234, .97), rgba(241, 233, 213, .95));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity .45s cubic-bezier(.16, 1, .3, 1), visibility 0s linear .45s;
}
#mefpt-loader.is-visible { opacity: 1; visibility: visible; transition: opacity .25s ease, visibility 0s; }
#mefpt-loader.is-overlay { background: rgba(250, 246, 234, .82); }
#mefpt-loader::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(9, 22, 32, .07) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 55%);
          mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 55%);
}
.ml-stage { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 20px; }
.ml-stage > * { animation: ml-rise .6s cubic-bezier(.16, 1, .3, 1) both; }
.ml-ministry { animation-delay: .12s !important; }
.ml-message  { animation-delay: .2s !important; }
.ml-bar      { animation-delay: .28s !important; }

/* Emblème : logo, orbite pointillée, arc de progression, ondes */
.ml-emblem { position: relative; width: 132px; height: 132px; display: grid; place-items: center; margin-bottom: 22px; }
.ml-logo {
  position: relative; z-index: 3; width: 92px; height: 92px; border-radius: 24px; background: #fff;
  border: 1px solid #e5dfc9; display: grid; place-items: center; padding: 8px;
  box-shadow: 0 18px 40px -16px rgba(9, 22, 32, .45), 0 2px 6px rgba(9, 22, 32, .06);
  animation: ml-breathe 2.4s ease-in-out infinite;
}
.ml-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; }
.ml-orbit {
  position: absolute; inset: 4px; border-radius: 50%; border: 1.5px dashed rgba(184, 146, 90, .65);
  animation: ml-spin 14s linear infinite; z-index: 1;
}
.ml-pearl {
  position: absolute; top: -5px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%;
  background: #b8925a; box-shadow: 0 0 0 3px rgba(184, 146, 90, .2), 0 0 10px rgba(184, 146, 90, .6);
}
.ml-arc {
  position: absolute; inset: -6px; border-radius: 50%; z-index: 2;
  border: 2.5px solid transparent; border-top-color: #0078d4; border-right-color: rgba(0, 120, 212, .25);
  animation: ml-spin 1.1s cubic-bezier(.5, .15, .5, .85) infinite;
}
.ml-wave {
  position: absolute; inset: 14px; border-radius: 28px; border: 1px solid rgba(0, 120, 212, .45); z-index: 0;
  animation: ml-wave 2.4s cubic-bezier(.2, .6, .3, 1) infinite;
}
.ml-wave-2 { animation-delay: 1.2s; }

.ml-ministry { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #091620; line-height: 1.5; }
.ml-message { margin-top: 8px; font-size: 13.5px; color: #3d444a; min-height: 20px; }
.ml-message::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: ml-dots 1.4s steps(4, end) infinite; }
.ml-bar { margin-top: 14px; width: 180px; height: 3px; border-radius: 3px; background: rgba(9, 22, 32, .08); overflow: hidden; }
.ml-bar span { display: block; width: 40%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #0078d4, #b8925a); animation: ml-slide 1.3s cubic-bezier(.65, 0, .35, 1) infinite; }

@keyframes ml-spin    { to { transform: rotate(360deg); } }
@keyframes ml-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes ml-wave    { 0% { transform: scale(1); opacity: .9; } 85%, 100% { transform: scale(1.55); opacity: 0; } }
@keyframes ml-slide   { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@keyframes ml-rise    { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ml-dots    { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75%, 100% { content: '...'; } }

/* Ancien voile de chargement de l'application : remplacé par celui-ci */
#app-loading-overlay { display: none !important; }

/* Le voile d'accueil ne bloque pas le défilement une fois masqué */
html.ml-lock body { overflow: hidden; }

@media print { #mefpt-loader { display: none !important; } }

/* « Réduire les animations » : on garde l'emblème animé, plus lentement.
   (Le style d'origine de la page de connexion coupe toutes les animations.) */
@media (prefers-reduced-motion: reduce) {
  #mefpt-loader .ml-orbit { animation: ml-spin 24s linear infinite !important; }
  #mefpt-loader .ml-arc   { animation: ml-spin 1.6s linear infinite !important; }
  #mefpt-loader .ml-wave  { animation: ml-wave 3.2s ease-out infinite !important; }
  #mefpt-loader .ml-wave-2 { animation-delay: 1.6s !important; }
  #mefpt-loader .ml-bar span { animation: ml-slide 1.8s ease-in-out infinite !important; }
  #mefpt-loader .ml-logo { animation: none !important; }
  #mefpt-loader .ml-stage > * { animation: none !important; }
}
