/* ==========================================================================
   1. VARIABLES & SETUP
   ========================================================================== */

:root {
  --brand-primary: #30599b;   /* azul principal GOV */
  --brand-secondary: #203a5b; /* azul escuro */
  --brand-accent: #00a3e0;    /* ciano destaque */
  --brand-bg: #f7fafc;        /* fundo claro */
  --text-on-primary: #ffffff;
}

/* Reset & Base Layout */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   2. GLOBAL COMPONENTS & UTILITIES
   ========================================================================== */

/* --- Sticky Footer Logic --- */
/* Força o conteúdo principal a crescer e empurrar o rodapé */
.main, [role="main"] {
  flex: 1 0 auto;
}

/* Garante que o rodapé não encolha */
.site-footer, .footer-bottom {
  flex-shrink: 0;
}

/* --- Buttons --- */
.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background-color: var(--brand-secondary);
  border-color: var(--brand-secondary);
}

.btn-outline-primary {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--brand-primary);
}

/* --- Tables & Data Views --- */
.prose table,
.table-responsive-wrapper table,
.ckanext-datapreview table {
  display: block;
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.ckanext-datapreview iframe,
.data-viewer-error,
.resource-view {
  max-width: 100% !important;
  width: 100%;
}

/* --- Tailwind Polyfill Classes --- */
.tw\:grid { display: grid; }
.tw\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tw\:w-\[100\%\] { width: 100%; }
.tw\:h-\[4px\] { height: 14px; }
.tw\:bg-yellow-300 { background-color: #ffeb36; }
.tw\:bg-red-600 { background-color: #f72930; }
.tw\:bg-blue-400 { background-color: #399fe8; }
.tw\:bg-green-500 { background-color: #00dc58; }
.tw\:bg-black { background-color: #0f0a0a; }

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */

/* --- Layout Base --- */
.header-layout {
  padding: 32px 0px;
}

@media (max-width: 1400px) {
  .header-layout {
    justify-content: center;
  }
}

/* Remove default CKAN masthead styles if applied elsewhere */
.account-masthead {
  display: none !important;
}

/* --- Navigation Links & Styles --- */
.custom-header .navbar-nav {
  gap: 6rem; /* Padrão Desktop */
}

.custom-header .navbar-nav .nav-link {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  padding-left: 0;
  padding-right: 0;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  position: relative; /* Base para o sublinhado */
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.2s ease;
  border-bottom: none;
}

/* Optical Fixes */
.nav-icon-optical-fix {
  transform: translateY(1px);
}

/* Indicador (Underline) com Animação */
.custom-header .navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0px;
  left: 0;
  width: 0%; /* Inicia invisível */
  height: 3px;
  background-color: #85c1e9;
  transition: width 0.2s ease-in-out;
}

.custom-header .navbar-nav .nav-link:hover {
  opacity: 1;
  color: #ffffff;
  background-color: transparent;
  box-shadow: none;
  transform: none;
}

/* Estado Ativo e Hover: Expande a barra */
.custom-header .navbar-nav .nav-link:hover::after,
.custom-header .navbar-nav .nav-link.active::after,
.custom-header .navbar-nav .nav-item.active .nav-link::after {
  width: 100%;
}

.custom-header .navbar-nav .nav-link.active,
.custom-header .navbar-nav .nav-item.active .nav-link {
  color: #ffffff;
  font-weight: 600;
  opacity: 1;
  background-color: transparent;
  box-shadow: none;
  transform: none;
  border-radius: 0;
  border-bottom: none;
}

/* FIX: Remover animação de sublinhado do ícone de perfil/login */
#navbarDropdown::after {
  content: none !important;
  display: none !important;
}

/* --- Header Search Bar (Desktop) --- */
.header-input-search,
.header-btn-search {
  min-height: 61px;
}

.header-input-search {
  border-top-left-radius: 36px;
  border-bottom-left-radius: 36px;
  border: 1px solid var(--brand-primary);
  padding: 8px 32px;
  min-width: 325px;
}

.header-btn-search {
  border-top-right-radius: 36px;
  border-bottom-right-radius: 36px;
  border: 1px solid var(--brand-primary);
  padding: 8px 0px 8px 12px;
  min-width: 170px;
  background-color: var(--brand-primary);
  color: #fff;
}

.header-btn-search-icon {
  min-width: 18px;
}

/* Container Wrapper for Search */
.header-search-wrapper {
  flex: 1;
  margin: 0 30px;
}

.header-search-form {
  display: flex;
  width: 100%;
}

.header-search-input {
  width: 100%;
  padding: 10px 20px;
  border: 1px solid #ccc;
  border-right: none;
  border-radius: 25px 0 0 25px;
}

.header-search-btn {
  background-color: #30599B;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 0 25px 25px 0;
  cursor: pointer;
}

/* --- Header Responsiveness --- */

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .custom-header .navbar-nav {
    gap: 2rem;
  }
  .custom-header .navbar-nav .nav-link {
    font-size: 0.9rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767.98px) {
  .custom-header .navbar-nav {
    gap: 0;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .custom-header .navbar-nav .nav-link {
    justify-content: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .custom-header .navbar-nav .nav-item:last-child .nav-link {
    border-bottom: none;
  }
  .navbar-toggler {
    margin-top: 10px;
    margin-bottom: 10px;
  }
  .header-utilities {
    display: none !important;
  }
  .header-logo {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .header-btn-search {
    min-width: 54px; /* Ajuste específico para search btn mobile */
  }
}

/* ==========================================================================
   4. HEADER TOOLS, ACCESSIBILITY & LOGOS
   ========================================================================== */

/* --- Logos --- */
.header-logo {
  max-width: 450px !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  height: auto;
}

.header-logo a {
  padding-top: 2px !important;
  padding-bottom: 2px !important;
  display: flex;
  align-items: center;
}

.logo-governo-header {
  height: 75px !important;
  width: auto !important;
  max-width: none !important;
  max-height: 100% !important;
  object-fit: contain;
  transform: translateY(-5px);
}

.header-logo-light { display: block; }
.header-logo-dark { display: none; }

/* --- Accessibility Tools --- */
@media (min-width: 768px) {
  .header-utilities {
    margin-right: 20px;
  }
}

.header-acessibilidade {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-acessibilidade a {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
  color: #333;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.header-acessibilidade a:hover {
  color: var(--brand-primary);
}

/* Alto Contraste */
.header-acessibilidade--contraste {
  padding-right: 15px;
  border-right: 1px solid #ccc;
  height: 20px;
}
.icon-acessibilidade {
  height: 16px;
  width: auto;
  margin-right: 6px;
  vertical-align: middle;
}

/* VLibras */
.header-acessibilidade--vlibras {
  padding: 0 15px 0 0;
  min-width: auto;
  min-height: auto;
  border-right: 1px solid #ccc;
  height: 20px;
  display: flex;
  align-items: center;
}
.header-acessibilidade--vlibras::before {
  content: "\f2a7"; /* fa-sign-language */
  font-family: FontAwesome;
  font-style: normal;
  font-size: 1.2rem;
  margin-right: 6px;
  position: static;
  left: auto;
  top: auto;
}

/* Fonts (A- A+ A) */
.header-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  border-left: none;
  padding-left: 0;
}
.header-acessibilidade a.header-acessibilidade--fonts {
  padding: 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #000;
}

/* Intranet & User */
.header-acessibilidade--intranet,
.header-acessibilidade--sair {
  color: var(--brand-primary);
  font-weight: 700;
  text-decoration: none;
}
.header-acessibilidade--intranet:hover,
.header-acessibilidade--sair:hover .dropdown-menu {
  color: #1a3a6e;
  text-decoration: underline;
}

.header-intranet-user-icon-wrapper {
  width: 38px;
  height: 38px;
  border: 2px solid var(--brand-primary);
}
.header-intranet-user-icon { fill: var(--brand-primary); }
.header-intranet-user-text { color: var(--brand-primary); }
.header-intranet-user-text--bold { font-weight: 600; }

/* --- Social Icons --- */
.header-tools-separator {
  display: block;
  width: 1px;
  height: 20px;
  background-color: #ccc;
  margin: 0 10px;
}

.header-social {
  gap: 15px;
  display: flex;
  align-items: center;
}

.social-icon-header {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  text-decoration: none;
  line-height: 1;
}

.social-icon-header:hover {
  transform: scale(1.1);
}

.social-icon-header svg {
  width: 22px !important;
  height: 22px !important;
  fill: #333 !important;
  transition: fill 0.2s ease;
}

.social-icon-header:hover svg {
  fill: var(--brand-primary) !important;
}

/* ==========================================================================
   5. BARRA GOVERNO (FEDERAL/ESTADUAL COMPONENT)
   ========================================================================== */

#barra-brasil div,
#barra-brasil a,
#barra-brasil ul,
#barra-brasil li {
  margin: 0;
  padding: 0;
  font-family: inherit;
  vertical-align: baseline;
  font-size: 1rem;
}

#barra-brasil ul {
  list-style: none;
}

.conteudo-escondido {
  display: block;
  background: transparent;
  background-image: none;
  border: none;
  height: 0.1em;
  overflow: hidden;
  padding: 0;
  margin: -0.1em 0 0 -0.1em;
  width: 1px;
}

#barra-brasil {
  background-color: #2c2c2c;
  box-sizing: content-box;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
}

#barra-brasil .conteudo-barra-brasil {
  height: 40px;
  margin: 0 auto;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
}

#barra-brasil .pic-gov {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2266%22%20height%3D%2214%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cdefs%3E%3Cpath%20id%3D%22a%22%20d%3D%22M9.367%204.374V.247H.37v4.127h8.997z%22%2F%3E%3C%2Fdefs%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M7.602%2011.174a3.693%203.693%200%200%201-2.45.896c-.644%200-1.26-.114-1.848-.343a4.416%204.416%200%200%201-1.54-1.001%204.863%204.863%200%200%201-1.05-1.61C.453%208.481.322%207.758.322%206.946a4.851%204.851%200%200%201%201.47-3.521%205.092%205.092%200%200%201%201.617-1.05%205.205%205.205%200%200%201%202.009-.385c.448%200%20.877.049%201.288.147a4.495%204.495%200%200%201%202.086%201.12c.28.266.509.567.686.903l-2.03%201.554a2.289%202.289%200%200%200-.882-.945%202.362%202.362%200%200%200-1.246-.357%202.034%202.034%200%200%200-1.596.742c-.196.233-.35.511-.462.833a3.198%203.198%200%200%200-.168%201.057c0%20.392.056.747.168%201.064.112.317.268.59.469.819.2.229.441.406.721.532.28.126.593.189.938.189.793%200%201.493-.327%202.1-.98H5.768v-1.96h4.088V12H7.602v-.826zm8.078.91c-.756%200-1.442-.145-2.058-.434a5.092%205.092%200%200%201-2.604-2.758%205.008%205.008%200%200%201-.364-1.876c0-.653.126-1.283.378-1.89a5.018%205.018%200%200%201%201.057-1.603c.453-.462.99-.83%201.61-1.106.62-.275%201.3-.413%202.037-.413.756%200%201.442.145%202.058.434.616.29%201.143.672%201.582%201.148a5.151%205.151%200%200%201%201.015%201.624c.238.607.357%201.227.357%201.862a4.83%204.83%200%200%201-.378%201.883%205.1%205.1%200%200%201-1.05%201.596%205.165%205.165%200%200%201-1.603%201.113c-.62.28-1.3.42-2.037.42zm-2.254-5.04c0%20.336.047.66.14.973.093.313.233.59.42.833.187.243.422.439.707.588.285.15.623.224%201.015.224.392%200%20.733-.077%201.022-.231a2.07%202.07%200%200%200%20.707-.602%202.59%202.59%200%200%200%20.406-.847c.089-.317.133-.64.133-.966%200-.336-.047-.66-.14-.973a2.397%202.397%200%200%200-.427-.826%202.156%202.156%200%200%200-1.218%200%202.397%202.397%200%200%200-.427.826c-.093.313-.14.637-.14.973%200%20.326.044.65.133.966.09.317.225.6.406.847.18.248.416.449.707.602.289.154.63.231%201.022.231z%22%20fill%3D%22%23888%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  display: block;
  width: 66px;
  height: 14px;
  min-width: 66px;
  margin-right: 10px;
  line-height: 0;
  font-size: 0;
  color: transparent;
}

#barra-brasil .conteudo-barra-brasil nav {
  overflow-x: auto;
  -ms-overflow-style: none; /* for Internet Explorer, Edge */
  scrollbar-width: none; /* for Firefox */
}

#barra-brasil .conteudo-barra-brasil nav ul {
  display: flex;
  flex-flow: row nowrap;
  justify-content: flex-start;
  align-items: center;
  width: auto;
  max-width: none;
}

