/* Boot splash shown inside <app-root> while the backend cold-starts. Hidden
   until .is-visible (set by app-splash.js on the first failed health check).
   Neutral grey — the brand colour lives on the backend and isn't known yet. */

.app-splash {
  --app-splash-accent: #9aa3b0;
  --app-splash-track: #e3e7ed;
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--bs-body-bg, #f6f8fb);
  background-image: radial-gradient(
    120% 120% at 50% 0%,
    #ffffff 0%,
    var(--bs-body-bg, #f1f4f9) 55%,
    var(--bs-primary-soft, #e9eef6) 100%
  );
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.app-splash.is-visible {
  opacity: 1;
  visibility: visible;
}

.app-splash.is-leaving {
  opacity: 0;
}

/* gradient ring spinner */
.app-splash__spinner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--app-splash-accent) 300deg,
    var(--app-splash-accent) 360deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: app-splash-spin 0.9s linear infinite;
}

@keyframes app-splash-spin {
  to {
    transform: rotate(360deg);
  }
}

/* progress bar */
.app-splash__track {
  width: 220px;
  height: 6px;
  border-radius: 999px;
  background: var(--app-splash-track);
  overflow: hidden;
}

.app-splash__fill {
  height: 100%;
  width: var(--progress, 8%);
  border-radius: 999px;
  background: var(--app-splash-accent);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* indeterminate sweep until the first progress() update sets .is-determinate */
.app-splash:not(.is-determinate) .app-splash__fill {
  width: 40%;
  animation: app-splash-indeterminate 1.4s ease-in-out infinite;
}

@keyframes app-splash-indeterminate {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(320%);
  }
}

.app-splash__text {
  font-family: var(--bs-body-font-family, "Segoe UI", system-ui, -apple-system, sans-serif);
  font-size: 13px;
  color: var(--bs-secondary-color, #8a93a3);
  letter-spacing: 0.3px;
  min-height: 1em;
}

@media (prefers-reduced-motion: reduce) {
  .app-splash__spinner,
  .app-splash__fill {
    animation: none;
  }
}
