:root {
  --color-primary: #2f8a6a;
  --color-primary-700: #246d54;
  --color-heading: #1f2937;
  --color-text: #374151;
  --color-muted: #6b7280;
  --color-surface: #ffffff;
  --color-surface-soft: #f5fbf8;
  --color-footer: #111827;
  --shadow-sm: 0 6px 18px rgba(17, 24, 39, 0.08);
  --shadow-md: 0 12px 32px rgba(17, 24, 39, 0.12);
  --radius-md: 14px;
  --radius-pill: 999px;
  --transition: 0.28s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Open Sans", system-ui, -apple-system, sans-serif;
  color: var(--color-text);
  line-height: 1.7;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Raleway", system-ui, sans-serif;
  color: var(--color-heading);
  font-weight: 700;
}

a {
  color: inherit;
}

.section {
  padding: 88px 0;
}

.section-bg {
  background: var(--color-surface-soft);
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  position: relative;
  margin-bottom: 14px;
  padding-bottom: 14px;
  font-size: clamp(1.75rem, 2.5vw, 2.1rem);
}

.section-title h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 64px;
  height: 3px;
  background: var(--color-primary);
  transform: translateX(-50%);
}

.section-title p {
  margin: 0 auto;
  max-width: 720px;
  color: var(--color-muted);
}

/* ===== Topbar ===== */
.topbar {
  z-index: 1040;
  padding: 8px 0;
  font-size: 0.9rem;
  color: #e8f5f0;
  background: var(--color-primary-700);
}

.topbar a {
  text-decoration: none;
}

.topbar a i {
  margin-right: 4px;
}

.social-links a {
  opacity: 0.9;
  transition: var(--transition);
}

.social-links a:hover {
  opacity: 1;
  color: #fff;
}

/* ===== Header ===== */
.header {
  top: 42px;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  transition: var(--transition);
}

.header.scrolled {
  top: 0;
  box-shadow: var(--shadow-sm);
}

.logo {
  font-size: 1.9rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--color-heading);
}

.logo span {
  color: var(--color-primary);
}

.navbar-nav .nav-link {
  color: var(--color-text);
  font-weight: 600;
  transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--color-primary);
}

.btn-primary-pill,
.btn-outline-pill,
.btn-light-pill {
  border-radius: var(--radius-pill);
  font-weight: 700;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary-pill {
  background: var(--color-primary);
  color: #fff;
  border: 0;
  padding: 11px 24px;
}

.btn-primary-pill:hover {
  color: #fff;
  background: var(--color-primary-700);
  transform: translateY(-2px);
}

.btn-outline-pill {
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  padding: 11px 30px;
}

.btn-outline-pill:hover {
  background: #fff;
  color: var(--color-primary-700);
}

.btn-light-pill {
  background: #fff;
  color: var(--color-primary);
  padding: 11px 30px;
}

.btn-light-pill:hover {
  color: var(--color-primary-700);
  transform: translateY(-2px);
}

/* ===== Hero ===== */
/* HERO */
.hero {
  width: 100%;
  overflow: hidden;
}

/* REMOVE ALTURAS FIXAS DO BOOTSTRAP */
#heroCarousel,
.carousel-inner,
.carousel-item {
  height: auto !important;
}

/* IMAGEM RESPONSIVA SEM CORTE */
.hero-img {
  width: 100%;
  height: auto;
  display: block;
}

/* FUNDO PRA NÃO FICAR BRANCO */
.carousel-item {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
}

  /* repete para os outros */
}

/* ===== Cards ===== */
.feature-box,
.service-card,
.doctor-card,
.dept-content,
.contact-card,
.contact-form,
.faq-accordion .accordion-item {
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.feature-box,
.service-card {
  height: 100%;
  text-align: center;
  padding: 32px 24px;
  transition: var(--transition);
}

.feature-box i,
.service-card i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin-bottom: 14px;
  font-size: 1.75rem;
  color: var(--color-primary);
  background: rgba(47, 138, 106, 0.12);
  border-radius: 50%;
}

.service-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 16px;
}

