/* Splash screen shown while the Flutter web app is downloading and starting. */

:root {
  --splash-background: #F5F7F8;
  --splash-muted: #6B7385;
  --splash-green: #12805C;
  --splash-light-green: #2FBF8F;
  --splash-track: #E2E9E8;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: var(--splash-background);
}

#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background-color: var(--splash-background);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  transition: opacity 300ms ease-out;
}

#splash.splash-hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: splash-enter 500ms ease-out both;
}

.splash-logo {
  width: 300px;
  max-width: 100%;
  height: auto;
}

.splash-progress {
  width: 300px;
  max-width: 100%;
  height: 4px;
  margin-top: 40px;
  overflow: hidden;
  border-radius: 2px;
  background-color: var(--splash-track);
}

.splash-progress-bar {
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--splash-green), var(--splash-light-green));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 250ms ease-out;
}

.splash-error {
  display: none;
  max-width: 320px;
  margin: 24px 0 0;
  color: var(--splash-muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

#splash.splash-failed .splash-progress {
  display: none;
}

#splash.splash-failed .splash-error {
  display: block;
}

@keyframes splash-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #splash,
  .splash-progress-bar {
    transition: none;
  }

  .splash-content {
    animation: none;
  }
}
