.loading-container {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(56, 189, 248, 0.22), transparent 32%),
    linear-gradient(135deg, #eef8ff 0%, #f8fbff 42%, #eaf4ff 100%);
}

.loading-container::before,
.loading-container::after {
  position: absolute;
  left: 50%;
  top: 50%;
  content: '';
  border-radius: 999px;
  filter: blur(8px);
  opacity: 0.55;
}

.loading-container::before {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.2), transparent 68%);
  transform: translate(calc(-50% - 220px), calc(-50% - 120px));
  animation: loadingFloatA 5s ease-in-out infinite;
}

.loading-container::after {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.16), transparent 70%);
  transform: translate(calc(-50% + 230px), calc(-50% + 125px));
  animation: loadingFloatB 6s ease-in-out infinite;
}

.loading-stage {
  position: relative;
  width: min(260px, 58vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.loading-card {
  position: relative;
  z-index: 2;
  width: min(132px, 34vw);
  height: min(132px, 34vw);
  display: grid;
  place-items: center;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: loadingCardPulse 2.8s ease-in-out infinite;
}

.loading-logo-image {
  width: min(116px, 30vw);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(14, 116, 144, 0.2)) saturate(1.08) contrast(1.04);
}

.loading-scan {
  display: none;
}

.loading-halo,
.loading-orbit {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.loading-halo {
  inset: 18px;
  border: 1px solid rgba(14, 165, 233, 0.18);
  background: radial-gradient(circle, rgba(125, 211, 252, 0.12), transparent 62%);
}

.loading-halo-a {
  animation: loadingHalo 3.2s ease-in-out infinite;
}

.loading-halo-b {
  inset: 40px;
  animation: loadingHalo 3.2s ease-in-out infinite 0.8s;
}

.loading-orbit {
  border: 1px solid rgba(14, 165, 233, 0.32);
  box-shadow: 0 0 32px rgba(14, 165, 233, 0.16);
}

.loading-orbit-a {
  inset: 8px;
  border-left-color: rgba(249, 115, 22, 0.72);
  border-bottom-color: transparent;
  animation: loadingOrbit 3.4s linear infinite;
}

.loading-orbit-b {
  inset: 32px;
  border-right-color: rgba(59, 130, 246, 0.64);
  border-top-color: transparent;
  animation: loadingOrbit 2.8s linear infinite reverse;
}

.loading-particle {
  position: absolute;
  z-index: 3;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #0ea5e9;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.72);
  animation: loadingParticle 2.4s ease-in-out infinite;
}

.loading-particle-a {
  top: 50px;
  right: 38px;
}

.loading-particle-b {
  bottom: 56px;
  left: 42px;
  width: 8px;
  height: 8px;
  background: #f97316;
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.66);
  animation-delay: 0.55s;
}

.loading-particle-c {
  top: 78px;
  left: 30px;
  width: 7px;
  height: 7px;
  animation-delay: 1.05s;
}

.loading-progress {
  position: relative;
  z-index: 2;
  width: min(260px, 58vw);
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.12);
}

.loading-progress span {
  position: absolute;
  inset: 0;
  width: 46%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #2563eb, #f97316);
  box-shadow: 0 0 18px rgba(14, 165, 233, 0.42);
  animation: loadingProgress 1.5s ease-in-out infinite;
}

@keyframes loadingOrbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loadingHalo {
  0%,
  100% {
    opacity: 0.38;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.04);
  }
}

@keyframes loadingCardPulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes loadingScan {
  0% {
    transform: translateX(-64%) rotate(8deg);
  }
  62%,
  100% {
    transform: translateX(64%) rotate(8deg);
  }
}

@keyframes loadingParticle {
  0%,
  100% {
    opacity: 0.42;
    transform: translateY(0) scale(0.88);
  }
  50% {
    opacity: 1;
    transform: translateY(-12px) scale(1.16);
  }
}

@keyframes loadingProgress {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(230%);
  }
}

@keyframes loadingFloatA {
  0%,
  100% {
    opacity: 0.42;
    transform: translate(calc(-50% - 220px), calc(-50% - 120px)) scale(0.98);
  }
  50% {
    opacity: 0.72;
    transform: translate(calc(-50% - 188px), calc(-50% - 144px)) scale(1.04);
  }
}

@keyframes loadingFloatB {
  0%,
  100% {
    opacity: 0.42;
    transform: translate(calc(-50% + 230px), calc(-50% + 125px)) scale(0.98);
  }
  50% {
    opacity: 0.72;
    transform: translate(calc(-50% + 198px), calc(-50% + 104px)) scale(1.04);
  }
}

@media (max-width: 520px) {
  .loading-card {
    width: 112px;
    height: 112px;
  }

  .loading-logo-image {
    width: 102px;
  }
}
