body.page-loading {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-family: Inter, Helvetica, "sans-serif";
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.page-loading .splash-screen {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.splash-screen__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0, 158, 247, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(0, 158, 247, 0.12), transparent 50%),
    linear-gradient(165deg, #f4f8fc 0%, #eef3f9 45%, #f9fafb 100%);
}

html[data-bs-theme="dark"] .splash-screen__bg {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0, 158, 247, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(0, 158, 247, 0.1), transparent 50%),
    linear-gradient(165deg, #0f1019 0%, #151521 50%, #1a1a27 100%);
}

.splash-screen__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(100%, 360px);
  padding: 2.25rem 2rem 2rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 158, 247, 0.12);
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-bs-theme="dark"] .splash-screen__content {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(21, 21, 33, 0.92);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.splash-screen__logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  margin-bottom: 1.35rem;
}

.splash-screen__logo-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 158, 247, 0.15);
  animation: splash-ring-pulse 1.8s ease-in-out infinite;
}

.splash-screen__logo-wrap::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #009ef7;
  border-right-color: rgba(0, 158, 247, 0.35);
  animation: splash-spin 1.1s linear infinite;
}

.splash-screen__logo {
  position: relative;
  z-index: 1;
  width: 72px;
  height: auto;
  max-height: 72px;
  object-fit: contain;
  animation: splash-logo-in 0.6s ease-out both;
}

.splash-screen__title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #181c32;
  animation: splash-fade-up 0.55s ease-out 0.08s both;
}

html[data-bs-theme="dark"] .splash-screen__title {
  color: #f5f8fa;
}

.splash-screen__subtitle {
  margin: 0 0 1.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #7e8299;
  animation: splash-fade-up 0.55s ease-out 0.14s both;
}

html[data-bs-theme="dark"] .splash-screen__subtitle {
  color: #a1a5b7;
}

.splash-screen__progress {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 158, 247, 0.12);
  animation: splash-fade-up 0.55s ease-out 0.2s both;
}

html[data-bs-theme="dark"] .splash-screen__progress {
  background: rgba(0, 158, 247, 0.2);
}

.splash-screen__progress-bar {
  height: 100%;
  width: 38%;
  border-radius: inherit;
  background: linear-gradient(90deg, #009ef7, #50cd89);
  animation: splash-progress 1.35s ease-in-out infinite;
}

@keyframes splash-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes splash-ring-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.45;
  }
}

@keyframes splash-logo-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes splash-progress {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(280%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-screen__logo-wrap::before,
  .splash-screen__logo-wrap::after,
  .splash-screen__progress-bar,
  .splash-screen__logo,
  .splash-screen__title,
  .splash-screen__subtitle,
  .splash-screen__progress {
    animation: none !important;
  }

  .splash-screen {
    transition: none;
  }
}
