:root {
  --bg: #f2f5f4;
  --surface: #ffffff;
  --primary: #026e4f;
  --primary-2: #00a86b;
  --dark: #06281f;
  --text: #21463a;
  --muted: #6c8179;
  --radius-xl: 24px;
  --shadow-soft: 0 10px 30px rgba(6, 40, 31, 0.12);
  --cacim-green: #006b4f;
  --cacim-green-dark: #004d38;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at top right, #d7f0e6 0%, var(--bg) 35%, #f7f9f8 100%);
  color: var(--text);
}

a { text-decoration: none; color: inherit; }

/* Compensar header fixo ao clicar em âncoras */
section { scroll-margin-top: 200px; }
.section { scroll-margin-top: 200px; }

/* Separador visual entre seções */
.section-divider {
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, var(--cacim-green) 50%, transparent 100%);
  margin: 60px auto;
  max-width: 200px;
  border-radius: 2px;
}

/* ========== HEADER V2 ========== */
.site-header-v2 {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1050;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
}

.top-bar {
  background: var(--cacim-green-dark);
  color: #fff;
  padding: 8px 0;
  font-size: .88rem;
}
.top-bar a { color: #fff; font-weight: 600; }
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  transition: all .25s;
}
.social-icon:hover { background: rgba(255,255,255,.28); transform: translateY(-2px); }
.top-bar-cta a { text-decoration: underline; }

.header-middle {
  background: #fff;
}
.logo-brand img {
  max-width: 100%;
  height: auto;
}
.btn-access-results {
  background: var(--cacim-green);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: .92rem;
  transition: all .3s;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.btn-access-results:hover {
  background: var(--cacim-green-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,107,79,.3);
}

.main-menu {
  background: var(--cacim-green);
  padding: 0;
}
.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 2px;
}
.menu-list li a {
  display: block;
  padding: 14px 24px;
  color: #fff;
  font-weight: 600;
  font-size: .92rem;
  transition: background .25s;
}
.menu-list li a:hover {
  background: rgba(255,255,255,.15);
}

.mobile-toggle {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 0;
  background: var(--cacim-green);
  color: #fff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.3s;
}

.mobile-toggle:hover {
  background: var(--cacim-green-dark);
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 90vw;
  height: 100vh;
  background: var(--cacim-green-dark);
  z-index: 1100;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: right .35s ease;
}
.mobile-drawer.open { right: 0; }
.mobile-link { color: #dcfff2; font-weight: 700; padding: 8px 0; }
.close-drawer {
  border: 0;
  margin-left: auto;
  background: transparent;
  color: #fff;
  font-size: 1.2rem;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 1090;
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }

/* ========== HERO CAROUSEL ========== */
main { padding-top: 180px; }

.hero-carousel {
  margin-top: 0;
  position: relative;
}
.carousel-item img {
  width: 100%;
  height: 600px;
  object-fit: contain;
  object-position: center;
  background: #f5f5f5;
}
.carousel-caption {
  display: none;
  bottom: 50%;
  transform: translateY(50%);
  text-shadow: 2px 2px 8px rgba(0,0,0,.5);
}
.carousel-caption h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 1rem;
}
.carousel-caption .lead {
  font-size: clamp(1rem, 2vw, 1.5rem);
  max-width: 700px;
  margin: 0 auto 2rem;
}
.btn-carousel-cta {
  background: var(--cacim-green);
  color: #fff;
  border: 0;
  padding: 14px 32px;
  font-weight: 700;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: .8px;
  transition: all .3s;
}
.btn-carousel-cta:hover {
  background: var(--cacim-green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 6px;
}

@media (max-width: 768px) {
  main { padding-top: 0 !important; }
  .site-header-v2 { position: relative; }
  section, .section { scroll-margin-top: 0; }
  .section-divider { margin: 40px auto; max-width: 150px; }
  .top-bar { font-size: .75rem; padding: 10px 0; }
  .top-bar .col-md-4 { width: 100%; }
  .header-middle .py-3 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
  .logo-brand svg { width: 200px; height: 50px; }
  .logo-brand img { height: 50px !important; }
  .btn-access-results { font-size: .9rem; padding: 12px 24px; width: 100%; max-width: 280px; }
  .main-menu { display: none; }
  .carousel-item img {
    height: auto;
    object-fit: initial;
    background: transparent;
  }
  .carousel-caption { bottom: 20px; transform: none; padding: 1rem; }
  .carousel-caption h2 { font-size: 1.5rem !important; }
  .carousel-caption .lead { font-size: .95rem !important; }
  .btn-carousel-cta { padding: 10px 20px; font-size: .85rem; }
  
  /* História - Mobile empilhado e centralizado */
  .historia-title { text-align: center; font-size: 1.5rem; margin-bottom: 1.5rem; }
  .historia-text { text-align: left; font-size: 1rem; }
}

/* ========== LEGACY STYLES (mantidos para outras seções) ========== */
.section-heading h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 800; color: var(--primary); }
.section-heading p { color: var(--muted); }

