/* Écran de chargement EASY GRAY : affiché par index.html jusqu'au démarrage de l'application Angular. */

.eg-chargement {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 40%, #3b4d57 0%, #2f3e46 55%, #24323a 100%);
  color: #f1f3f4;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  text-align: center;
}

.eg-chargement-logo {
  width: 96px;
  height: 96px;
}

/* L'anneau (G) se dessine puis tourne lentement */
.eg-chargement-anneau {
  stroke-dasharray: 110;
  stroke-dashoffset: 110;
  transform-origin: 32px 32px;
  animation:
    eg-dessin 1.1s ease-out forwards,
    eg-rotation 2.4s linear 1.1s infinite;
}

/* Les trois barres (E) apparaissent l'une après l'autre, en boucle */
.eg-chargement-barre {
  opacity: 0.15;
  animation: eg-barre 1.8s ease-in-out infinite;
}

.eg-chargement-barre:nth-child(2) {
  animation-delay: 0.2s;
}

.eg-chargement-barre:nth-child(3) {
  animation-delay: 0.4s;
}

.eg-chargement-nom {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  font-weight: 300;
}

.eg-chargement-nom strong {
  font-weight: 800;
}

.eg-chargement-sous-titre {
  margin: -0.75rem 0 0;
  color: #b9c4c9;
  font-size: 0.9rem;
}

.eg-chargement-progression {
  position: relative;
  width: 180px;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgb(255 255 255 / 15%);
}

.eg-chargement-progression::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: 3px;
  background: #e07a5f;
  animation: eg-progression 1.4s ease-in-out infinite;
}

/* Chargement anormalement long (affiché par index.html) */
.eg-chargement-lent {
  display: none;
  max-width: 26rem;
  font-size: 0.9rem;
  color: #d5dcdf;
}

.eg-chargement-lent button {
  margin-top: 0.75rem;
  padding: 0.45rem 1.1rem;
  border: 0;
  border-radius: 0.5rem;
  background: #e07a5f;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.eg-chargement-lent button:hover {
  background: #c9654b;
}

@keyframes eg-dessin {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes eg-rotation {
  to {
    transform: rotate(360deg);
  }
}

@keyframes eg-barre {
  0%,
  100% {
    opacity: 0.15;
  }
  40%,
  60% {
    opacity: 1;
  }
}

@keyframes eg-progression {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(260%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .eg-chargement-anneau,
  .eg-chargement-barre,
  .eg-chargement-progression::after {
    animation: none;
    stroke-dashoffset: 0;
    opacity: 1;
  }
}
