:root {
  --enf-loader-bg-a: #071a33;
  --enf-loader-bg-b: #0d4d80;
  --enf-loader-accent: #6dd8ff;
  --enf-loader-violet: #8b7cff;
}

html.enfoque-page-loading {
  overflow: hidden !important;
  background: var(--enf-loader-bg-a);
}

html.enfoque-page-loading body > *:not(.enfoque-page-loader) {
  visibility: hidden !important;
}

.enfoque-page-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(109,216,255,.16), transparent 34%),
    radial-gradient(circle at 78% 78%, rgba(139,124,255,.16), transparent 30%),
    linear-gradient(145deg, var(--enf-loader-bg-a), #0b2e55 52%, var(--enf-loader-bg-b));
  opacity: 1;
  visibility: visible;
  transition: opacity 140ms ease, visibility 140ms ease;
  isolation: isolate;
}

.enfoque-page-loader::before {
  content: "";
  position: absolute;
  inset: -45%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(-30deg, transparent 42%, rgba(255,255,255,.18) 50%, transparent 58%);
  transform: translate3d(-38%, -34%, 0);
  animation: enfLoaderGlare 950ms cubic-bezier(.2,.8,.2,1) both;
}

.enfoque-page-loader::after {
  content: "";
  position: absolute;
  width: min(46vw, 520px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow:
    0 0 0 22px rgba(109,216,255,.025),
    0 0 0 52px rgba(139,124,255,.018);
  animation: enfLoaderHalo 1s ease-in-out both;
}

.enfoque-page-loader.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.enfoque-page-loader__core {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(88vw, 520px);
  padding: 36px 30px;
}

.enfoque-page-loader__mark {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, rgba(255,255,255,.15), rgba(255,255,255,.055));
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 20px 60px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: enfLoaderMarkIn 700ms cubic-bezier(.2,.9,.2,1) both;
}

.enfoque-page-loader__mark svg {
  width: 42px;
  height: 42px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 14px rgba(109,216,255,.38));
}

.enfoque-page-loader__spark {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 16px var(--enf-loader-accent);
  opacity: 0;
  animation: enfLoaderSpark 850ms ease-out both;
}
.enfoque-page-loader__spark.s1 { --sx:-48px; --sy:-12px; animation-delay:40ms; }
.enfoque-page-loader__spark.s2 { --sx:42px; --sy:-36px; animation-delay:95ms; }
.enfoque-page-loader__spark.s3 { --sx:50px; --sy:28px; animation-delay:150ms; }
.enfoque-page-loader__spark.s4 { --sx:-38px; --sy:42px; animation-delay:205ms; }

.enfoque-page-loader__title {
  position: relative;
  margin: 0;
  color: transparent;
  font: 800 clamp(1.65rem,4vw,2.65rem)/1.05 Inter, Manrope, system-ui, sans-serif;
  letter-spacing: -.045em;
  text-align: center;
  background:
    linear-gradient(100deg, #dff8ff 0%, #fff 34%, #aee8ff 52%, #cfc8ff 72%, #fff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: enfLoaderTitleIn 650ms cubic-bezier(.2,.9,.2,1) 90ms both, enfLoaderTextFlow 1.4s linear infinite;
}

.enfoque-page-loader__sub {
  margin: -7px 0 0;
  color: rgba(226,238,255,.72);
  font: 700 .72rem/1 Inter, Manrope, system-ui, sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  animation: enfLoaderFadeUp 560ms ease 180ms both;
}

.enfoque-page-loader__track {
  position: relative;
  width: min(220px, 62vw);
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.11);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  animation: enfLoaderFadeUp 520ms ease 220ms both;
}

.enfoque-page-loader__bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: inherit;
  transform-origin: left;
  background: linear-gradient(90deg, var(--enf-loader-accent), #fff 48%, var(--enf-loader-violet));
  box-shadow: 0 0 16px rgba(109,216,255,.45);
  animation: enfLoaderProgress 850ms cubic-bezier(.18,.7,.2,1) both;
}

@keyframes enfLoaderProgress { from { transform: scaleX(.02); } to { transform: scaleX(1); } }
@keyframes enfLoaderMarkIn { from { opacity:0; transform:translateY(16px) scale(.78) rotate(-5deg); } to { opacity:1; transform:none; } }
@keyframes enfLoaderTitleIn { from { opacity:0; transform:translateY(18px); filter:blur(7px); } to { opacity:1; transform:none; filter:none; } }
@keyframes enfLoaderFadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes enfLoaderTextFlow { to { background-position:-220% 0; } }
@keyframes enfLoaderGlare { from { transform:translate3d(-44%,-38%,0); } to { transform:translate3d(42%,38%,0); } }
@keyframes enfLoaderHalo { 0% { opacity:0; transform:scale(.7); } 45% { opacity:.75; } 100% { opacity:.18; transform:scale(1.12); } }
@keyframes enfLoaderSpark {
  0% { opacity:0; transform:translate(0,0) scale(0); }
  35% { opacity:1; transform:translate(calc(var(--sx)*.55),calc(var(--sy)*.55)) scale(1); }
  100% { opacity:0; transform:translate(var(--sx),var(--sy)) scale(0); }
}

@media (prefers-reduced-motion: reduce) {
  .enfoque-page-loader *, .enfoque-page-loader::before, .enfoque-page-loader::after { animation: none !important; }
  .enfoque-page-loader__bar { transform: scaleX(1); }
}

/* SpecularButton global — aplicado aos botões em formato de pílula da intranet. */
@property --enf-specular-angle {
  syntax: '<angle>';
  initial-value: 135deg;
  inherits: false;
}

