.swal2-container {
  z-index: 1502 !important;
}

/* Loading Screen - Modern Design with Advanced Animations */
#initial-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: "Inter", "Lato", sans-serif;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: radial-gradient(
    circle at 35% 35%,
    rgba(12, 32, 48, 0.6),
    rgba(6, 14, 22, 0.8)
  );
  backdrop-filter: blur(3px) saturate(150%);
  -webkit-backdrop-filter: blur(3px) saturate(150%);
}

#initial-loading-screen.fade-out {
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
}

#initial-loading-screen .sf-loader-card {
  backdrop-filter: blur(12px) brightness(1.05);
  -webkit-backdrop-filter: blur(12px) brightness(1.05);
  background: linear-gradient(
    135deg,
    rgba(12, 22, 32, 0.7) 0%,
    rgba(18, 28, 38, 0.6) 100%
  );
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset, 0 0 20px rgba(8, 151, 233, 0.15);
  border-radius: 16px;
  padding: 20px 24px 22px;
  min-width: 280px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto;
  animation: cardPulse 3s ease-in-out infinite;
}

.sf-loader-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.loading-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  position: relative;
}

.loading-logo svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(8, 151, 233, 0.4));
  animation: logoSpin 8s linear infinite, logoPulse 2s ease-in-out infinite;
}

/* Spinner adicional ao redor do logo */
.loading-logo::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(8, 151, 233, 0.6);
  border-right-color: rgba(66, 196, 255, 0.4);
  animation: spinnerRotate 1.2s linear infinite;
}

.loading-logo::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px dashed rgba(8, 151, 233, 0.3);
  animation: spinnerRotate 2s linear infinite reverse;
}

.loading-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.6px;
  background: linear-gradient(120deg, #fff, #cfe9ff, #0897e9);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
  animation: textShimmer 3s ease-in-out infinite;
}

.loading-subtitle {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: #b5d4e8;
  font-weight: 500;
  opacity: 0.9;
  animation: subtitleFade 2s ease-in-out infinite;
}

.loading-progress {
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #1c2d3a, #12202b);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) inset;
}

.loading-progress::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: progressSweep 2s ease-in-out infinite;
}

.loading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    #0897e9,
    #42c4ff,
    #0ae9ff,
    #42c4ff,
    #0897e9
  );
  background-size: 300% 100%;
  animation: progressAnim 2s linear infinite,
    progressShimmer 1.5s ease-in-out infinite;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(8, 151, 233, 0.6), 0 0 6px rgba(66, 196, 255, 0.4);
  border-radius: 5px;
  position: relative;
}

.loading-progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: barGloss 1.5s ease-in-out infinite;
}

.loading-text {
  margin: 4px 0 0;
  font-size: 0.7rem;
  font-weight: 500;
  color: #d9ecf9;
  letter-spacing: 0.6px;
  opacity: 0.9;
  animation: textFade 2s ease-in-out infinite;
  text-align: center;
}

/* Keyframe Animations */
@keyframes progressAnim {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -300% 0;
  }
}

@keyframes progressShimmer {
  0%,
  100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.3) saturate(1.2);
  }
}

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

@keyframes barGloss {
  0%,
  100% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
}

@keyframes textFade {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

@keyframes subtitleFade {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardPulse {
  0%,
  100% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.05) inset,
      0 0 20px rgba(8, 151, 233, 0.15);
  }
  50% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.08) inset,
      0 0 30px rgba(8, 151, 233, 0.25);
  }
}

@keyframes logoSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes logoPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(8, 151, 233, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(8, 151, 233, 0.7));
  }
}

@keyframes spinnerRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes textShimmer {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

@media (max-width: 640px) {
  #initial-loading-screen {
    padding: 16px;
  }
  #initial-loading-screen .sf-loader-card {
    width: 100%;
    max-width: 340px;
    padding: 18px 20px;
  }
  .loading-logo {
    width: 44px;
    height: 44px;
  }
  .loading-title {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #initial-loading-screen,
  .sf-loader-card,
  .loading-logo svg,
  .loading-logo::before,
  .loading-logo::after,
  .loading-title,
  .loading-subtitle,
  .loading-progress-bar,
  .loading-text {
    animation: none !important;
    transition: none !important;
  }
}