#barra-brasil .conteudo-barra-brasil nav ul li.list-item {
  flex-shrink: 0;
}

#barra-brasil .conteudo-barra-brasil nav ul li.espacador {
  height: 20px;
  width: 1px;
  border-right: 1px solid rgba(151, 151, 151, 0.3);
  margin: 0 7px 0 20px;
}

#barra-brasil a {
  text-decoration: none;
  color: var(--text-on-primary);
  font-weight: bold;
  font-size: 0.7em;
  text-transform: uppercase;
}

#barra-brasil .conteudo-barra-brasil nav a.link-externo-barra::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 10px;
  margin-right: 6px;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2211%22%20height%3D%2210%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill%3D%22%23FFF%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M10.174.169l-.003%204.002L6.173.173z%22%2F%3E%3Cpath%20d%3D%22M4%204.51L7.91.6l1.768%201.768-3.91%203.91zM0%200h3.5v2.5H0z%22%2F%3E%3Cpath%20d%3D%22M0%202h2.5v5H0zM7.5%206H10v3H7.5z%22%2F%3E%3Cpath%20d%3D%22M0%207h10v2.5H0z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  opacity: 0;
}

#menu-barra-brasil a.link-baixo-barra.ativo { opacity: 1; }
#menu-barra-brasil a.link-baixo-barra.close { opacity: 0.3; }

