:root {
  --azul: #164194;
  --verde: #52ae32;
  --areia: #f4f1ef;
}
@font-face {
  font-family: "NeoSansProBold";
  src:
    url("../fonts/NeoSansProBold.woff2") format("woff2"),
    url("../fonts/NeoSansProBold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NeoSansProLight";
  src:
    url("../fonts/NeoSansProLight.woff2") format("woff2"),
    url("../fonts/NeoSansProLight.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* RESET */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  /*font-family: "Roboto", sans-serif;*/
  background: var(--areia);
}

/* PÁGINA */
.page {
  min-height: 100vh;
}

/* HERO */
.hero {
  /*
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  background: #fff;*/
  height: 85vh; /* 70% da altura da tela */
  min-height: 560px; /* garante boa leitura em telas menores */
  max-height: 900px; /* evita hero exagerado em telas grandes */

  display: grid;
  grid-template-columns: 30% 70%;
  background: #fff;
}

.hero-text h1,
.hero-text p {
  /*font-family: "NeoSansProBold", Arial, Helvetica, sans-serif;*/
}

.hero-text h1 {
  letter-spacing: 0.5px;
}

.hero-text p {
  font-size: 17px;
  line-height: 1.7;
  opacity: 0.7;
}

/* TEXTO */
.hero-text {
  padding: 60px;
}

.hero-text .logo {
  width: 140px;
  margin-bottom: 32px;
}

.hero-text h1 {
  font-size: 48px;
  margin: 0 0 24px;
}

.hero-text strong {
  font-weight: 900;
}

.hero-text p {
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-weight: 600; /* SemiBold */
  opacity: 0.7;
  max-width: 520px;
  line-height: 1.6;
}

/* IMAGEM */
.hero-image {
  position: relative;
  background: url("../hero.jpg") center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FORMULÁRIO */
.search-box {
  position: absolute;
  top: 40px;
  left: 40px;
  right: 40px;

  display: flex;
  gap: 16px;
  align-items: flex-end;

  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.95);
  /*border-radius: 40px;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);*/
}

.field {
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.field.flex {
  flex: 1;
}

.field label {
  font-size: 13px;
  margin-bottom: 6px;
}

.field input,
.field select {
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: var(--azul);
  color: #fff;
}

.field input::placeholder {
  color: #e0e0e0;
}

.actions {
  display: flex;
  gap: 10px;
}

.actions button {
  height: 40px;
  width: 44px;
  border-radius: 50%;
  border: none;
  background: var(--azul);
  color: #fff;
  cursor: pointer;
}

/* RESULTADOS SOBRE A IMAGEM */
.results-overlay {
  margin-top: 10px;
  position: absolute;
  top: 130px;
  left: 40px;
  right: 40px;
  bottom: 40px;

  padding: 24px;
  overflow-y: auto;

  background: rgba(244, 241, 239, 0.75);
  backdrop-filter: blur(6px);
  border-radius: 24px;
}

#cards {
  display: grid;
  gap: 16px;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-weight: 600; /* SemiBold */
  opacity: 0.7;
  font-size: 14px;
}

#resultsCount {
  display: grid;
  gap: 16px;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-weight: 600; /* SemiBold */
  opacity: 0.7;
  font-size: 14px;
}

.result-card {
  background: rgba(255, 255, 255, 0.9);
  padding: 15px;
  border-radius: 16px;
}

.result-card a {
  color: var(--azul);
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-weight: 600; /* SemiBold */
  /*opacity: 0.7;  */
  font-size: 14px;
  text-decoration: none;
}

.result-card a:hover {
  color: var(--azul);
  text-decoration: underline;
}

/* RESPONSIVO */
@media (max-width: 1024px) {
  .hero {
    height: auto;
    min-height: 50vh; /* mobile ocupa tela inteira */
    grid-template-columns: 1fr;
  }

  .hero-image {
    /*min-height: 100vh;*/
  }

  .search-box {
    position: static;
    margin: 24px;
    flex-wrap: wrap;
    /*border-radius: 20px;*/
  }

  .results-overlay {
    position: static;
    margin: 24px;
    backdrop-filter: none;
  }
}

/* FOOTER */
.footer {
  background: var(--azul);
  color: #fff;
  padding: 40px 24px;
}

.footer-container {
  max-width: 100%;
  margin: 0 auto;

  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}

.footer-text {
  font-size: 14px;
  line-height: 1.6;
}

.footer-text p {
  margin: 0 0 10px;
  text-align: center;
}

.footer-phones {
  margin-top: 14px;
  font-weight: 500;
}

.footer-lgpd {
  margin-top: 14px;
  font-size: 13px;
}

.footer-lgpd a {
  color: #fff;
  text-decoration: underline;
}

.footer-logo img {
  width: 120px;
  justify-self: end;
  padding-right: 16px;
}

/* RESPONSIVO */
@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-logo {
    margin-top: 20px;
  }
}