:where(button,a)[class~="btn"],
:where(button,a)[class*="btn-"],
:where(button,a)[class*="-btn"] {
  --enf-specular-angle: 135deg;
  --enf-specular-base: #0421d5;
  --enf-specular-line: #f5f5f5;
  --enf-specular-intensity: .5;
  position: relative;
  border: 3.5px solid transparent !important;
  border-radius: 11px !important;
  color: #fff !important;
  background:
    linear-gradient(var(--enf-specular-base), var(--enf-specular-base)) padding-box,
    conic-gradient(
      from var(--enf-specular-angle),
      rgba(245,245,245,.08) 0deg,
      rgba(245,245,245,.18) 18deg,
      rgba(255,255,255,.96) 34deg,
      rgba(245,245,245,.18) 58deg,
      rgba(245,245,245,.06) 88deg,
      rgba(245,245,245,.14) 180deg,
      rgba(255,255,255,.82) 214deg,
      rgba(245,245,245,.12) 245deg,
      rgba(245,245,245,.08) 360deg
    ) border-box !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -1px 0 rgba(0,0,0,.18),
    0 8px 24px rgba(0,17,120,.22) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-shadow: 0 1px 1px rgba(0,0,0,.18);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease !important;
  animation: none;
}

:where(button,a)[class~="btn"]:hover,
:where(button,a)[class*="btn-"]:hover,
:where(button,a)[class*="-btn"]:hover,
:where(button,a)[class~="btn"]:focus-visible,
:where(button,a)[class*="btn-"]:focus-visible,
:where(button,a)[class*="-btn"]:focus-visible {
  filter: brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    0 10px 30px rgba(0,17,120,.30),
    0 0 18px rgba(245,245,245,.16) !important;
}

:where(button,a)[class~="btn"]:active,
:where(button,a)[class*="btn-"]:active,
:where(button,a)[class*="-btn"]:active { transform: scale(.97); }

:where(button,a)[class~="btn"]:disabled,
:where(button,a)[class*="btn-"]:disabled,
:where(button,a)[class*="-btn"].disabled {
  opacity: .55 !important;
  cursor: default !important;
  filter: saturate(.6);
}

/* Não invade os controles estruturais do cabeçalho. */
.shared-header-nav-button,
.shared-header-profile-button,
.shared-header-search-button {
  animation: none !important;
}

@keyframes enfSpecularIdle {
  to { --enf-specular-angle: 495deg; }
}

.cadastro-mass-action-btn {
  width: 46px !important;
  min-width: 46px !important;
  height: 42px !important;
  padding: 0 !important;
  overflow: visible !important;
}

.cadastro-mass-action-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.cadastro-mass-action-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  z-index: 90;
  width: max-content;
  max-width: 220px;
  padding: 7px 10px;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 10px 28px rgba(15,23,42,.22);
  font-size: .74rem;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -5px);
  transition: opacity .16s ease, transform .16s ease;
}

.cadastro-mass-action-btn:hover::after,
.cadastro-mass-action-btn:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  :where(button,a)[class~="btn"],
  :where(button,a)[class*="btn-"],
  :where(button,a)[class*="-btn"] { animation: none !important; }
}

/* GhostFibers global: um único fundo branco compartilhado por todas as páginas, exceto a Home. */
html.enfoque-ghost-fibers-page,
html.enfoque-ghost-fibers-page body {
  min-height: 100%;
  background: #fbfcff !important;
}
.enfoque-ghost-fibers-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #fbfcff;
}
.enfoque-ghost-fibers-bg canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.enfoque-ghost-fibers-bg.is-fallback {
  background:
    radial-gradient(circle at 18% 12%, rgba(197,205,222,.26), transparent 34%),
    radial-gradient(circle at 82% 84%, rgba(221,226,238,.28), transparent 38%),
    #fbfcff;
}

/* Remove apenas fundos estruturais de página. Cards, tabelas, modais e componentes continuam por cima. */
html.enfoque-ghost-fibers-page body,
html.enfoque-ghost-fibers-page body > .layout,
html.enfoque-ghost-fibers-page body > .app-container,
html.enfoque-ghost-fibers-page body > .content-wrap,
html.enfoque-ghost-fibers-page .layout,
html.enfoque-ghost-fibers-page .app-container,
html.enfoque-ghost-fibers-page .content-wrap,
html.enfoque-ghost-fibers-page .main-content,
html.enfoque-ghost-fibers-page .page-main,
html.enfoque-ghost-fibers-page main:not(.card):not(.panel) {
  background: transparent !important;
  background-image: none !important;
}
html.enfoque-ghost-fibers-page body::before,
html.enfoque-ghost-fibers-page body::after,
html.enfoque-ghost-fibers-page .layout::before,
html.enfoque-ghost-fibers-page .layout::after,
html.enfoque-ghost-fibers-page .content-wrap::before,
html.enfoque-ghost-fibers-page .content-wrap::after,
html.enfoque-ghost-fibers-page .page-main::before,
html.enfoque-ghost-fibers-page .page-main::after {
  background: transparent !important;
  background-image: none !important;
}
html.enfoque-ghost-fibers-page body > .layout,
html.enfoque-ghost-fibers-page body > .app-container,
html.enfoque-ghost-fibers-page body > main,
html.enfoque-ghost-fibers-page body > header,
html.enfoque-ghost-fibers-page body > section {
  position: relative;
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  .enfoque-ghost-fibers-bg canvas { opacity: .88; }
}
