/* Preloader/Loader Styles - shared across ClientArea auth and landing pages */

@keyframes loading {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

/* Loader wrapper - hidden by default, shown with .show class */
.loader-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: none;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  contain: layout style paint;
  will-change: opacity, visibility;
}

.loader-wrap.show {
  display: block;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Preloader container */
.handle-preloader {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 9999;
  background: rgb(0, 0, 0);
}

body.auth-page .handle-preloader {
  background: rgba(10, 15, 28, 0.94);
}

.handle-preloader .animation-preloader {
  position: relative;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(320px, 85vw);
}

.preloader-logo {
  display: block;
  max-width: min(220px, 70vw);
  width: auto;
  height: auto;
  margin: 0 auto 1.25rem;
  object-fit: contain;
}

.preloader-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(192, 208, 240, 0.18);
  overflow: hidden;
  direction: ltr;
}

.preloader-bar__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    #8b9cb8 0%,
    var(--auth-metallic-shadow, #a0b0d0) 18%,
    var(--auth-metallic-mid, #c0d0f0) 40%,
    var(--auth-metallic-light, #e8eef7) 55%,
    var(--auth-metallic-mid, #c0d0f0) 72%,
    var(--auth-metallic-shadow, #a0b0d0) 100%
  );
  box-shadow: 0 0 12px rgba(232, 238, 247, 0.35);
  animation: none;
}

.loader-wrap.show .preloader-bar__fill {
  animation: loading 8s linear forwards;
  will-change: width;
}

.handle-preloader .loader-section {
  background-color: #ffffff;
  height: 100%;
  position: fixed;
  top: 0;
  width: calc(50% + 1px);
}

.preloader .loaded .animation-preloader {
  opacity: 0;
  transition: 0.3s ease-out;
}
