/* =============================================
   iSEMED - Novo Loader Centralizado 2025
   Ordem: Logo → Subtítulo → Spinner Sync → Texto
   ============================================= */

:root {
  --primary:     #000099;        /* sua cor principal */
  --primary-dark:#000066;
  --accent:      #3d5afe;
  --text:        #1a1f36;
  --muted:       #6b7280;
  --bg:          #f9fbff;
  --white:       #ffffff;
  --radius:      16px;
  --shadow:      0 12px 40px rgba(0,0,153,0.12);
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* Overlay ocupa tela inteira e centraliza verticalmente */
.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease);
}

/* Conteúdo principal - centralizado, largura máxima confortável */
.loader-content {
  width: 100%;
  max-width: 780px;
  text-align: center;
  padding: 40px 30px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,0,153,0.08);
}

/* 1. ISEMED grande */
.logo {
  font-size: clamp(4.8rem, 10vw, 7.2rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--primary);
  line-height: 0.95;
  margin-bottom: 12px;
}

/* 2. Subtítulo */
.subtitle {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 50px;
  line-height: 1.3;
}

/* 3. Ícone de sincronização girando (estilo preload moderno) */
.sync-spinner {
  width: 90px;
  height: 90px;
  margin: 0 auto 30px;
  position: relative;
}

.sync-spinner svg {
  width: 100%;
  height: 100%;
  animation: rotate 2.2s linear infinite;
}

.sync-spinner circle {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 1, 150;
  stroke-dashoffset: 0;
  animation: dash 1.8s ease-in-out infinite;
}

/* 4. Texto de preload */
.preload-text {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
  opacity: 0.9;
}

/* Animações */
@keyframes rotate {
  100% { transform: rotate(360deg); }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* Responsivo */
@media (max-width: 640px) {
  .loader-content {
    padding: 35px 24px;
    margin: 0 16px;
  }
  .logo {
    font-size: clamp(4rem, 12vw, 5.5rem);
  }
  .subtitle {
    font-size: 1.6rem;
  }
  .sync-spinner {
    width: 78px;
    height: 78px;
  }
}
/* Barra de progresso - minimalista e combinando com o tema */
.progress-container {
  width: 100%;
  max-width: 420px;
  height: 8px;
  background: rgba(0, 0, 153, 0.08); /* fundo sutil com sua cor primary */
  border-radius: 999px;
  overflow: hidden;
  margin: 28px auto 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.progress-bar {
  height: 100%;
  width: 0%;                    /* começa em 0% */
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.4s ease-out;
  position: relative;
}

/* Efeito de brilho sutil passando (opcional, mas deixa mais vivo) */
.progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shine 2.8s infinite linear;
}

/* Animação de brilho */
@keyframes shine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* Acessibilidade: menos movimento */
@media (prefers-reduced-motion: reduce) {
  .sync-spinner svg {
    animation: none;
  }
  .sync-spinner circle {
    animation: none;
  }
}