:root {
  --cor-principal: #1c6e4a;
  --cor-secundaria: #f2a71b;
  --cor-texto: #2b2b2b;
  --cor-bg-suave: #f7f9f7;
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--cor-texto);
  overflow-x: hidden;
  max-width: 100vw;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
  font-family: 'Poppins', sans-serif;
}

a { text-decoration: none; }

.demo-banner {
  background: #fff3cd;
  color: #664d03;
  text-align: center;
  font-size: .85rem;
  padding: 6px 12px;
}

/* ---------- Barra de acessibilidade ---------- */
.accessibility-bar {
  background: #0f1e15;
  color: #cfe3d8;
  font-size: .78rem;
  padding: 5px 0;
}
.acc-label { opacity: .75; margin-right: 4px; }
.acc-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  color: #cfe3d8;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.acc-btn .acc-sign { font-size: .62rem; vertical-align: super; }
.acc-btn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); }
.acc-btn-icon { font-size: .82rem; padding: 4px 9px; }

/* ---------- Header ---------- */
.topbar {
  background: var(--cor-principal);
  color: #fff;
  font-size: .82rem;
  padding: 6px 0;
}
.topbar-info span { margin-right: 18px; }
.topbar-info i { margin-right: 4px; }
.topbar-social a { color: #fff; margin-left: 12px; opacity: .85; }
.topbar-social a:hover { opacity: 1; }

.site-navbar {
  box-shadow: 0 10px 24px -6px rgba(20, 38, 28, .22), 0 2px 8px rgba(20, 38, 28, .08);
  position: relative;
  z-index: 30;
}

.navbar-brand {
  color: var(--cor-principal) !important;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
}
.logo-header { height: 48px; width: auto; }
.logo-tema-escuro { display: none; }
html.dark-mode .logo-tema-claro { display: none; }
html.dark-mode .logo-tema-escuro { display: inline-block; }
.logo-footer { height: 56px; width: auto; }

.navbar-nav { align-items: center; }

@media (min-width: 1200px) {
  .navbar-nav.flex-xl-nowrap { flex-wrap: nowrap; }
}

.nav-link {
  font-weight: 500;
  font-size: .93rem;
  color: var(--cor-texto) !important;
  padding: .55rem .85rem !important;
  margin: 0 .1rem;
  position: relative;
  border-radius: 8px;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: .3rem;
  height: 2px;
  border-radius: 2px;
  background: var(--cor-principal);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s ease;
}
.nav-link:hover {
  color: var(--cor-principal) !important;
  background-color: color-mix(in srgb, var(--cor-principal) 8%, transparent);
}
.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}
.nav-link.active {
  color: var(--cor-principal) !important;
  font-weight: 600;
}

.btn-doar {
  background: var(--cor-secundaria);
  color: #2b2b2b !important;
  border: none;
  padding: .5rem 1.2rem;
  border-radius: 30px;
}
.btn-doar:hover { filter: brightness(0.95); }

/* ---------- Hero / Banner ---------- */
.hero-slide {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  color: #fff;
}
.hero-slide::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(15,40,25,.82) 0%, rgba(15,40,25,.35) 100%);
}
.hero-slide--sem-sombra::before {
  content: none;
}
.hero-slide .container { position: relative; z-index: 2; }
.hero-slide h1 { font-size: 2.6rem; font-weight: 800; max-width: 650px; }
.hero-slide p { font-size: 1.15rem; max-width: 560px; }

.btn-hero {
  background: var(--cor-secundaria);
  color: #2b2b2b;
  font-weight: 700;
  padding: .75rem 1.8rem;
  border-radius: 30px;
  border: none;
}