#barra-brasil .conteudo-barra-brasil nav a.link-discreto,
#barra-brasil .conteudo-barra-brasil nav a.link-discreto-fixo,
#barra-brasil .conteudo-barra-brasil nav:hover li:not(:hover) > a {
  opacity: 0.3;
}

#barra-brasil .conteudo-barra-brasil nav a:hover { opacity: 1; }
#barra-brasil .conteudo-barra-brasil nav a.link-externo-barra:hover::before { opacity: 1; }
#barra-brasil .conteudo-barra-brasil nav a.link-interno-barra { margin-left: 13px; }

#barra-brasil .conteudo-barra-brasil nav a.link-baixo-barra::after {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-left: 6px;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%229%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill%3D%22%23FFF%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M1.9.033L8.4%206.531%206.63%208.3.133%201.801z%22%2F%3E%3Cpath%20d%3D%22M11.395%200L5.03%206.364l1.767%201.768%206.364-6.364z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px 6px;
  background-color: var(--brand-secondary);
  border-radius: 50%;
}

#barra-brasil .conteudo-barra-brasil nav a.link-baixo-barra.link-cima-barra::after {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%229%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill%3D%22%23FFF%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M1.9%208.967L8.4%202.469%206.63.7.133%207.199z%22%2F%3E%3Cpath%20d%3D%22M11.395%209L5.03%202.636%206.798.868l6.364%206.364z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}