/* SCROLL ELEGANTE - RESULTADOS */
.results-overlay {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(22, 65, 148, 0.35) transparent;
}

/* Webkit (Chrome, Edge, Safari) */
.results-overlay::-webkit-scrollbar {
  width: 6px;
}

.results-overlay::-webkit-scrollbar-track {
  background: transparent;
}

.results-overlay::-webkit-scrollbar-thumb {
  background-color: rgba(22, 65, 148, 0.35);
  border-radius: 999px;
}

/* Hover: aparece um pouco mais */
.results-overlay:hover::-webkit-scrollbar-thumb {
  background-color: rgba(22, 65, 148, 0.55);
}

/* AJUSTE DE RESULTADOS NO MOBILE */
@media (max-width: 1024px) {
  .results-overlay {
    position: static; /* sai do overlay */
    margin: 0 24px 24px;
    padding: 20px;

    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: none;

    max-height: none;
    overflow: visible;
  }

  .hero-image {
    display: block;
  }

  /* garante hierarquia correta */
  .search-box {
    margin-bottom: 16px;
  }
}

/* CORREÇÃO DE SCROLL E FOOTER NO MOBILE */
@media (max-width: 1024px) {
  /* libera o crescimento do hero */
  .hero {
    height: auto;
    min-height: auto;
  }

  /* imagem não força altura de viewport */
  .hero-image {
    min-height: auto;
    padding-bottom: 24px;
  }

  /* garante scroll da página inteira */
  body,
  .page {
    overflow-y: auto;
  }

  /* resultados no fluxo normal */
  .results-overlay {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* FIX DEFINITIVO: FOOTER SUMINDO QUANDO HÁ RESULTADOS (MOBILE) */
@media (max-width: 1024px) {
  /* hero nunca pode travar altura quando há conteúdo */
  .hero,
  .hero-image {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
  }

  /* resultados entram 100% no fluxo da página */
  .results-overlay {
    position: static !important;
    inset: auto !important;

    max-height: none !important;
    overflow: visible !important;

    margin: 16px 24px 32px;
  }

  /* evita qualquer scroll interno escondendo o footer */
  .results-overlay,
  .hero-image,
  .hero {
    overflow: visible !important;
  }

  /* garante scroll do documento */
  html,
  body {
    height: auto;
    overflow-y: auto !important;
  }
}

/* PAGINAÇÃO – ESTILO MODERNO */
#pagination {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;

  margin-top: 24px;
  padding-top: 16px;

  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

#pagination button {
  min-width: 36px;
  height: 36px;

  padding: 0 10px;
  border-radius: 999px;

  border: none;
  background: var(--azul); /* rgba(0,0,0,0.06);*/
  color: #ffffff;

  font-size: 14px;
  font-weight: 500;

  cursor: pointer;
  transition: all 0.2s ease;
}

/* Hover */
#pagination button:hover:not([aria-current="page"]):not(:disabled) {
  background: rgba(22, 65, 148, 0.15);
  color: var(--azul);
}

/* Página atual */
#pagination button[aria-current="page2"] {
  background: var(--verde);
  color: #fff;
  font-weight: 600;
  cursor: default;
}

/* Botões desabilitados */
#pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  #pagination {
    gap: 6px;
  }

  #pagination button {
    min-width: 32px;
    height: 32px;
    font-size: 13px;
  }
}

/* ÍCONE DE CALENDÁRIO BRANCO */
input[type="date"] {
  color-scheme: dark; /* força ícone claro em browsers modernos */
}

/* Chrome, Edge, Safari */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.8;
  cursor: pointer;
}

/* Hover sutil */
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.search-box label {
  margin-left: 17px;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-weight: 500; /* Medium */
  font-size: 12.5px;
  letter-spacing: 0.3px;
  opacity: 0.85;
}

.hero-text {
  font-size: 54px;
  line-height: 0.9;
  margin: 0 0 24px;
}

/* "Portal de" */
.hero-text .title-light {
  font-family: "NeoSansProLight", Arial, Helvetica, sans-serif;
  font-weight: 300;
}

/* "Normas" */
.hero-text .title-bold {
  font-family: "NeoSansProBold", Arial, Helvetica, sans-serif;
  font-weight: 700;
  letter-spacing: 2.5px;
}
