/* Portal X — Loader global (Lottie).
   Infra compartilhada por todas as telas. Consumido via window.PortalXLoader.
   Aplicar aos poucos por tela; nada roda sozinho até chamar a API. */

:root {
  --pxl-backdrop: rgba(15, 47, 92, 0.28);
  --pxl-backdrop-blur: 3px;
  --pxl-panel-bg: rgba(255, 255, 255, 0.92);
  --pxl-panel-shadow: 0 18px 48px -18px rgba(15, 47, 92, 0.45);
  --pxl-text: var(--brand-primary, #0f2f5c);
}

/* ---- Overlay de tela cheia ---------------------------------------------- */
.pxl-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pxl-backdrop);
  -webkit-backdrop-filter: blur(var(--pxl-backdrop-blur));
  backdrop-filter: blur(var(--pxl-backdrop-blur));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}
.pxl-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.18s ease;
}

.pxl-overlay__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 30px;
  border-radius: 18px;
  background: var(--pxl-panel-bg);
  box-shadow: var(--pxl-panel-shadow);
  transform: translateY(6px) scale(0.98);
  transition: transform 0.18s ease;
}
.pxl-overlay.is-visible .pxl-overlay__panel {
  transform: translateY(0) scale(1);
}
/* Variante sem painel (só a animação sobre o fundo) */
.pxl-overlay--bare .pxl-overlay__panel {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.pxl-overlay__label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--pxl-text);
}

/* ---- Animação (canvas do lottie) ---------------------------------------- */
.pxl-anim {
  width: 96px;
  height: 96px;
  display: block;
}
.pxl-anim svg {
  display: block;
}

/* ---- Loader inline (dentro de um container/tabela/card) ----------------- */
.pxl-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  width: 100%;
  color: var(--pxl-text);
}
.pxl-inline .pxl-anim {
  width: 72px;
  height: 72px;
}
.pxl-inline__label {
  font-size: 0.8rem;
  font-weight: 600;
}

/* Tamanhos utilitários */
.pxl-anim--sm { width: 48px; height: 48px; }
.pxl-anim--lg { width: 140px; height: 140px; }

/* Fallback CSS (usado só se o lottie não carregar) */
.pxl-fallback-spin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(15, 47, 92, 0.18);
  border-top-color: var(--brand-accent, #1353d8);
  animation: pxl-spin 0.75s linear infinite;
}
@keyframes pxl-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .pxl-overlay,
  .pxl-overlay__panel {
    transition: none;
  }
}
