/* Morph Template Style — Liquid Morph Preloader */
.ajt-loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #03060e;
  overflow: hidden;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.7s;
}
.ajt-loader.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ambient mesh */
.loader-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 30% 40%, rgba(22, 163, 74, 0.18), transparent 60%),
    radial-gradient(ellipse 45% 35% at 70% 60%, rgba(255, 215, 0, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(15, 23, 42, 0.9), transparent 70%);
  animation: meshPulse 4s ease-in-out infinite;
}
@keyframes meshPulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

/* Liquid morph blobs — Morph Template style */
.morph-canvas {
  position: absolute;
  width: min(560px, 95vw);
  height: min(560px, 95vw);
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.morph-blob {
  position: absolute;
  width: 70%;
  height: 70%;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  filter: blur(28px);
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: morphBlob 6s ease-in-out infinite;
}
.morph-blob-1 {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.85), rgba(255, 215, 0, 0.55));
  animation-duration: 5s;
}
.morph-blob-2 {
  width: 78%;
  height: 78%;
  background: linear-gradient(225deg, rgba(255, 215, 0, 0.7), rgba(74, 222, 128, 0.45));
  animation-duration: 7s;
  animation-direction: reverse;
  animation-delay: -2s;
  opacity: 0.4;
  filter: blur(36px);
}
.morph-blob-3 {
  width: 55%;
  height: 55%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.5), rgba(22, 163, 74, 0.2));
  animation-duration: 4s;
  animation-delay: -1s;
  opacity: 0.5;
  filter: blur(20px);
}
@keyframes morphBlob {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: rotate(0deg) scale(1) translate(0, 0);
  }
  25% {
    border-radius: 30% 70% 55% 45% / 40% 55% 45% 60%;
    transform: rotate(45deg) scale(1.08) translate(12px, -8px);
  }
  50% {
    border-radius: 50% 50% 35% 65% / 55% 40% 60% 45%;
    transform: rotate(90deg) scale(0.94) translate(-10px, 14px);
  }
  75% {
    border-radius: 40% 60% 65% 35% / 50% 65% 35% 50%;
    transform: rotate(135deg) scale(1.1) translate(8px, 6px);
  }
}

/* Glass morph card */
.loader-glass {
  position: relative;
  z-index: 2;
  width: min(340px, 88vw);
  padding: 2.75rem 2rem 2.25rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 28px;
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 80px rgba(0, 0, 0, 0.45),
    0 0 60px rgba(255, 215, 0, 0.08);
  opacity: 0;
  transform: translateY(24px) scale(0.92);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.ajt-loader.reveal .loader-glass {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.loader-glass::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 28px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.45), transparent 40%, transparent 60%, rgba(74, 222, 128, 0.35));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: borderGlow 3s linear infinite;
}
@keyframes borderGlow {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Logo area — full branded logo */
.loader-logo-wrap {
  position: relative;
  width: min(220px, 70vw);
  height: auto;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader-ring,
.loader-ring-2 {
  display: none;
}
.loader-logo {
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(255, 215, 0, 0.45));
  animation: logoPulse 2.2s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.35)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.75)); transform: scale(1.03); }
}

.loader-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  letter-spacing: 3px;
  background: linear-gradient(105deg, #FFD700 0%, #FFF8C8 40%, #4ADE80 70%, #FFD700 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerText 2.8s linear infinite;
}
@keyframes shimmerText {
  to { background-position: 220% center; }
}

.loader-sub {
  margin-top: 0.45rem;
  color: rgba(148, 163, 184, 0.95);
  font-size: 0.72rem;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Percent + liquid progress */
.loader-progress {
  margin-top: 1.75rem;
}
.loader-percent {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  color: #FFD700;
  letter-spacing: 1px;
  text-shadow: 0 0 24px rgba(255, 215, 0, 0.45);
  line-height: 1;
}
.loader-percent span {
  display: inline-block;
  min-width: 2.2ch;
}
.loader-percent small {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.8;
  margin-left: 1px;
}

.loader-bar {
  position: relative;
  width: 100%;
  height: 6px;
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
}
.loader-bar-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 8px;
  background: linear-gradient(90deg, #16A34A, #4ADE80, #FFD700);
  background-size: 200% 100%;
  animation: barShine 1.5s linear infinite;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.5);
  transition: width 0.12s linear;
}
.loader-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55));
  filter: blur(2px);
}
@keyframes barShine {
  to { background-position: 200% center; }
}

.loader-hint {
  margin-top: 0.85rem;
  font-size: 0.7rem;
  color: #64748B;
  letter-spacing: 1px;
  font-weight: 500;
}

/* Floating particles */
.loader-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.loader-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #FFD700;
  opacity: 0.35;
  animation: particleFloat 8s linear infinite;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}
.loader-particle:nth-child(odd) { background: #4ADE80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.5); }
.loader-particle:nth-child(1) { left: 12%; animation-duration: 7s; animation-delay: 0s; }
.loader-particle:nth-child(2) { left: 28%; animation-duration: 9s; animation-delay: -2s; width: 3px; height: 3px; }
.loader-particle:nth-child(3) { left: 45%; animation-duration: 6.5s; animation-delay: -4s; }
.loader-particle:nth-child(4) { left: 62%; animation-duration: 8.5s; animation-delay: -1s; width: 5px; height: 5px; }
.loader-particle:nth-child(5) { left: 78%; animation-duration: 7.5s; animation-delay: -3s; }
.loader-particle:nth-child(6) { left: 88%; animation-duration: 10s; animation-delay: -5s; width: 3px; height: 3px; }
@keyframes particleFloat {
  0% { transform: translateY(110vh) scale(0.5); opacity: 0; }
  15% { opacity: 0.4; }
  85% { opacity: 0.35; }
  100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

/* Exit morph zoom */
.ajt-loader.exit .loader-glass {
  opacity: 0;
  transform: scale(1.15);
  transition: all 0.55s ease;
}
.ajt-loader.exit .morph-canvas {
  opacity: 0;
  transform: scale(1.4);
  transition: all 0.7s ease;
  filter: blur(20px);
}