/* História - Layout Duas Colunas */
.historia-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  color: var(--cacim-green);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}
.historia-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  text-align: justify;
}

.timeline-horizontal {
  position: relative;
  display: flex;
  gap: 0;
  align-items: center;
  justify-content: space-between;
  padding: 40px 0;
  overflow-x: auto;
}
.timeline-horizontal::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cacim-green) 0%, #00d97e 100%);
  z-index: 1;
}
.timeline-step {
  position: relative;
  text-align: center;
  flex: 1;
  min-width: 140px;
  z-index: 2;
}
.timeline-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--cacim-green);
  background: #fff;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,107,79,.2);
  transition: all .3s;
}
.timeline-circle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,107,79,.35);
}
.timeline-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.timeline-year {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--cacim-green);
  margin-bottom: 4px;
}
.timeline-text {
  font-size: .88rem;
  color: var(--text);
  font-weight: 600;
}

.stats-section { background: linear-gradient(180deg, #f0f9f5 0%, #e8f4ee 100%); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.stat-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  border: 2px solid #d8ebe2;
  transition: all .35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cacim-green), #00d97e);
  transform: scaleX(0);
  transition: transform .35s;
}
.stat-card:hover::before { transform: scaleX(1); }
.stat-card:hover { 
  transform: translateY(-8px) scale(1.02); 
  box-shadow: 0 12px 32px rgba(0,107,79,.18);
  border-color: var(--cacim-green);
}
.stat-card .stat-icon {
  font-size: 2rem;
  color: var(--cacim-green);
  margin-bottom: 8px;
  opacity: .85;
}
.stat-card h3 { 
  color: var(--cacim-green); 
  font-size: 2.4rem; 
  margin: 8px 0 4px; 
  font-weight: 800;
  line-height: 1;
}
.stat-card p {
  color: var(--text);
  font-size: .92rem;
  margin: 0;
  font-weight: 600;
}

