/* =============================================
   SwiftPOS - Loading Screen CSS
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #4174B4;
  --blue-light: #5B8BC8;
  --orange: #F79325;
  --dark: #0a0d1f;
  --dark2: #0f1535;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--dark);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* ---- Animated gradient background ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(65,116,180,0.35) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(247,147,37,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(91,139,200,0.10) 0%, transparent 70%)
    linear-gradient(135deg, #070b1a 0%, #0f1535 50%, #0a0d1f 100%);
  animation: bgShift 8s ease-in-out infinite alternate;
}
@keyframes bgShift {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(30deg); }
}

/* ---- Grid overlay ---- */
.grid-overlay {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(65,116,180,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(65,116,180,0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
}
@keyframes gridMove {
  0%   { transform: translateY(0); }
  100% { transform: translateY(60px); }
}

/* ---- Floating orbs ---- */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: orbFloat 10s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: rgba(65,116,180,0.2);   top: -150px; left: -150px;  animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: rgba(247,147,37,0.15);  bottom: -100px; right: -100px; animation-delay: -4s; }
.orb-3 { width: 300px; height: 300px; background: rgba(91,139,200,0.12);  top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -7s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -20px) scale(1.05); }
  66%  { transform: translate(-20px, 30px) scale(0.95); }
}

/* ---- Particles ---- */
.bg-particles { position: fixed; inset: 0; pointer-events: none; }
.particle {
  position: absolute;
  width: 2px; height: 2px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  animation: particleDrift linear infinite;
}
.particle-1  { left:5%;  top:10%; animation-duration:12s; animation-delay:0s;   width:1px; height:1px; }
.particle-2  { left:15%; top:80%; animation-duration:16s; animation-delay:-3s;  }
.particle-3  { left:25%; top:30%; animation-duration:10s; animation-delay:-6s;  width:3px; height:3px; background:rgba(91,139,200,0.6); }
.particle-4  { left:35%; top:60%; animation-duration:14s; animation-delay:-1s;  }
.particle-5  { left:45%; top:20%; animation-duration:18s; animation-delay:-8s;  width:1px; height:1px; }
.particle-6  { left:55%; top:75%; animation-duration:11s; animation-delay:-4s;  width:3px; height:3px; background:rgba(247,147,37,0.5); }
.particle-7  { left:65%; top:40%; animation-duration:15s; animation-delay:-2s;  }
.particle-8  { left:75%; top:15%; animation-duration:9s;  animation-delay:-7s;  width:1px; height:1px; }
.particle-9  { left:85%; top:55%; animation-duration:13s; animation-delay:-5s;  width:2px; height:2px; }
.particle-10 { left:92%; top:85%; animation-duration:17s; animation-delay:-9s;  width:1px; height:1px; }
.particle-11 { left:8%;  top:45%; animation-duration:20s; animation-delay:-11s; width:3px; height:3px; background:rgba(247,147,37,0.5); }
.particle-12 { left:20%; top:90%; animation-duration:12s; animation-delay:-3s;  }
.particle-13 { left:40%; top:5%;  animation-duration:16s; animation-delay:-6s;  width:2px; height:2px; }
.particle-14 { left:60%; top:95%; animation-duration:8s;  animation-delay:-2s;  width:1px; height:1px; }
.particle-15 { left:78%; top:70%; animation-duration:14s; animation-delay:-9s;  width:3px; height:3px; background:rgba(91,139,200,0.5); }
.particle-16 { left:90%; top:30%; animation-duration:11s; animation-delay:-4s;  }
.particle-17 { left:30%; top:50%; animation-duration:19s; animation-delay:-7s;  width:1px; height:1px; }
.particle-18 { left:50%; top:40%; animation-duration:13s; animation-delay:-1s;  width:2px; height:2px; background:rgba(247,147,37,0.6); }
.particle-19 { left:70%; top:25%; animation-duration:15s; animation-delay:-8s;  }
.particle-20 { left:12%; top:65%; animation-duration:10s; animation-delay:-5s;  width:3px; height:3px; }

