/* =============================================================
   TELA DE CARREGAMENTO
============================================================= */

/* -------------------------------------------------------------
   SPLASH SCREEN
------------------------------------------------------------- */
.app-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 0 12vh;
  padding: 0 0 12dvh;
  background-color: #f8e1df;
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0) 26%,
    rgba(255, 255, 255, 0) 62%,
    rgba(168, 70, 86, 0.14) 100%
  );
  box-sizing: border-box;
  opacity: 1;
  visibility: visible;
  animation: loaderBgSync 10s linear infinite;
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.65s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.app-loader-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body:has(#app-loader:not(.fade-out)) {
  overflow: hidden;
}

.loader-video-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  width: min(128vw, 900px);
  max-width: none;
}

@supports (width: min(1dvh, 1px)) {
  .loader-video-container {
    width: min(128vw, 124dvh, 900px);
  }
}

.loader-video-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: visible;
}

.loader-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 7%, #000 98.5%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 7%, #000 98.5%, transparent 100%);
  mask-composite: intersect;
  animation: loaderVideoIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.app-loader-overlay.fade-out .loader-video {
  transform: scale(1.05);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.loader-overlay-gradient {
  display: none;
}

.loader-brand-title,
.loader-sub {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.loader-content {
  position: fixed;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 40px);
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  text-align: center;
}

.loader-progress-track {
  position: relative;
  width: min(220px, 60vw);
  height: 4px;
  margin: 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(138, 43, 61, 0.16);
}

.loader-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #dca0ac, #8a2b3d);
  animation: loaderSlide 1.35s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.loader-status-text {
  color: #8a2b3d;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  opacity: 0.85;
  animation: loaderPulse 1.8s ease-in-out infinite;
}

@keyframes loaderSlide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(240%);
  }
}

@keyframes loaderVideoIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes loaderBgSync {
  0%, 25% {
    background-color: #f8e1df;
  }
  32%, 70% {
    background-color: #efd2ce;
  }
  82%, 100% {
    background-color: #f5dbd7;
  }
}

@keyframes loaderPulse {
  0%, 100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.95;
  }
}