.feature-box:hover,
.service-card:hover,
.doctor-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.about-list {
  padding: 0;
  margin: 20px 0 0;
  list-style: none;
}

.about-list li {
  margin-bottom: 11px;
}

.about-list i {
  margin-right: 8px;
  color: var(--color-primary);
}

/* ===== CTA ===== */
.cta {
  background: linear-gradient(135deg, var(--color-primary), #3ca37f);
  color: #fff;
}

.cta h2,
.cta p {
  color: #fff;
}

/* ===== Departments ===== */
.dept-tabs {
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  padding: 14px;
}

.dept-tabs .nav-link {
  margin-bottom: 10px;
  border-radius: 10px;
  text-align: left;
  font-weight: 600;
  color: var(--color-text);
}

.dept-tabs .nav-link.active {
  color: #fff;
  background: var(--color-primary);
}

.dept-content {
  padding: 28px;
}

/* ===== Doctors ===== */
.doctor-card {
  overflow: hidden;
  height: 100%;
  transition: var(--transition);
}

.doctor-card img {
  width: 100%;
  height: 248px;
  object-fit: cover;
}

.doctor-info {
  padding: 20px;
  text-align: center;
}

.doctor-info span {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.doctor-info .social-links {
  margin-top: 12px;
}

.doctor-info .social-links a {
  margin: 0 7px;
  color: var(--color-muted);
  transition: var(--transition);
}

.doctor-info .social-links a:hover {
  color: var(--color-primary);
}

/* ===== FAQ ===== */
.faq-accordion .accordion-item {
  overflow: hidden;
  border: 0;
  margin-bottom: 14px;
}

.faq-accordion .accordion-button {
  font-weight: 600;
}

.faq-accordion .accordion-button:not(.collapsed) {
  color: var(--color-primary-700);
  background: rgba(47, 138, 106, 0.08);
}

/* ===== Contact ===== */
.contact-map iframe {
  width: 100%;
  height: 360px;
  border: 0;
  border-radius: var(--radius-md);
}

.contact-card,
.contact-form {
  padding: 24px;
}

.contact-card p i {
  margin-right: 8px;
  color: var(--color-primary);
}

.form-control {
  border-radius: 10px;
  border-color: #d1d5db;
  padding: 12px 14px;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(47, 138, 106, 0.2);
}

.form-feedback {
  margin: 12px 0 0;
  font-size: 0.95rem;
  color: var(--color-primary-700);
}

/* ===== Footer ===== */
.footer {
  padding: 68px 0 24px;
  color: #d1d5db;
  background: var(--color-footer);
}

.footer h4 {
  margin-bottom: 18px;
  color: #fff;
}

.footer ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer li {
  margin-bottom: 8px;
}

.footer a {
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover {
  color: #fff;
}

/* ===== Floating WhatsApp ===== */
.whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999;
  width: 56px;
  height: 56px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.75rem;
  color: #fff;
  background: #25d366;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.42);
  transition: var(--transition);
}

.whatsapp-float:hover {
  color: #fff;
  transform: scale(1.06);
}

/* ===== Scroll animation ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.animate-on-scroll.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
  .header {
    top: 38px;
  }

  .navbar-collapse {
    margin-top: 10px;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .btn-primary-pill {
    display: inline-block;
    margin-top: 8px;
  }

  .hero-content {
    padding-inline: 16px;
  }
}

@media (max-width: 767.98px) {
  .section {
    padding: 70px 0;
  }

  .topbar {
    display: none;
  }

  .header {
    top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* ===== Homecare Section (additive) ===== */
.homecare-intro {
  color: var(--color-text);
  font-size: 1rem;
}

.homecare-authority {
  height: 100%;
  background: #fff;
  border: 1px solid rgba(47, 138, 106, 0.18);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.homecare-authority h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.homecare-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  min-height: 100%;
}

.homecare-card i {
  font-size: 1.5rem;
  color: var(--color-primary);
  flex-shrink: 0;
}

.homecare-card p {
  margin: 0;
}

.homecare-accordion .accordion-item {
  border-radius: var(--radius-md);
}

@media (max-width: 767.98px) {
  .homecare-authority {
    padding: 20px;
  }
}

/* ===== Homecare Services List (additive) ===== */
.homecare-services .service-item {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  height: 100%;
}

.homecare-services .service-item h5 {
  margin-bottom: 12px;
  font-size: 1rem;
  color: var(--color-heading);
}

.homecare-services .service-item ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.homecare-services .service-item ul li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  line-height: 1.5;
}

.homecare-services .service-item ul li i {
  color: var(--color-primary);
  margin-top: 2px;
  flex-shrink: 0;
}

.homecare-services .service-item ul li:last-child {
  margin-bottom: 0;
}

/* ===== Endocrinologia blog page (additive) ===== */
.blog-page {
  background: #f7fbf9;
}

.blog-page main {
  padding-top: 112px;
}

.blog-hero {
  position: relative;
  min-height: 360px;
}

.blog-hero img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: center;
}

