/*
 * Boot splash — painted by index.html before Angular (and the brand config)
 * has loaded, so nothing here can read the --ui-* tokens. It has two looks:
 *
 *   neutral  first visit to a brand in this browser: plain ground + spinner
 *   branded  repeat visit: the inline script in index.html reads the brand's
 *            last-seen logo and colours (saved by ThemeService under
 *            "<brandFlavor> splash") and sets them as --splash-* on the
 *            element before first paint
 *
 * AppComponent fades it out once the theme has been applied, so the page
 * underneath never shows in the default palette. CSS only — no gif, no
 * fonts, no images other than the brand's own logo.
 */

body {
  margin: 0;
  padding: 0;
  background-color: #fff;
}

.splash {
  --splash-ground: #ffffff;
  --splash-ink: #1b1b1b;
  --splash-accent: rgba(27, 27, 27, 0.55);
  --splash-track: rgba(27, 27, 27, 0.1);

  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  box-sizing: border-box;
  background: var(--splash-ground);
  color: var(--splash-ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  opacity: 1;
  transition: opacity 0.24s ease-out;
}

.splash--out {
  opacity: 0;
  pointer-events: none;
}

/* ---- brand mark (repeat visits only) --------------------------------- */

.splash__brand {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  animation: splash-in 0.32s ease-out both;
}

.splash--branded .splash__brand {
  display: flex;
}

.splash__logo {
  display: block;
  max-width: min(60vw, 220px);
  max-height: 88px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.splash__name {
  margin: 0;
  max-width: 80vw;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-align: center;
}

/* ---- spinner ----------------------------------------------------------- */

.splash__spin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--splash-track);
  border-top-color: var(--splash-accent);
  box-sizing: border-box;
  animation: splash-spin 0.8s linear infinite;
}

.splash--branded .splash__spin {
  width: 24px;
  height: 24px;
  border-width: 2.5px;
}

@keyframes splash-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes splash-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash__brand {
    animation: none;
  }
  .splash__spin {
    animation-duration: 2.4s;
  }
  .splash {
    transition: none;
  }
}