@keyframes particleDrift {
  0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

/* ---- Main loader wrap ---- */
.loader-wrap {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: wrapIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
@keyframes wrapIn {
  from { opacity: 0; transform: scale(0.8) translateY(30px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---- Logo with rings ---- */
.logo-container {
  position: relative;
  width: 130px; height: 130px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 32px;
}

.ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}
.ring-1 {
  width: 130px; height: 130px;
  border-color: rgba(65,116,180,0.6) transparent transparent transparent;
  animation: spinRing 2s linear infinite;
}
.ring-2 {
  width: 110px; height: 110px;
  border-color: transparent rgba(247,147,37,0.5) transparent transparent;
  animation: spinRing 1.5s linear infinite reverse;
}
.ring-3 {
  width: 90px; height: 90px;
  border-color: rgba(247,147,37,0.4) transparent rgba(247,147,37,0.4) transparent;
  animation: spinRing 3s linear infinite;
}
@keyframes spinRing {
  to { transform: rotate(360deg); }
}

.logo-icon {
  width: 72px; height: 72px;
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    #5B8BC8 0%,
    #4174B4 50%,
    #F79325 100%
  );
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 40px rgba(65,116,180,0.6), 0 0 80px rgba(65,116,180,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  animation: iconPulse 3s ease-in-out infinite;
}
@keyframes iconPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(65,116,180,0.6), 0 0 80px rgba(65,116,180,0.3); transform: scale(1); }
  50%       { box-shadow: 0 0 60px rgba(65,116,180,0.9), 0 0 120px rgba(65,116,180,0.5); transform: scale(1.04); }
}
.logo-icon svg { width: 36px; height: 36px; }

.logo-badge {
  position: absolute; top: -2px; right: -2px;
  width: 28px; height: 28px;
  background: linear-gradient(
    135deg,
    #F79325,
    #FFB04A
  );
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  box-shadow: 0 4px 15px rgba(247,147,37,0.6);
  animation: badgeBounce 2s ease-in-out infinite;
}
@keyframes badgeBounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%       { transform: scale(1.15) rotate(15deg); }
}

/* ---- Brand name letters ---- */
.brand-name {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
}
.letter {
  font-family: 'Poppins', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  color: #e2e8f0;
  display: inline-block;
  animation: letterDrop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  animation-delay: calc(var(--i) * 0.07s);
  text-shadow: 0 0 30px rgba(255,255,255,0.2);
}
.letter.pink {
  background: linear-gradient(
    135deg,
    #4174B4,
    #F79325
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 12px rgba(65,116,180,0.5));
}
@keyframes letterDrop {
  from { opacity: 0; transform: translateY(-30px) rotateX(90deg); }
  to   { opacity: 1; transform: translateY(0) rotateX(0deg); }
}

.brand-sub {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(148,163,184,0.7);
  margin-bottom: 40px;
  animation: fadeInUp 0.6s 0.6s ease both;
}

/* ---- Progress ---- */
.progress-section {
  width: 320px;
  animation: fadeInUp 0.6s 0.7s ease both;
}
.progress-track {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
  border: 1px solid rgba(255,255,255,0.05);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    #4174B4,
    #5B8BC8,
    #F79325
  );
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
}
.progress-glow {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: progressGlow 2s ease-in-out infinite;
}
@keyframes progressGlow {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.progress-shine {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  z-index: 3;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}
.progress-msg { color: rgba(148,163,184,0.8); }
.progress-pct {
  font-weight: 700;
  background: #F79325;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Bouncing dots ---- */
.bounce-dots {
  display: flex;
  gap: 6px;
  margin-top: 28px;
  animation: fadeInUp 0.6s 0.9s ease both;
}
.bdot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    #4174B4,
    #F79325
  );
  animation: bounce 1.4s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(65,116,180,0.5);
}
.bdot:nth-child(1) { animation-delay: 0s; }
.bdot:nth-child(2) { animation-delay: 0.14s; }
.bdot:nth-child(3) { animation-delay: 0.28s; }
.bdot:nth-child(4) { animation-delay: 0.42s; }
.bdot:nth-child(5) { animation-delay: 0.56s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6) translateY(0); opacity: 0.4; }
  40%           { transform: scale(1.1) translateY(-10px); opacity: 1; }
}

/* ---- Version ---- */
.version-tag {
  margin-top: 20px;
  font-size: 0.68rem;
  color: rgba(148,163,184,0.4);
  letter-spacing: 0.1em;
  animation: fadeInUp 0.6s 1s ease both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Page exit animation ---- */
body.exit {
  animation: pageExit 0.6s ease forwards;
}
@keyframes pageExit {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}