.blog-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(17, 24, 39, 0.68), rgba(17, 24, 39, 0.34));
  display: flex;
  align-items: flex-end;
}

.blog-hero-overlay .container {
  color: #fff;
  padding-bottom: 30px;
}

.blog-hero-overlay h1 {
  color: #fff;
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.blog-hero-overlay p {
  margin: 0;
  color: #e5ece9;
}

.blog-content .blog-article {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 30px;
}

.blog-content h2 {
  margin-bottom: 14px;
}

.blog-content p {
  line-height: 1.9;
  color: #3d4958;
}

.blog-section {
  margin-top: 28px;
}

.blog-section ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.blog-section li {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.blog-section li i {
  color: var(--color-primary);
  margin-top: 3px;
}

.blog-highlight,
.blog-highlight-soft {
  border-radius: 12px;
  padding: 18px;
}

.blog-highlight {
  background: #f2f7f5;
}

.blog-highlight-soft {
  background: #f7faf8;
  border-left: 4px solid rgba(47, 138, 106, 0.5);
}

.blog-cta {
  margin-top: 30px;
  padding: 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2f8a6a, #3ca37f);
  color: #fff;
}

.blog-cta h3,
.blog-cta p {
  color: #fff;
}

@media (max-width: 991.98px) {
  .blog-page main {
    padding-top: 104px;
  }

  .blog-hero,
  .blog-hero img {
    min-height: 320px;
    height: 320px;
  }
}

@media (max-width: 767.98px) {
  .blog-page main {
    padding-top: 76px;
  }

  .blog-hero,
  .blog-hero img {
    min-height: 270px;
    height: 270px;
  }

  .blog-content .blog-article {
    padding: 22px;
  }
}

/* ===== Especialidades estáticas (refactor) ===== */
#services .especialidade-item {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 24px;
  height: 100%;
  border: 1px solid #e8efeb;
}

#services .especialidade-item h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

#services .especialidade-item p {
  color: #4b5563;
  margin-bottom: 16px;
}

.btn-saiba-mais {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(47, 138, 106, 0.12);
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
}

.btn-saiba-mais:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ===== Serviços estáticos com botão Saiba mais (ajuste pontual) ===== */
#services .service-card {
  transform: none !important;
  transition: none !important;
  text-align: left;
}

#services .service-card:hover {
  transform: none !important;
  box-shadow: var(--shadow-sm) !important;
}

#services .service-card .btn-saiba-mais-card {
  margin-top: 4px;
}

@media (max-width: 767.98px) {
  #services .service-card .btn-saiba-mais-card {
    width: 100%;
    text-align: center;
  }
}

/* ===== Ajuste isolado: centralização completa dos cards em #services ===== */
#services .service-card {
  text-align: center;
}

#services .service-card img {
  display: block;
  margin: 0 auto 16px;
}

#services .service-card i {
  display: inline-flex;
  margin: 0 auto 12px;
}

#services .service-card h3 {
  margin-bottom: 10px;
}

#services .service-card p {
  margin-bottom: 0;
}

#services .service-card .btn-saiba-mais-card {
  margin-top: 14px;
}