* { box-sizing: border-box; margin: 0; padding: 0; }

body { margin: 0; }

html { overflow-x: hidden; overflow-y: scroll; }

#loading-bg {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  z-index: 9999;
  overflow: hidden;
}

/* ── Top shimmer bar ── */
.loader-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1a3a6b 0%, #e85d24 50%, #1a3a6b 100%);
  background-size: 200% 100%;
  animation: bar-slide 2s linear infinite;
}

/* ── Center wrapper ── */
.loader-center {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Pulse rings behind logo ── */
.loader-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.loader-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(26, 58, 107, 0.12);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: ring-pulse 3s ease-out infinite;
}

.loader-ring:nth-child(1) { width: 160px; height: 160px; animation-delay: 0s; }
.loader-ring:nth-child(2) { width: 220px; height: 220px; animation-delay: 0.8s; }
.loader-ring:nth-child(3) { width: 280px; height: 280px; animation-delay: 1.6s; }

/* ── Logo ── */
.loading-logo {
  position: relative;
  z-index: 2;
  animation: logo-enter 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
  transform: translateY(20px) scale(0.94);
  margin-bottom: 36px;
}

.loading-logo img {
  height: 78px;
  width: auto;
  animation: logo-breathe 3s ease-in-out 0.8s infinite;
}

/* ── Progress bar ── */
.loader-progress-track {
  width: 220px;
  height: 3px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
  opacity: 0;
  animation: fade-in 0.4s ease 0.7s forwards;
  margin-bottom: 24px;
}

.loader-progress-fill {
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, #1a3a6b, #e85d24);
  border-radius: 99px;
  animation: progress-run 1.8s ease-in-out infinite;
}

/* ── Cycling text ── */
.loader-messages {
  height: 20px;
  overflow: hidden;
  opacity: 0;
  animation: fade-in 0.4s ease 0.9s forwards;
}

.loader-message {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-align: center;
  height: 20px;
  line-height: 20px;
  animation: msg-cycle 12s linear infinite;
}

/* ── Dots ── */
.loader-dots {
  display: flex;
  gap: 7px;
  margin-top: 24px;
  opacity: 0;
  animation: fade-in 0.4s ease 1.1s forwards;
}

.loader-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  animation: dot-wave 1.5s ease-in-out infinite;
}

.loader-dots span:nth-child(1) { background: #1a3a6b; animation-delay: 0s; }
.loader-dots span:nth-child(2) { background: #e85d24; animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { background: #1a3a6b; animation-delay: 0.4s; }

/* ── Bottom tagline ── */
.loader-bottom {
  position: absolute;
  bottom: 28px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 11px;
  color: #cbd5e1;
  letter-spacing: 1px;
  opacity: 0;
  animation: fade-in 0.4s ease 1.3s forwards;
}

/* Hide old spinner */
.loading { display: none !important; }

/* ══ Keyframes ══════════════════════════════════════ */

@keyframes bar-slide {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@keyframes logo-enter {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes logo-breathe {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 4px 12px rgba(26,58,107,0)); }
  50%       { transform: scale(1.03); filter: drop-shadow(0 8px 24px rgba(26,58,107,0.12)); }
}

@keyframes ring-pulse {
  0%   { transform: translate(-50%,-50%) scale(0); opacity: 0.6; }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 0; }
}


@keyframes fade-in {
  to { opacity: 1; }
}

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

@keyframes dot-wave {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.4; }
  30%            { transform: translateY(-8px); opacity: 1; }
}

@keyframes msg-cycle {
  0%,  20%  { transform: translateY(0px);  opacity: 1; }
  25%        { transform: translateY(-20px); opacity: 0; }
  26%        { transform: translateY(20px);  opacity: 0; }
  30%, 45%  { transform: translateY(0px);  opacity: 1; }
  50%        { transform: translateY(-20px); opacity: 0; }
  51%        { transform: translateY(20px);  opacity: 0; }
  55%, 70%  { transform: translateY(0px);  opacity: 1; }
  75%        { transform: translateY(-20px); opacity: 0; }
  76%        { transform: translateY(20px);  opacity: 0; }
  80%, 95%  { transform: translateY(0px);  opacity: 1; }
  100%       { transform: translateY(-20px); opacity: 0; }
}