#barra-brasil .conteudo-barra-brasil a.botao-seta-direita,
#barra-brasil .conteudo-barra-brasil a.botao-seta-esquerda {
  width: 9px;
  min-width: 9px;
  margin-left: 10px;
  height: 13px;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2210%22%20height%3D%2213%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill%3D%22%23FFF%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M.533%2011.232L7.03%204.734%208.8%206.502%202.301%2013z%22%2F%3E%3Cpath%20d%3D%22M.5%201.738l6.364%206.364%201.768-1.768L2.268-.03z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  line-height: 0;
  font-size: 0;
  color: transparent;
}

#barra-brasil .conteudo-barra-brasil a.botao-seta-direita { display: block; }
#barra-brasil .conteudo-barra-brasil a.botao-seta-esquerda {
  display: none;
  rotate: 180deg;
  margin-right: 10px;
  margin-left: 0px;
}

#barra-brasil .orgaos-governo-barra {
  width: 100%;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.3);
  max-height: 0;
  overflow-y: hidden;
}
#barra-brasil .orgaos-governo-barra.mostra-orgaos {
  max-height: calc(90vh - 40px);
}

#barra-brasil .orgaos-governo-barra > div {
  width: 100%;
  max-width: 1150px;
  margin: 0 auto;
}

#barra-brasil .orgaos-governo-barra ul {
  margin-top: 25px;
  width: calc(100% + 25px);
  display: flex;
  flex-flow: row wrap;
}

