/* ============================================================
   AlocPro - Dark mode (inversao inteligente de cores)
   Ativado pela classe .theme-dark no <html> (toggle: dark-mode.js).

   Por que inversao? Num sistema legado com centenas de cores fixas
   (CSS + inline + Wicket), a inversao GARANTE contraste: texto escuro
   sobre claro vira texto claro sobre escuro -> nenhum texto "some".
   Aplicada no <html> (nao no body) para NAO quebrar position:fixed
   (modais, dropdowns, overlays continuam funcionando).
   ============================================================ */

html.theme-dark {
  filter: invert(0.87) hue-rotate(180deg);
  background-color: #ffffff;
}

html.theme-dark img,
html.theme-dark picture,
html.theme-dark video,
html.theme-dark canvas,
html.theme-dark iframe,
html.theme-dark embed,
html.theme-dark object,
html.theme-dark svg image,
html.theme-dark .naoInverterTema {
  filter: invert(1) hue-rotate(180deg);
}

/* Botao flutuante de tema - "superficie invertida": sempre contrasta com o fundo.
   MODO CLARO (regra base): botao ESCURO + lua -> destaca no branco.
   #themeToggle esta na lista de re-inversao (acima), entao no dark o declarado
   aparece ~direto (WYSIWYG); por isso a variacao dark fica logo abaixo. */
#themeToggle {
  position: fixed;
  right: 5px;
  bottom: 30px;
  z-index: 99999;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1f2635;
  color: #fcd34d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 22px -6px rgba(0, 0, 0, 0.45);
  font-size: 21px;
  line-height: 1;
  transition:
    transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    background-color 0.25s ease,
    color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}
#themeToggle:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 14px 32px -8px rgba(0, 0, 0, 0.55);
}
#themeToggle:active {
  transform: scale(0.9);
}

html.theme-dark #themeToggle {
  color: #ff5e00;
}

html.theme-dark #topo {
  filter: invert(1) hue-rotate(180deg);
}

html.theme-dark #topo #logo {
  filter: none;
}

html.theme-dark #div_sub {
  position: relative;
}
html.theme-dark #div_sub .submenu ul {
  top: -3px;
  margin-top: 0;
}

html.theme-dark #div_sub .submenu ul li a,
html.theme-dark #div_sub .submenu ul li a span {
  color: #000000 !important;
  filter: none !important;
}
