/* ==========================================================================
   Design System & Estilos Oficiais — Plataforma Gestão do Cuidado (CONASEMS)
   ========================================================================== */

:root {
  /* Paleta Oficial CONASEMS */
  --primary-deep: #0e2720;        /* Verde Institucional Profundo (Header / Footer) */
  --primary-dark: #14362d;        /* Verde Institucional Principal (Hero / Destaques) */
  --primary-accent: #1e4d40;      /* Verde Médio */
  --accent-orange: #e05a2b;       /* Laranja de Ação Primária (CTAs / Destaques) */
  --accent-orange-hover: #c94b20;
  
  --bg-cream: #f4efe9;            /* Bege Suave de Fundo */
  --bg-white: #ffffff;
  --bg-light-card: #f8faf9;
  
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 54, 45, 0.08);
  --shadow-lg: 0 16px 40px rgba(20, 54, 45, 0.14);
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-cream);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* Container */
.container-custom {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ==========================================================================
   1. NAVBAR INSTITUCIONAL (LOGO NA ESQUERDA E MENU NA DIREITA)
   ========================================================================== */
.navbar-custom {
  background-color: var(--primary-deep) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.75rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
  z-index: 1050;
}

.navbar-custom .container-custom {
  width: 100%;
}

.brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-top: 1px;
}

.nav-link-custom {
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem !important;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link-custom:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler {
  padding: 0.35rem 0.65rem;
  font-size: 1.25rem;
  line-height: 1;
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: var(--radius-sm);
  color: #ffffff;
  transition: var(--transition);
}

.navbar-toggler:hover,
.navbar-toggler:focus {
  background-color: rgba(255, 255, 255, 0.12);
  outline: none;
  box-shadow: none;
}

@media (min-width: 992px) {
  .navbar-custom .container-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .navbar-custom .navbar-collapse {
    display: flex !important;
    justify-content: flex-end;
    flex-grow: 1;
  }
}

/* ==========================================================================
   2. HERO SECTION
   ========================================================================== */
.hero-section {
  background-color: var(--primary-dark);
  background-image: 
    linear-gradient(90deg, #14362d 0%, #14362d 45%, rgba(20, 54, 45, 0.92) 65%, rgba(20, 54, 45, 0.5) 85%, rgba(20, 54, 45, 0.2) 100%),
    url('../images/hero-bg-saude.jpg');
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  color: #ffffff;
  padding: 3.5rem 0 2.5rem;
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

.hero-badge i {
  color: var(--accent-orange);
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #fcd34d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 820px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.btn-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  padding: 0.95rem 1.85rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none !important;
}

.btn-primary-action {
  background-color: var(--accent-orange);
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(224, 90, 43, 0.4);
}

.btn-primary-action:hover {
  background-color: var(--accent-orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(224, 90, 43, 0.55);
}

.btn-secondary-action {
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
}

.btn-secondary-action:hover {
  background-color: #ffffff;
  color: var(--primary-dark) !important;
  border-color: #ffffff;
  transform: translateY(-2px);
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-stat-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent-orange);
  line-height: 1;
}

.hero-stat-desc {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.35;
}

.hero-stat-desc strong {
  display: block;
  color: #ffffff;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

/* ==========================================================================
   3. SECTION HEADERS & PASSO A PASSO
   ========================================================================== */
.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-orange);
  margin-bottom: 0.4rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-description {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.steps-section {
  padding: 4.5rem 0;
  background-color: var(--bg-cream);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.step-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
}

.step-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(20, 54, 45, 0.2);
}

.step-card.highlight {
  border-top: 4px solid var(--accent-orange);
}

.step-badge-num {
  position: absolute;
  top: -16px;
  left: 2rem;
  background-color: var(--primary-dark);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.3rem 1rem;
  border-radius: var(--radius-pill);
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
}

.step-card.highlight .step-badge-num {
  background-color: var(--accent-orange);
}

.step-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background-color: var(--bg-cream);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  margin-top: 0.5rem;
}

.step-title {
  font-size: 1.25rem;
  color: var(--primary-dark);
  margin-bottom: 0.65rem;
}

.step-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* ==========================================================================
   4. CRONOGRAMA & LINHA DO TEMPO (FUNDO VERDE ESCURO ELEGANTE)
   ========================================================================== */
.timeline-section {
  padding: 5rem 0;
  background-color: var(--primary-deep);
  color: #ffffff;
  position: relative;
}

.timeline-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  position: relative;
  margin-top: 2rem;
}

.timeline-track::before {
  content: '';
  position: absolute;
  top: 30px;
  left: 8%;
  right: 8%;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  z-index: 1;
}

.timeline-node {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 0.5rem;
}

.timeline-marker {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary-dark);
  border: 3px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.timeline-marker.done {
  background-color: #10b981;
  border-color: #ffffff;
  color: #ffffff;
}

.timeline-marker.active {
  background-color: var(--accent-orange);
  border-color: #ffffff;
  color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 0 0 6px rgba(224, 90, 43, 0.3);
}

.timeline-date {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  display: block;
  margin-bottom: 0.3rem;
}

.timeline-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.65rem;
}

.timeline-tag.current {
  background-color: var(--accent-orange);
  color: #ffffff;
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.timeline-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.45;
}

/* ==========================================================================
   5. GOVERNANÇA & FAQ
   ========================================================================== */
.governance-section {
  padding: 4.5rem 0;
  background-color: var(--bg-cream);
}

.governance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.governance-card {
  background-color: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.75rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.gov-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.gov-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary-dark);
}

.gov-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background-color: var(--bg-cream);
  color: var(--primary-dark);
}

.gov-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.5;
}

