/* Écran de chargement — LCA TRANSCASH */

body.is-loading {
  overflow: hidden;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #272528;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

html.theme-light .loader {
  background: #FAFAF9;
}

.loader--done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: min(280px, 80vw);
  text-align: center;
}

.loader__logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  animation: loader-logo-in 0.6s ease forwards;
}

.loader__name {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  line-height: 1.1;
  animation: loader-fade-in 0.6s ease 0.15s both;
}

html.theme-light .loader__name {
  color: #1F1D20;
}

.loader__accent {
  color: #F2661A;
}

.loader__bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  animation: loader-fade-in 0.6s ease 0.3s both;
}

html.theme-light .loader__bar {
  background: rgba(39, 37, 40, 0.1);
}

.loader__bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #F2661A 0%, #C94F12 100%);
  animation: loader-progress 3s ease forwards;
}

@keyframes loader-logo-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes loader-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loader-progress {
  to {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader__logo,
  .loader__name,
  .loader__bar {
    animation: none;
  }

  .loader__bar-fill {
    animation-duration: 3s;
  }
}
