body {
  inset: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  position: fixed;
  background-color: #f8fafc; /* Beautiful premium light slate background */
  color: #0f172a;
  font-family: 'Outfit', sans-serif;
}

#loading {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 99999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Ambient drifting background */
.gradient-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
  z-index: 1;
}

.gradient-bg div {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22; /* Soft light mode visibility */
  mix-blend-mode: multiply; /* Soft color blend on light backdrop */
  transform-origin: center;
}

.g1 {
  width: 500px;
  height: 500px;
  background: #c7d2fe; /* Soft indigo-200 */
  top: -10%;
  left: -10%;
  animation: float 20s infinite alternate ease-in-out;
}

.g2 {
  width: 600px;
  height: 600px;
  background: #bae6fd; /* Soft sky-200 */
  bottom: -15%;
  right: -10%;
  animation: float 25s infinite alternate-reverse ease-in-out;
}

.g3 {
  width: 400px;
  height: 400px;
  background: #fed7aa; /* Soft orange-200 */
  top: 35%;
  left: 30%;
  animation: float 18s infinite alternate ease-in-out;
}

@keyframes float {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  50% {
    transform: translate(40px, 60px) scale(1.08);
  }
  100% {
    transform: translate(-20px, -30px) scale(0.95);
  }
}

/* Glassmorphism Card Container */
.glass-card {
  position: relative;
  z-index: 2;
  width: 280px;
  padding: 40px 24px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 
    0 20px 50px rgba(9, 129, 254, 0.06), 
    0 4px 12px rgba(0, 0, 0, 0.01),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  text-align: center;
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Loader Ring Wrapper */
.loader-ring-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.loader-svg {
  position: absolute;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  transform-origin: center;
}

.loader-bg-track {
  fill: none;
  stroke: rgba(9, 129, 254, 0.06);
  stroke-width: 4px;
}

.loader-glow-indicator {
  fill: none;
  stroke: #0981FE;
  stroke-width: 4px;
  stroke-linecap: round;
  stroke-dasharray: 276.4; /* Circumference of r=44 */
  stroke-dashoffset: 220;
  transform-origin: center;
  animation: rotateRing 2s linear infinite, pulseGlow 1.5s ease-in-out infinite alternate;
  transition: stroke 0.4s ease, stroke-dashoffset 0.4s ease;
}

@keyframes rotateRing {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulseGlow {
  0% {
    filter: drop-shadow(0 0 2px rgba(9, 129, 254, 0.3));
  }
  100% {
    filter: drop-shadow(0 0 8px rgba(9, 129, 254, 0.6));
  }
}

/* Logo Image centered inside orbit ring */
.logo-image {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  z-index: 3;
  animation: logoBreathe 2.5s ease-in-out infinite alternate;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 16px rgba(9, 129, 254, 0.08);
}

@keyframes logoBreathe {
  0% {
    transform: scale(0.96);
    filter: drop-shadow(0 0 4px rgba(9, 129, 254, 0.15));
  }
  100% {
    transform: scale(1.02);
    filter: drop-shadow(0 0 12px rgba(9, 129, 254, 0.35));
  }
}

/* Brand Typography */
.brand-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px 0;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Status Label Container */
.status-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.status-indicator {
  width: 6px;
  height: 6px;
  background-color: #0981FE;
  border-radius: 50%;
  animation: statusBreathe 1s ease-in-out infinite alternate;
}

@keyframes statusBreathe {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
    box-shadow: 0 0 0 rgba(9, 129, 254, 0);
  }
  100% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 6px rgba(9, 129, 254, 0.6);
  }
}

.status-text {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.4s ease;
}

/* Milestone Transitions */
/* main_done state */
#loading.main_done .loader-glow-indicator {
  stroke: #10b981; /* Beautiful green */
  stroke-dashoffset: 120;
  animation: rotateRing 1s linear infinite, pulseGlowGreen 1s ease-in-out infinite alternate;
}

#loading.main_done .status-indicator {
  background-color: #10b981;
  animation-name: statusBreatheGreen;
}

#loading.main_done .status-text {
  color: #10b981;
}

@keyframes pulseGlowGreen {
  0% {
    filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.3));
  }
  100% {
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
  }
}

@keyframes statusBreatheGreen {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  }
}

/* init_done (App Launch Outro) */
#loading.init_done {
  pointer-events: none;
}

#loading.init_done .glass-card {
  transform: scale(0.92) translateY(-10px);
  opacity: 0;
  filter: blur(15px);
}

#loading.init_done .gradient-bg {
  opacity: 0;
  transition: opacity 0.5s ease;
}
