/*
 * Boot screen: shown by index.html while the application starts (first visit, back from the Keycloak login, a page
 * reload). Plain CSS, loaded before Angular: no framework styles are available yet. The navbar's dark background and
 * logo, a slim progress bar in the logo's red; still when the user prefers reduced motion.
 */
.app-loading {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: radial-gradient(ellipse at center, #2b3035 0%, #212529 55%, #1a1d20 100%);
}

.app-loading__logo {
  width: min(260px, 60vw);
  aspect-ratio: 957 / 179;
  background: url('../images/logo_perseo_white.png') no-repeat center / contain;
  animation: app-loading-breathe 2.4s ease-in-out infinite;
}

.app-loading__bar {
  position: relative;
  width: min(200px, 45vw);
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.app-loading__bar::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(237, 28, 36, 0) 0%, #ed1c24 50%, rgba(237, 28, 36, 0) 100%);
  /* steady, already under way at the first frame and never fully out of the bar: a login or a reload often takes
     less than half a second, and an ease-in-out sweep from outside the bar showed nothing in that time */
  animation: app-loading-slide 0.9s linear -0.25s infinite;
}

.app-loading__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@keyframes app-loading-breathe {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.72;
    transform: scale(0.985);
  }
}

@keyframes app-loading-slide {
  0% {
    transform: translateX(-60%);
  }
  100% {
    transform: translateX(210%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-loading__logo,
  .app-loading__bar::after {
    animation: none;
  }

  .app-loading__bar::after {
    width: 100%;
    opacity: 0.6;
  }
}