#barra-brasil .orgaos-governo-barra ul li {
  width: 168px;
  text-align: left;
  margin: 0 25px 25px 0;
}

#barra-brasil .orgaos-governo-barra ul li a {
  font-size: 0.75em;
  text-transform: none;
  font-weight: bold;
}

#barra-brasil .orgaos-governo-barra ul:hover li:not(:hover) a { opacity: 0.3; }
#barra-brasil .orgaos-governo-barra ul li a:hover { font-weight: bold; }

@media only screen and (max-width: 600px) {
  #barra-brasil .orgaos-governo-barra { overflow-y: auto; }
  #barra-brasil .orgaos-governo-barra ul { width: 100%; flex-flow: column nowrap; }
  #barra-brasil .orgaos-governo-barra ul li { width: 100%; margin: 0 0 25px 0; }
  #barra-brasil .conteudo-barra-brasil a.botao-seta-direita { display: block; }
}

/* ==========================================================================
   6. PAGE CONTENT (HOME & SECTIONS)
   ========================================================================== */

/* --- Groups Section (Home) --- */
.groups-section-title {
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 40px;
}

.groups-section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background-color: var(--brand-primary);
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 30px;
  width: 100%;
}

@media (min-width: 576px) {
  .groups-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
  .groups-grid { grid-template-columns: repeat(4, 1fr); }
}

.group-card {
  background-color: #fff;
  border: 1px solid #30599B;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  min-height: 180px;
}

.group-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 4px 6px rgba(48, 89, 155, 0.1);
  transform: translateY(-2px);
}

.group-icon-circle {
  width: 64px;
  height: 64px;
  background-color: transparent;
  color: var(--brand-primary);
  font-size: 2.5rem;
}

