/* BUDGETWISE — LOADING SCREEN*/

#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0f0e0c;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.4rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

/* ── Hidden state  */
#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── Decorative corner lines ── */
#loader::before,
#loader::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-color: #d4a847;
  border-style: solid;
  opacity: 0.4;
}

#loader::before {
  top: 2rem;
  left: 2rem;
  border-width: 2px 0 0 2px;
}

#loader::after {
  bottom: 2rem;
  right: 2rem;
  border-width: 0 2px 2px 0;
}

/* ── Logo ── */
.loader-logo {
  font-family: 'Playfair Display', serif;
  font-size: 3.2rem;
  font-weight: 900;
  color: #f9f5ee;
  letter-spacing: -1px;
  animation: fadeSlideDown 0.7s ease both;
}

.loader-logo span {
  color: #d4a847;
}

/* ── Tagline ── */
.loader-tagline {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: #8a8070;
  text-transform: uppercase;
  letter-spacing: 3px;
  animation: fadeSlideDown 0.7s 0.15s ease both;
}

/* ── Progress bar track ── */
.loader-bar-track {
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  animation: fadeIn 0.5s 0.3s ease both;
}

/* ── Animated progress fill ── */
.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4a847, #c8502a);
  border-radius: 2px;
  animation: loadProgress 1.8s 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Loading status text ── */
.loader-status {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  color: #8a8070;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  min-height: 1em;
  animation: fadeIn 0.5s 0.4s ease both;
}

/* ── Four animated corner dots ── */
.loader-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.loader-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d4a847;
  opacity: 0;
  animation: dotPulse 2s ease-in-out infinite;
}

.loader-dot:nth-child(1) { top: 2.7rem;  left: 2.7rem;  animation-delay: 0s; }
.loader-dot:nth-child(2) { top: 2.7rem;  right: 2.7rem; animation-delay: 0.5s; }
.loader-dot:nth-child(3) { bottom: 2.7rem; left: 2.7rem;  animation-delay: 1s; }
.loader-dot:nth-child(4) { bottom: 2.7rem; right: 2.7rem; animation-delay: 1.5s; }

/* ── Keyframes ── */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes loadProgress {
  0%   { width: 0%; }
  30%  { width: 35%; }
  60%  { width: 65%; }
  85%  { width: 88%; }
  100% { width: 100%; }
}

@keyframes dotPulse {
  0%, 100% { opacity: 0;   transform: scale(0.6); }
  50%       { opacity: 0.7; transform: scale(1.2); }
}