.exam-search { width: 100%; }
.exam-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 28px 24px;
  border: 2px solid #e5f0eb;
  transition: all .35s;
  text-align: center;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.exam-card:hover {
  border-color: var(--cacim-green);
  transform: translateY(-6px);
  box-shadow: 0 10px 28px rgba(0,107,79,.15);
}
.exam-card .exam-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #e8f5f0, #d0eee1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.8rem;
  color: var(--cacim-green);
}
.exam-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.exam-card p {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.4;
}
.exam-card small {
  display: block;
  font-size: .78rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Unidades */
.unit-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  border: 2px solid #e0f2ec;
  transition: all .3s;
  height: 100%;
}
.unit-card:hover {
  border-color: var(--cacim-green);
  box-shadow: 0 8px 24px rgba(0,107,79,.15);
  transform: translateY(-4px);
}
.unit-card h4 {
  color: var(--cacim-green);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.unit-card .unit-icon {
  display: flex;
  align-items: flex-start; /* Ícone no topo quando texto tem múltiplas linhas */
  gap: 8px;
  color: var(--text);
  font-size: .92rem;
  margin-bottom: 8px;
}
.unit-card .unit-icon span {
  white-space: pre-line;
  line-height: 1.5;
}
.unit-card .unit-hours {
  font-size: .88rem;
  color: #4f685f;
  font-weight: 500;
}
.unit-card .unit-icon i {
  color: var(--cacim-green);
  font-size: 1.1rem;
}
.unit-phone {
  color: var(--cacim-green);
  font-weight: 700;
  text-decoration: none;
  font-size: .95rem;
}
.unit-phone:hover {
  color: var(--cacim-green-dark);
  text-decoration: underline;
}

/* Footer */
.site-footer {
  background: linear-gradient(180deg, #004d38 0%, #003828 100%);
  color: #e8f5f0;
  padding-top: 60px;
}
.site-footer h5 {
  color: #fff;
  font-weight: 700;
  margin-bottom: 16px;
}
.site-footer h6 {
  color: #b8e6d5;
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 12px;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer ul li {
  margin-bottom: 8px;
  font-size: .9rem;
}
.site-footer a {
  color: #d0f0e3;
  transition: color .25s;
}
.site-footer a:hover {
  color: #fff;
}
.site-footer .copy {
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 20px;
  margin-top: 40px;
  text-align: center;
  font-size: .88rem;
  color: #b8e6d5;
}
.footer-map {
  border-radius: 12px;
  overflow: hidden;
  height: 300px;
  border: 3px solid rgba(255,255,255,.2);
}

/* Responsividade adicional */
@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .stat-card {
    padding: 20px 16px;
  }
  .stat-card h3 {
    font-size: 2rem;
  }
  .timeline-item {
    padding-left: 55px;
  }
  .timeline-year {
    width: 38px;
    height: 38px;
    font-size: .68rem;
  }
  .section {
    padding: 50px 0;
  }
}

.logo-carousel {
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #d5e8df;
}
.logo-track {
  display: flex;
  gap: 28px;
  padding: 22px;
  animation: marquee 16s linear infinite;
  width: max-content;
}
.logo-track span {
  font-weight: 800;
  color: #0f5f45;
  background: #ebf7f2;
  border-radius: 999px;
  padding: 8px 14px;
}
.logo-track .logo-img-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 70px;
  background: none;
  border-radius: 0;
  padding: 0;
}
.logo-track .logo-img-wrapper img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
@keyframes marquee { from { transform: translateX(0);} to { transform: translateX(-40%);} }

.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.partner-grid a {
  display: block;
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  border: 1px solid #d5e8df;
  font-weight: 700;
}

.team-section { background: #f7fbf9; }
.team-card {
  text-align: center;
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  border: 1px solid #d7ece3;
  height: 100%;
}
.team-photo {
  width: 95px;
  height: 95px;
  border-radius: 50%;
  margin: 0 auto 10px;
  object-fit: cover;
  display: block;
  border: 3px solid var(--cacim-green);
}
.avatar {
  width: 95px;
  height: 95px;
  border-radius: 50%;
  margin: 0 auto 10px;
  background: radial-gradient(circle at 30% 30%, #0aa273, #055b42);
}
.social { 
  display: flex; 
  justify-content: center; 
  gap: 10px; 
  margin-top: 8px;
}
.social a {
  color: var(--cacim-green);
  font-size: 1.2rem;
  transition: all .3s;
}
.social a:hover {
  color: var(--cacim-green-dark);
  transform: scale(1.2);
}
.social i {
  display: inline-block;
}

.unit-card, .news-card, .contact-form {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid #daece5;
}
.news-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 16px;
}
.news-link { color: var(--primary); font-weight: 700; }

.instagram-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 576px) {
  .instagram-grid { grid-template-columns: repeat(2, 1fr); }
}
.insta-card {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 1 / 1;
  background: #d8ebe3;
  text-decoration: none;
}
.insta-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.insta-card:hover img { transform: scale(1.06); }
.insta-card .insta-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 57, 44, .68);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .3s ease;
}
.insta-card:hover .insta-overlay { opacity: 1; }
.insta-card .insta-overlay i {
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 8px;
}
.insta-card .insta-overlay p {
  margin: 0;
  font-size: .82rem;
  color: #d6f5e8;
  text-align: center;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Widget Instagram (Behold / outros) */
.instagram-widget-container {
  width: 100%;
  margin: 0 auto;
}
.instagram-widget-container > div {
  width: 100% !important;
  max-width: 100% !important;
}

.site-footer {
  background: linear-gradient(180deg, #08392c, #05261d);
  color: #d6f5e8;
}
.site-footer h5, .site-footer h6 { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.copy { margin-top: 22px; border-top: 1px solid rgba(255,255,255,.15); padding-top: 14px; }

.result-modal { border-radius: 18px; border: 0; overflow: hidden; }
.result-modal .modal-header {
  background: linear-gradient(90deg, #045740, #0f8d65);
  color: #fff;
}

.floating-whatsapp {
  position: fixed;
  right: 18px;
  bottom: 22px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: #fff;
  background: #11bb59;
  box-shadow: 0 8px 25px rgba(17, 187, 89, 0.45);
  z-index: 1020;
}

.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1200;
  background: #083a2c;
  color: #d8fff0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.reveal { opacity: 0; transform: translateY(16px); transition: all .55s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 991px) {
  main { padding-top: 86px; }
  .hero-section { min-height: 66vh; }
  .cookie-banner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 576px) {
  .hero-ctas .btn { width: 100%; }
}