.faq-section {
  padding: 4.5rem 0;
  background-color: #ffffff;
}

.accordion-custom .accordion-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) !important;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.accordion-custom .accordion-button {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-dark);
  padding: 1.25rem 1.5rem;
  background-color: #ffffff;
}

.accordion-custom .accordion-button:not(.collapsed) {
  background-color: var(--bg-cream);
  color: var(--primary-dark);
  box-shadow: none;
}

.accordion-custom .accordion-body {
  padding: 1.25rem 1.5rem;
  color: var(--text-dark);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================================================
   CENTRAL DE ADESÃO (ABAS HARMONIOSAS SEM AZUL)
   ========================================================================== */
.card-adesao-central {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background-color: #ffffff;
}

.card-adesao-header {
  background-color: var(--primary-deep);
  color: #ffffff;
  padding: 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-adesao-nav-tabs {
  background-color: #ede7e0;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.5rem;
}

.card-adesao-nav-tabs .nav-link {
  color: var(--primary-dark) !important;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  background-color: transparent;
  transition: var(--transition);
}

.card-adesao-nav-tabs .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.6);
  color: var(--primary-dark) !important;
}

.card-adesao-nav-tabs .nav-link.active {
  background-color: #ffffff !important;
  color: var(--primary-dark) !important;
  box-shadow: 0 4px 14px rgba(20, 54, 45, 0.12);
  border: 1px solid rgba(20, 54, 45, 0.08);
}

.card-adesao-nav-tabs .nav-link.active i {
  color: var(--accent-orange) !important;
}

.card-adesao-nav-tabs .nav-link:not(.active) i {
  color: #64748b !important;
}

.btn-busca-cpf {
  background-color: var(--primary-dark);
  color: #ffffff !important;
  font-weight: 700;
  border: none;
  transition: var(--transition);
}

.btn-busca-cpf:hover {
  background-color: var(--primary-deep);
  color: #ffffff !important;
  transform: translateY(-1px);
}

.upload-dropzone {
  border: 2px dashed #cbd5e1;
  background-color: #f8faf9;
  transition: var(--transition);
}

.upload-dropzone:hover, .upload-dropzone.border-primary {
  border-color: var(--accent-orange) !important;
  background-color: rgba(224, 90, 43, 0.04) !important;
}

/* ==========================================================================
   6. FOOTER CONASEMS OFICIAL (VERDE ESCURO INSTITUCIONAL)
   ========================================================================== */
.footer-conasems {
  background-color: var(--primary-deep);
  color: #ffffff;
  padding: 3.5rem 0 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-col-address {
  flex: 1.6;
}

.footer-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.footer-org-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.footer-address {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.45;
  margin-bottom: 0;
}

.footer-divider-v {
  width: 1px;
  height: 64px;
  background-color: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.footer-col-contact, .footer-col-social {
  flex: 1;
}

.footer-col-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.footer-contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-contact-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.45rem;
}

.footer-contact-list a {
  color: #ffffff;
}

.footer-contact-list a:hover {
  color: var(--accent-orange);
}

.footer-social-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-social-icons a {
  color: #ffffff;
  font-size: 1.25rem;
  transition: var(--transition);
}

.footer-social-icons a:hover {
  color: var(--accent-orange);
  transform: translateY(-2px);
}

.footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
}

/* ==========================================================================
   7. RESPONSIVIDADE MOBILE & TABLET
   ========================================================================== */
@media (max-width: 991.98px) {
  .navbar-custom {
    padding: 0.65rem 0;
  }

  .navbar-custom .navbar-collapse {
    background-color: #081814;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  }

  .navbar-custom .nav-link-custom {
    padding: 0.7rem 1rem !important;
    margin-bottom: 0.35rem;
    display: block;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
  }

  .navbar-custom .nav-link-custom:hover {
    background-color: rgba(255, 255, 255, 0.12);
  }

  .hero-section {
    padding: 2.5rem 0 2rem;
    background-image: 
      linear-gradient(180deg, #14362d 0%, rgba(20, 54, 45, 0.95) 60%, rgba(20, 54, 45, 0.75) 100%),
      url('../images/hero-bg-saude.jpg');
    background-position: center;
  }

  .hero-title {
    font-size: clamp(1.85rem, 4.5vw, 2.5rem);
    line-height: 1.2;
  }

  .hero-subtitle {
    font-size: 1.02rem;
    margin-bottom: 1.75rem;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .timeline-track {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .timeline-track::before {
    display: none;
  }

  .timeline-node {
    text-align: left;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 0;
  }

  .timeline-marker {
    margin: 0;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    font-size: 1.35rem;
  }

  .hero-stats-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .card-adesao-nav-tabs {
    flex-direction: column;
    padding: 0.4rem;
  }

  .card-adesao-nav-tabs .nav-link {
    width: 100%;
    text-align: center;
    padding: 0.8rem 1rem;
    font-size: 0.92rem;
  }

  .footer-main-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
  }

  .footer-col-address, .footer-col-contact, .footer-col-social {
    width: 100%;
    flex: none;
  }

  .footer-divider-v {
    display: none;
  }

  .footer-bottom-row {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

@media (max-width: 767.98px) {
  .brand-logo {
    height: 30px;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .brand-subtitle {
    font-size: 0.6rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .hero-cta-group .btn-custom {
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .form-section {
    padding: 2rem 0 !important;
  }

  .card-adesao-header {
    padding: 1.25rem 1rem;
  }

  .tab-content {
    padding: 1.5rem 1rem !important;
  }

  .form-control, .form-select {
    font-size: 16px !important; /* Previne auto-zoom no iOS */
  }
}
