.app-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(14, 165, 233, 0.16), transparent 25%),
    radial-gradient(circle at 85% 15%, rgba(37, 99, 235, 0.20), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(16, 185, 129, 0.10), transparent 30%),
    linear-gradient(135deg, #020617 0%, #0f172a 45%, #1e293b 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.38s ease, visibility 0.38s ease;
}

.app-loader::before,
.app-loader::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.35;
  pointer-events: none;
}

.app-loader::before {
  width: 260px;
  height: 260px;
  top: -60px;
  left: -60px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.45), transparent 70%);
  animation: bgFloatOne 8s ease-in-out infinite;
}

.app-loader::after {
  width: 320px;
  height: 320px;
  right: -80px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.24), transparent 72%);
  animation: bgFloatTwo 10s ease-in-out infinite;
}

.app-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loader__card {
  position: relative;
  width: 100%;
  max-width: 450px;
  overflow: hidden;
  text-align: center;
  border-radius: 30px;
  padding: 36px 28px 30px;
  background: linear-gradient(180deg, rgba(255,255,255,0.97) 0%, rgba(248,250,252,0.95) 100%);
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow:
    0 30px 90px rgba(2, 6, 23, 0.48),
    inset 0 1px 0 rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.app-loader__card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 15%, rgba(255,255,255,0.24) 48%, transparent 80%);
  transform: translateX(-120%);
  animation: cardSweep 3.8s ease-in-out infinite;
  pointer-events: none;
}

.app-loader__card::after {
  content: "";
  position: absolute;
  inset: auto -40px -80px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.10), transparent 70%);
  pointer-events: none;
}

.app-loader__top-glow {
  position: absolute;
  top: -90px;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18), rgba(14,165,233,0.08) 45%, transparent 72%);
  pointer-events: none;
}

.app-loader__lock-zone {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(37, 99, 235, 0.10);
}

.app-loader__ring--outer {
  border-top-color: rgba(37, 99, 235, 1);
  border-right-color: rgba(14, 165, 233, 0.8);
  animation: ringSpin 1.4s linear infinite;
}

.app-loader__ring--middle {
  inset: 12px;
  border-width: 2px;
  border-top-color: rgba(16, 185, 129, 0.9);
  border-right-color: rgba(37, 99, 235, 0.5);
  animation: ringSpinReverse 2s linear infinite;
}

.app-loader__ring--inner {
  inset: 24px;
  border-width: 2px;
  border-top-color: rgba(99, 102, 241, 0.85);
  border-right-color: rgba(59, 130, 246, 0.4);
  animation: ringSpin 2.8s linear infinite;
}

.app-loader__lock {
  position: relative;
  width: 86px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  animation: lockFloat 2.4s ease-in-out infinite;
}

.app-loader__shackle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 44px;
  height: 38px;
  transform: translateX(-50%);
  border: 6px solid #0f172a;
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  transform-origin: bottom center;
  animation: shackleOpen 3.2s ease-in-out infinite;
  z-index: 2;
}

.app-loader__body {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 84px;
  height: 62px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 48%, #0f172a 100%);
  box-shadow:
    0 14px 26px rgba(37, 99, 235, 0.30),
    inset 0 1px 0 rgba(255,255,255,0.24);
}

.app-loader__body::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent 40%);
}

.app-loader__keyhole {
  position: absolute;
  top: 16px;
  left: 50%;
  width: 15px;
  height: 15px;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.96);
  border-radius: 50%;
}

.app-loader__keyhole::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 50%;
  width: 6px;
  height: 16px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: rgba(255,255,255,0.96);
}

.app-loader__logo-shell {
  position: absolute;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(226,232,240,0.94));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255,255,255,0.8);
  z-index: 3;
}

.app-loader__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  animation: logoFloat 2.2s ease-in-out infinite;
}

.app-loader__title {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: 23px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.2px;
}

.app-loader__text {
  position: relative;
  z-index: 2;
  margin: 10px 0 18px;
  font-size: 14px;
  color: #475569;
  line-height: 1.7;
  min-height: 26px;
}

.app-loader__message {
  display: inline-block;
  font-weight: 700;
  color: #1d4ed8;
  animation: messageFade 0.35s ease;
}

.app-loader__progress,
.app-loader__bar,
.app-loader__percent {
  display: none !important;
}

.app-loader__progress-wrap {
  position: relative;
  z-index: 2;
  margin-top: 8px;
}

.app-loader__status-row {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-loader__status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 800;
  color: #334155;
  letter-spacing: 0.2px;
}

.app-loader__dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 24px;
}

.app-loader__dots span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%);
  box-shadow:
    0 8px 18px rgba(37, 99, 235, 0.28),
    0 0 0 4px rgba(37, 99, 235, 0.08);
  animation: loaderDotBounce 1.2s infinite ease-in-out;
}

.app-loader__dots span:nth-child(1) {
  animation-delay: 0s;
}

.app-loader__dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.app-loader__dots span:nth-child(3) {
  animation-delay: 0.36s;
}

body.app-loading {
  overflow: hidden;
}

@keyframes ringSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ringSpinReverse {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes lockFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes shackleOpen {
  0%, 18%, 100% {
    transform: translateX(-50%) rotate(0deg);
  }
  30%, 60% {
    transform: translateX(-50%) rotate(-28deg);
  }
  72% {
    transform: translateX(-50%) rotate(-8deg);
  }
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes cardSweep {
  0% {
    transform: translateX(-130%);
  }
  55%, 100% {
    transform: translateX(130%);
  }
}

@keyframes loaderDotBounce {
  0%, 80%, 100% {
    transform: translateY(0) scale(0.78);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-10px) scale(1);
    opacity: 1;
  }
}

@keyframes bgFloatOne {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(16px, 12px);
  }
}

@keyframes bgFloatTwo {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-18px, -12px);
  }
}

@keyframes messageFade {
  from {
    opacity: 0.35;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 576px) {
  .app-loader__card {
    max-width: 100%;
    border-radius: 24px;
    padding: 30px 18px 24px;
  }

  .app-loader__lock-zone {
    width: 132px;
    height: 132px;
  }

  .app-loader__title {
    font-size: 20px;
  }

  .app-loader__text {
    font-size: 13px;
  }

  .app-loader__dots span {
    width: 14px;
    height: 14px;
  }
}