/* ---------- Sections ---------- */
.section { padding: 70px 0; }
.section-suave { background: var(--cor-bg-suave); }
.section-title {
  font-weight: 800;
  color: var(--cor-principal);
  margin-bottom: .5rem;
}
.section-subtitle { color: #666; max-width: 650px; }

.card-project {
  border: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  transition: transform .2s ease;
  height: 100%;
}
.card-project:hover { transform: translateY(-4px); }
.card-project img { height: 190px; object-fit: cover; width: 100%; }
.badge-status { font-size: .72rem; }

.impact-block { text-align: center; }
.impact-number {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--cor-principal);
}
.impact-label { color: #666; font-weight: 500; }

.testimonial-card {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  height: 100%;
}

.partner-logo {
  max-height: 140px;
  max-width: 260px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: .7;
  transition: .2s;
}
.partner-logo:hover { filter: none; opacity: 1; }

.cta-band {
  background: var(--cor-principal);
  color: #fff;
  text-align: center;
  padding: 60px 0;
}

/* ---------- Footer ---------- */
.site-footer { background: #14261c; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,.6); font-size: .9rem; }
.footer-links a:hover { color: #fff; }

/* ---------- Alinhamento de texto em conteúdo editado no admin ---------- */
.texto-esquerda { text-align: left; }
.texto-centro { text-align: center; }
.texto-direita { text-align: right; }
.texto-justificado { text-align: justify; }

/* ---------- Tamanho de fonte em conteúdo editado no admin ---------- */
.texto-pequeno { font-size: .85em; }
.texto-grande { font-size: 1.3em; }
.texto-enorme { font-size: 1.8em; }

/* ---------- Texto "Nossa História" (editado via WYSIWYG no admin) ---------- */
.historia-texto p { color: #6c757d; line-height: 1.8; margin-bottom: 1rem; }
.historia-texto p:first-child { font-size: 1.25rem; }
.historia-texto p:last-child { margin-bottom: 0; }

/* ---------- Registro histórico (galeria de fotos) ---------- */
.historia-foto-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  cursor: pointer;
  background: none;
}
.historia-foto {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.historia-foto-btn:hover .historia-foto { transform: scale(1.06); }
@media (max-width: 768px) {
  .historia-foto { height: 150px; }
}

/* ---------- Vídeos (facade de reprodução) ---------- */
.video-facade {
  position: relative;
  background-color: #14261c;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border: none;
  padding: 0;
}
.video-facade::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(15, 30, 21, .35);
}
.video-facade-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: var(--cor-principal);
  border: none;
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: transform .15s ease, background-color .15s ease;
}
.video-facade-play:hover { transform: translate(-50%, -50%) scale(1.08); background: #fff; }
.video-facade iframe { border: 0; }

/* ---------- Banner de cookies ---------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #0f1e15;
  color: #dfe6e2;
  box-shadow: 0 -6px 24px rgba(0,0,0,.25);
  z-index: 1080;
}
.cookie-banner p { color: #cfe3d8; }
.cookie-banner a { color: var(--cor-secundaria); text-decoration: underline; }

.whatsapp-float {
  position: fixed;
  bottom: 24px; right: 24px;
  background: #25d366;
  color: #fff;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  z-index: 999;
}

/* ---------- Portal da Transparência ---------- */
.transp-hero {
  background: linear-gradient(120deg, var(--cor-principal), #0f4a32);
  color: #fff;
  padding: 60px 0;
}
.transp-stat {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  height: 100%;
}
.transp-stat .valor { font-size: 1.7rem; font-weight: 800; color: var(--cor-principal); }
.transp-stat .rotulo { color: #666; font-size: .9rem; }

.table-transp thead { background: var(--cor-bg-suave); }

/* ---------- Publicações (lista em cartões) ---------- */
.publicacao-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #fff;
  border-radius: 14px;
  padding: 1.1rem 1.4rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.publicacao-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.1); }
.publicacao-data {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 700;
  font-size: .82rem;
  white-space: nowrap;
  color: var(--cor-principal);
  background: color-mix(in srgb, var(--cor-principal) 8%, transparent);
  border-radius: 100px;
  padding: .45rem .9rem;
}
.publicacao-corpo { flex: 1; min-width: 0; }
.publicacao-download {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cor-principal);
  color: #fff;
  transition: filter .15s ease;
}
.publicacao-download:hover { filter: brightness(1.12); color: #fff; }
@media (max-width: 576px) {
  .publicacao-card { flex-wrap: wrap; }
  .publicacao-download { margin-left: auto; }
}

/* Navegação em pílulas do Portal da Transparência: usa a cor institucional
   em vez do azul padrão do Bootstrap. */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background-color: var(--cor-principal);
  color: #fff !important;
}
.nav-pills .nav-link:not(.active):hover {
  background-color: var(--cor-bg-suave);
}

/* ---------- Forms ---------- */
.form-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  padding: 32px;
}

/* ---------- Páginas legais (Privacidade, Termos, Cookies) ---------- */
.legal-content { padding: 40px; }
.legal-content > p:first-child { font-size: 1.1rem; color: #555; }
.legal-content h2 {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--cor-principal);
  font-weight: 800;
  font-size: 1.15rem;
  margin: 2.2rem 0 .9rem;
}
.legal-content h2:first-of-type { margin-top: .5rem; }
.legal-content h2 i {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  background: color-mix(in srgb, var(--cor-principal) 12%, transparent);
  border-radius: 8px;
}
.legal-content p { line-height: 1.85; color: #444; }
.legal-content ul { list-style: none; padding-left: 0; margin: 0 0 1.1rem; }
.legal-content ul li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: .65rem;
  line-height: 1.75;
  color: #444;
}
.legal-content ul li::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--cor-principal);
  position: absolute;
  left: 0;
  top: .2rem;
  font-size: .78rem;
}
.legal-content strong { color: var(--cor-texto); }
.legal-content em { color: var(--cor-principal); font-style: italic; }
.legal-content a { color: var(--cor-principal); font-weight: 600; }
@media (max-width: 768px) {
  .legal-content { padding: 24px; }
}
html.dark-mode .legal-content p,
html.dark-mode .legal-content ul li { color: #c3ccc7; }
html.dark-mode .legal-content > p:first-child { color: #dfe6e2; }
html.dark-mode .legal-content strong { color: #eef3f0; }

@media (max-width: 768px) {
  .hero-slide h1 { font-size: 1.9rem; }
  .section { padding: 50px 0; }
}

/* ---------- Modo escuro ---------- */
html.dark-mode {
  --cor-bg-suave: #1a1f1c;
}
html.dark-mode body {
  background: #12181a;
  color: #dfe6e2;
}
html.dark-mode .site-navbar,
html.dark-mode .navbar {
  background: #182022 !important;
}
html.dark-mode .navbar-brand:not(:has(img)) { color: #eaf2ee !important; }
html.dark-mode .nav-link {
  color: #dfe6e2 !important;
}
html.dark-mode .nav-link:hover {
  background-color: rgba(255,255,255,.06);
}
html.dark-mode .section-suave {
  background: var(--cor-bg-suave);
}
html.dark-mode .card-project,
html.dark-mode .testimonial-card,
html.dark-mode .transp-stat,
html.dark-mode .form-card,
html.dark-mode .publicacao-card,
html.dark-mode .install-card {
  background: #1c2427;
  color: #dfe6e2;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
html.dark-mode .transp-stat .rotulo { color: #a7b3ae; }
html.dark-mode .text-muted { color: #9aa6a1 !important; }
html.dark-mode .bg-white { background: #1c2427 !important; }
html.dark-mode .table,
html.dark-mode .table-transp {
  color: #dfe6e2;
  --bs-table-color: #dfe6e2;
  --bs-table-bg: transparent;
}
html.dark-mode .table-transp thead,
html.dark-mode .table-light { background: #202a2d !important; color: #dfe6e2; }
html.dark-mode .form-control,
html.dark-mode .form-select {
  background: #1c2427;
  color: #dfe6e2;
  border-color: #33403c;
}
html.dark-mode .form-control::placeholder { color: #7c8985; }
html.dark-mode .form-control:focus,
html.dark-mode .form-select:focus {
  background: #1c2427;
  color: #dfe6e2;
}
html.dark-mode .border,
html.dark-mode .border-bottom,
html.dark-mode hr {
  border-color: #33403c !important;
}
html.dark-mode .list-group-item {
  background: #1c2427;
  color: #dfe6e2;
  border-color: #33403c;
}
html.dark-mode .demo-banner {
  background: #4a3c0c;
  color: #ffe9a8;
}
html.dark-mode .partner-logo { filter: grayscale(100%) brightness(1.4); }
html.dark-mode .accessibility-bar { background: #050a07; }
html.dark-mode .cookie-banner { background: #050a07; }
