/* Reset default margin and set dark background to prevent white flash */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #001011; /* Dark background to prevent flash */
}

/* Fullscreen loader matching app dark gradient from GradientScaffold */
#loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Match Flutter RadialGradient: center Alignment(0.6, -0.8), radius 0.8 */
  /* Alignment converts to CSS: 80% from left, 10% from top */
  /* Matching the subtle glow effect with proper color stops */
  background: radial-gradient(circle at 80% 10%, #212D31 0%, #212D31 20%, #001011 70%);
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Logo container - centered with slight upward offset to match login screen */
#loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  /* Offset upward from center to match login screen positioning */
  transform: translateY(-15vh);
}

#loader-logo {
  height: 60px; /* Final size matching Branding component */
  width: auto;
  opacity: 0;
  transform: scale(0.6);
  animation: fadeInScale 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.1s;
}

@keyframes fadeInScale {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pulse effect for extended loading */
#loader-logo.pulse {
  animation: fadeInScale 1s cubic-bezier(0.4, 0, 0.2, 1) forwards,
             pulse 2s ease-in-out infinite;
  animation-delay: 0.1s, 1.2s;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  #loader-logo {
    animation: none;
    opacity: 1;
    transform: scale(1);
  }
}


