html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow: hidden;
  background: linear-gradient(135deg, #058073 0%, #14213d 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), transparent 34%),
    radial-gradient(circle at 70% 65%, rgba(255, 255, 255, 0.05), transparent 30%);
  animation: background-drift 9s ease-in-out infinite alternate;
  pointer-events: none;
}

#app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.loader-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #f8fafc;
  animation: fade-in 500ms ease-out;
}

.logo-stage {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  animation: logo-stage-float 4.8s ease-in-out infinite;
}

.logo-stage-glow {
  position: absolute;
  inset: 22% 12%;
  z-index: -1;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 36%, transparent 72%);
  filter: blur(16px);
  animation: logo-glow 3.1s ease-in-out infinite;
}

.logo-stage::after {
  content: "";
  position: absolute;
  inset: -10% -4%;
  z-index: -1;
  background: linear-gradient(105deg, transparent 24%, rgba(255, 255, 255, 0.18) 48%, transparent 72%);
  opacity: 0;
  transform: translateX(-34%) skewX(-18deg);
  animation: logo-sheen 3.8s ease-in-out infinite;
}

.loader-logo {
  width: min(280px, 70vw);
  height: auto;
  display: block;
  transform: translateZ(0);
  animation: logo-breathe 3.2s ease-in-out infinite;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.18));
}

.loading-text {
  margin-top: 18px;
  color: rgba(248, 250, 252, 0.82);
  font-size: 0.98rem;
  line-height: 1.6;
}

#progress-bar-container {
  width: min(240px, 70vw);
  height: 5px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

#progress-bar {
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  animation: progress 1.45s ease-in-out infinite;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logo-stage-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes logo-breathe {
  0%,
  100% {
    opacity: 0.94;
    transform: translate3d(0, 0, 0);
  }

  50% {
    opacity: 1;
    transform: translate3d(0, -1px, 0);
  }
}

@keyframes logo-glow {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(0.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes logo-sheen {
  0%,
  58%,
  100% {
    opacity: 0;
    transform: translateX(-34%) skewX(-18deg);
  }

  68% {
    opacity: 1;
  }

  82% {
    opacity: 0;
    transform: translateX(34%) skewX(-18deg);
  }
}

@keyframes background-drift {
  from {
    transform: translate3d(-2%, -1%, 0);
  }

  to {
    transform: translate3d(2%, 1%, 0);
  }
}

@keyframes progress {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(310%);
  }
}