.group-icon-image {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.group-card-title {
  color: var(--brand-primary);
  font-weight: 600;
  line-height: 1.3;
}

/* --- Stats Bar --- */
.stats-bar-full {
  background-color: var(--brand-secondary);
  color: #fff;
  width: 100%;
}

.stats-number {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stats-label {
  font-size: 1.1rem;
  font-weight: 400;
  opacity: 0.9;
}

/* --- About Section --- */
.about-title {
  color: #30599b;
  font-size: 30px;
  font-weight: 700;
  text-align: left;
}

.about-text {
  font-size: 18px;
  color: #333;
  text-align: left;
  line-height: 1.5;
}

.section-title {
  font-size: 2rem;
  color: var(--brand-primary);
}

.section-text {
  color: #555;
  line-height: 1.6;
}

/* --- CTA Section --- */
.cta-section {
  background-color: #2d9cdb;
  color: #fff;
}

.cta-button .btn-light {
  color: #2d9cdb !important;
  transition: all 0.3s ease;
}

.cta-button .btn-light:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */

footer {
  border-top: 1px solid #e5e7eb;
}

.site-footer {
  font-size: 0.9rem;
}

.footer-sic-logo img {
  filter: brightness(0) invert(1);
}

.footer-address p {
  line-height: 1.4;
}

/* --- Language Selector --- */
.language-selector-form {
  margin: 0;
  display: flex !important;
  align-items: center !important;
  flex-direction: row !important;
}

.language-selector-form label {
  margin: 0 !important;
  color: rgba(255, 255, 255, 1);
  font-weight: normal;
  font-size: 0.85rem;
  white-space: nowrap;
  line-height: 1;
  margin-right: 5px !important;
}

.language-selector-form select {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  min-width: 120px;
}

.language-selector-form select option {
  background-color: #203a5b;
  color: #fff;
}

/* --- Back to Top Button --- */
.scroll-top-wrapper {
  position: absolute;
  bottom: 20px;
  right: 0;
  width: auto;
  background: transparent;
  padding-right: 15px;
  z-index: 10;
  padding-top: 0;
  padding-bottom: 0;
}

.scroll-top-content {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
}

.scroll-text {
  font-weight: 700;
  color: #162e49;
  font-size: 14px;
  text-transform: uppercase;
  cursor: pointer;
}

.scroll-btn {
  width: 40px;
  height: 40px;
  background-color: #1c1c1c;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.scroll-btn:hover {
  transform: translateY(-3px);
  background-color: #000;
}

/* Dark Mode override for Scroll Button */
[data-theme="dark"] .scroll-top-wrapper {
  background-color: transparent !important;
  border-top: none;
}
[data-theme="dark"] .scroll-text { color: #ffff00 !important; }
[data-theme="dark"] .scroll-btn {
  background-color: #333 !important;
  border: 1px solid #ffff00 !important;
}
[data-theme="dark"] .scroll-btn svg path { stroke: #ffff00 !important; }

/* ==========================================================================
   8. GLOBAL RESPONSIVE ADJUSTMENTS (LAYOUT)
   ========================================================================== */

/* Mobile Footer Stack */
@media (max-width: 991.98px) {
  .site-footer .row {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .site-footer .col-lg-6,
  .site-footer .col {
    width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .footer-address,
  .footer-sic {
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .footer-sic { flex-direction: column; }
  .site-footer .col.d-flex {
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    padding-left: 0 !important;
  }
  .footer-lang-selector {
    margin-left: 0 !important;
    margin-top: 1rem !important;
    justify-content: center;
  }
}

/* Mobile Sidebar & Layout */
@media (max-width: 767.98px) {
  .wrapper .container .row {
    display: flex;
    flex-direction: column;
  }
  /* Sidebar default behavior */
  .secondary {
    order: 1;
    width: 100%;
    margin-top: 2rem;
  }
  /* Search Page specific */
  body.action-search .secondary {
    display: none;
    order: -1;
    margin-bottom: 1.5rem;
    margin-top: 0;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
  }
  body.action-search .secondary.mobile-filters-active {
    display: block;
    animation: slideDown 0.3s ease-out;
  }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Home Content */
@media (max-width: 767.98px) {
  .about-title { text-align: center; font-size: 1.5rem; }
  .about-text { text-align: center; font-size: 1rem !important; }
  .stats-number { font-size: 2.5rem; }
  .cta-card {
    width: 100% !important;
    height: auto !important;
    padding: 2rem !important;
    flex-direction: column;
    text-align: center;
    background: linear-gradient(180deg, #2dadd8 0%, #004ecc 100%) !important;
  }
  .cta-card img { display: none; }
  .cta-card > div {
    padding-left: 0 !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .cta-card h3 {
    text-align: center !important;
    font-size: 1.2rem !important;
  }
  .cta-card a {
    align-self: center !important;
    margin-top: 1rem;
  }
}

/* ==========================================================================
   9. DARK MODE THEME (OVERRIDES)
   ========================================================================== */

/* 1. Backgrounds & Colors */
[data-theme="dark"] body,
[data-theme="dark"] .site-wrapper,
[data-theme="dark"] .main,
[data-theme="dark"] .account-masthead,
[data-theme="dark"] .masthead,
[data-theme="dark"] .navbar,
[data-theme="dark"] .navbar-inner,
[data-theme="dark"] header,
[data-theme="dark"] .header-layout,
[data-theme="dark"] footer,
[data-theme="dark"] .site-footer,
[data-theme="dark"] .module,
[data-theme="dark"] .wrapper,
[data-theme="dark"] .hero-search-banner,
[data-theme="dark"] .group-card,
[data-theme="dark"] .stats-bar-full,
[data-theme="dark"] .cta-section,
[data-theme="dark"] #barra-brasil,
[data-theme="dark"] .container-fluid,
[data-theme="dark"] .header-logo-wrapper,
[data-theme="dark"] .navbar-static-top,
[data-theme="dark"] .site-header {
  background-color: #000000 !important;
  background-image: none !important;
  border-color: #333 !important;
}

[data-theme="dark"] .navbar,
[data-theme="dark"] .navbar-static-top,
[data-theme="dark"] .masthead,
[data-theme="dark"] .site-header {
  border-bottom: 1px solid #ffff00 !important;
}

[data-theme="dark"] .hero-search-banner::before {
  background: none !important;
}

/* 2. Links (Neon Yellow) */
[data-theme="dark"] a,
[data-theme="dark"] .nav-item a,
[data-theme="dark"] .nav > li > a,
[data-theme="dark"] .btn-link,
[data-theme="dark"] .breadcrumb-item a {
  color: #ffff00 !important;
  text-decoration: underline;
}

[data-theme="dark"] a:hover,
[data-theme="dark"] .btn-link:hover {
  color: #00ffff !important;
}

/* 3. Global Text Overrides */
[data-theme="dark"],
[data-theme="dark"] body,
[data-theme="dark"] p,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] span,
[data-theme="dark"] li,
[data-theme="dark"] label,
[data-theme="dark"] .module-heading,
[data-theme="dark"] .site-title,
[data-theme="dark"] .nav-link,
[data-theme="dark"] .about-title,
[data-theme="dark"] .about-text,
[data-theme="dark"] .section-title,
[data-theme="dark"] .section-text,
[data-theme="dark"] .group-card-title,
[data-theme="dark"] .stats-number,
[data-theme="dark"] .stats-label,
[data-theme="dark"] .breadcrumb-item.active {
  color: #ffff00 !important;
  text-shadow: none !important;
}

[data-theme="dark"] a.nav-link {
  color: #ffff00 !important;
}

/* 4. Accessibility Bar Override */
[data-theme="dark"] .header-acessibilidade,
[data-theme="dark"] .header-acessibilidade a,
[data-theme="dark"] .header-acessibilidade span,
[data-theme="dark"] .header-acessibilidade i,
[data-theme="dark"] .header-acessibilidade--contraste,
[data-theme="dark"] .header-acessibilidade--vlibras,
[data-theme="dark"] .header-acessibilidade--fonts {
  color: #ffff00 !important;
  border-color: #ffff00 !important;
}

[data-theme="dark"] .header-acessibilidade svg,
[data-theme="dark"] .header-acessibilidade path,
[data-theme="dark"] .icon-acessibilidade {
  fill: #ffff00 !important;
  filter: none !important;
}

[data-theme="dark"] .header-acessibilidade--contraste,
[data-theme="dark"] .header-acessibilidade--vlibras {
  border-right-color: rgba(255, 255, 0, 0.5) !important;
}

/* 5. Gov Bar Override */
[data-theme="dark"] #barra-brasil a {
  color: #ffff00 !important;
}

/* 6. Buttons & Inputs */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-success,
[data-theme="dark"] .btn-info,
[data-theme="dark"] .btn-warning,
[data-theme="dark"] .btn-danger,
[data-theme="dark"] .header-btn-search,
[data-theme="dark"] .hero-search-form .btn-search {
  background-color: #333333 !important;
  border: 1px solid #ffffff !important;
  color: #ffffff !important;
  background-image: none !important;
}

[data-theme="dark"] .btn-primary:hover {
  background-color: #555 !important;
  color: #ffff00 !important;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .form-control {
  background-color: #333333 !important;
  color: #ffffff !important;
  border: 1px solid #ffffff !important;
}

[data-theme="dark"] input::placeholder {
  color: #cccccc !important;
}

/* 7. Icons */
[data-theme="dark"] i,
[data-theme="dark"] .fa,
[data-theme="dark"] .fas,
[data-theme="dark"] .far {
  color: #ffffff !important;
}
[data-theme="dark"] a i,
[data-theme="dark"] a .fa {
  color: inherit !important;
}

/* 8. Footer Borders */
[data-theme="dark"] footer,
[data-theme="dark"] .site-footer {
  border-top: 1px solid #333 !important;
}

/* 9. Header Dark Mode Overrides */
[data-theme="dark"] .header-logo-light { display: none; }
[data-theme="dark"] .header-logo-dark { display: block; }

[data-theme="dark"] .header-input-search {
  border: 1.5px solid #fff;
  border-right: 0.5px solid #fff;
  background-color: #fff;
  color: #000;
}
[data-theme="dark"] .header-btn-search {
  border: 1.5px solid #fff;
  border-left: 0.5px solid #fff;
  background-color: #000;
  color: #fff;
}

/* Transparências no Header (A "Bomba Atômica") */
[data-theme="dark"] header div:not(.header-input-search),
[data-theme="dark"] .header-layout div:not(.header-input-search) {
  background-color: transparent !important;
}

[data-theme="dark"] .navbar,
[data-theme="dark"] .navbar-static-top,
[data-theme="dark"] .navbar-inner,
[data-theme="dark"] .nav-collapse,
[data-theme="dark"] section.toolbar {
  background-color: #000000 !important;
  background-image: none !important;
  box-shadow: none !important;
}

[data-theme="dark"] .header-tools-separator {
  background-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .social-icon-header svg {
  fill: #fff !important;
}

[data-theme="dark"] .social-icon-header:hover svg {
  fill: #fff !important;
  opacity: 0.8;
}

/* --- Mobile Tools (Inside Menu) --- */
@media (min-width: 768px) {
  .mobile-tools-only {
    display: none !important;
  }
}

.mobile-tools-only {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.mobile-tools-only .header-acessibilidade a,
.mobile-tools-only .header-acessibilidade--fonts {
  color: #fff !important;
}

.mobile-tools-only .header-acessibilidade a:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

.mobile-tools-only .header-acessibilidade--contraste,
.mobile-tools-only .header-acessibilidade--vlibras {
  border-right-color: rgba(255, 255, 255, 0.3) !important;
}

.mobile-tools-only .header-tools-separator {
  background-color: rgba(255, 255, 255, 0.3) !important;
}

.mobile-tools-only .icon-acessibilidade {
  filter: brightness(0) invert(1) !important;
}

.mobile-tools-only .social-icon-header svg {
  fill: #fff !important;
}

.mobile-tools-only .header-acessibilidade {
  flex-wrap: wrap;
  justify-content: center;
}