:root {
  --primary-color: #047857;
  --secondary-color: #10B981;
  --accent-color: #064E3B;
  --background-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #1e293b;
  --muted-color: #52627a;
  --transition-speed: 0.3s;
  --gradient-primary: linear-gradient(135deg, #064E3B, #047857);
  --divider-gradient: linear-gradient(to right, transparent, var(--secondary-color), transparent);
  --success: #198754;
  --warning: #ffc107;
  --danger: #dc3545;
  --cbaf: #0e7490;
  --cesaf: #b45309;
  --ceaf: #7c3aed;
  --shadow: 0 10px 40px rgba(6, 78, 59, 0.08);
}

body.dark-mode {
  --background-color: #121212;
  --card-bg: #1e1e1e;
  --text-color: #e0e0e0;
  --muted-color: #aab6c5;
  --primary-color: #6EE7B7;
  --secondary-color: #10B981;
  --gradient-primary: linear-gradient(135deg, #022C22, #065F46);
  --divider-gradient: linear-gradient(to right, transparent, #10b981, transparent);
  --success: #34D399;
  --warning: #FBBF24;
  --danger: #F87171;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--background-color);
  color: var(--text-color);
  padding-top: 100px;
  transition: background-color var(--transition-speed);
}

p, li, .accordion-body, .disclaimer, blockquote { text-align: start; }

a { color: var(--primary-color); }
body.dark-mode a { color: var(--primary-color); }
body.dark-mode a.btn-primary { color: #fff; }

/* ============ Cabeçalho ============ */
header {
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1050;
  padding: 0 20px;
  transition: all var(--transition-speed);
}
body.dark-mode header { background: rgba(18, 18, 18, 0.95); box-shadow: 0 4px 30px rgba(255, 255, 255, 0.1); }
body.dark-mode .navbar-toggler { border-color: rgba(255, 255, 255, 0.42); }
body.dark-mode .navbar-toggler-icon { filter: invert(1) grayscale(1) brightness(2); }

.logo-container { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--gradient-primary); color: #fff; font-size: 1.15rem;
  box-shadow: 0 6px 16px rgba(6, 95, 70, 0.35);
}
.logo-text { font-weight: 800; font-size: 1.15rem; line-height: 1.2; color: var(--text-color); display: flex; flex-direction: column; }
.logo-mark img { width: 100%; height: 100%; border-radius: inherit; display: block; }
.logo-text span { color: var(--secondary-color); }
.logo-text small { font-size: 0.875rem; font-weight: 600; color: var(--muted-color); letter-spacing: 0; line-height: 1.4; white-space: normal; margin-top: 3px; }

.navbar-nav .nav-link {
  color: var(--text-color) !important;
  font-weight: 500;
  padding: 0.5rem 1.1rem !important;
  position: relative;
}
.navbar-nav .nav-link::after {
  content: ''; position: absolute; bottom: 0; left: 1.1rem;
  width: 0; height: 2px; background: var(--secondary-color);
  transition: width var(--transition-speed) ease;
}
.navbar-nav .nav-link:hover::after { width: calc(100% - 2.2rem); }
.dark-mode-toggle { cursor: pointer; font-size: 1.2rem; background: none; border: 0; }

/* ============ Hero ============ */
.hero {
  min-height: 88vh;
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  text-align: center; position: relative; z-index: 10; padding: 90px 20px 70px; overflow: visible;
}
.hero::before {
  /* O fundo fica dentro da faixa; as sugestões podem aparecer sobre a seção seguinte. */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 10%, transparent 11%);
  background-size: 50px 50px;
  animation: grid-animation 20s linear infinite;
}
@keyframes grid-animation { 0% { background-position: 0 0; } 100% { background-position: -50px -50px; } }

.hero-content { position: relative; z-index: 1; color: #fff; max-width: 900px; width: 100%; }
.hero-badge {
  display: inline-block; background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 8px 18px; border-radius: 50px; font-size: 1rem; font-weight: 600; margin-bottom: 22px;
  backdrop-filter: blur(6px);
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 800; margin-bottom: 18px; letter-spacing: -1px; }
.hero .lead { font-size: 1.1rem; line-height: 1.65; max-width: 66ch; margin: 0 auto 30px; color: rgba(255, 255, 255, 0.95); text-align: center; }

/* Busca do hero */
.hero-search { max-width: 720px; margin: 0 auto; }
.hero-hints { margin-top: 14px; color: rgba(255, 255, 255, 0.85); font-size: 1rem; }
.hint-chip {
  background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.4); color: #fff;
  border-radius: 50px; padding: 9px 18px; font-size: 1rem; margin: 4px 3px; cursor: pointer;
  transition: all var(--transition-speed);
}
.hint-chip:hover { background: rgba(255, 255, 255, 0.3); }

.hero-stats { display: flex; justify-content: center; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.stat {
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px; padding: 14px 22px; min-width: 150px; backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.stat i { font-size: 1.1rem; opacity: 0.9; }
.stat span { font-size: 1.35rem; font-weight: 800; }
.stat small { font-size: 1rem; opacity: 0.85; }

/* ============ Busca + Autocomplete ============ */
.search-wrap { position: relative; }
.search-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--muted-color); z-index: 5; pointer-events: none;
}
.search-input {
  width: 100%; padding: 16px 52px 16px 48px;
  border-radius: 50px; border: 2px solid transparent;
  background: var(--card-bg); color: var(--text-color);
  font-size: 1rem; box-shadow: 0 8px 30px rgba(6, 78, 59, 0.20);
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}
.search-input:focus {
  outline: none; border-color: var(--secondary-color);
  box-shadow: 0 8px 34px rgba(16, 185, 129, 0.35);
}
.search-input::placeholder { color: #5c6b80; opacity: 1; }
body.dark-mode .search-input::placeholder { color: #c3cdd9; }
.text-muted { color: var(--muted-color) !important; }
.hero .search-input { padding: 18px 52px 18px 52px; font-size: 1.05rem; }
.search-wrap .btn-clear {
  position: absolute; right: 54px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted-color); cursor: pointer; display: none;
  z-index: 5; font-size: 1.1rem; width: 44px; height: 44px;
}
.search-wrap .btn-search {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--gradient-primary); color: #fff; cursor: pointer; z-index: 5;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.search-wrap .btn-search:hover { transform: translateY(-50%) scale(1.08); box-shadow: 0 6px 18px rgba(6, 95, 70, 0.35); }
.search-wrap .btn-search:disabled { cursor: not-allowed; opacity: 0.42; box-shadow: none; }

.suggestions {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0;
  background: var(--card-bg); border-radius: 20px; box-shadow: 0 20px 50px rgba(4, 47, 34, 0.28);
  z-index: 1100; max-height: 380px; overflow-y: auto; display: none; text-align: left;
  border: 1px solid rgba(6, 78, 59, 0.08);
}
.suggestions.open { display: block; }
.sug-header {
  padding: 12px 20px 4px; font-size: 1rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--muted-color);
}
.sug-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px; min-height: 52px; cursor: pointer;
  border-left: 3px solid transparent; transition: background 0.15s, border-color 0.15s;
}
.sug-item:hover, .sug-item.active { background: rgba(16, 185, 129, 0.10); border-left-color: var(--secondary-color); }
.sug-item .sug-ico {
  width: 34px; height: 34px; min-width: 34px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 1rem; color: #fff;
}
.sug-ico.med { background: var(--gradient-primary); }
.sug-ico.marca { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.sug-ico.doenca { background: linear-gradient(135deg, #059669, #10b981); }
.sug-item .sug-main { font-weight: 600; color: var(--text-color); font-size: 1rem; line-height: 1.25; }
.sug-item .sug-sub { font-size: 1rem; color: var(--muted-color); line-height: 1.4; }
.sug-item mark { background: rgba(16, 185, 129, 0.28); color: inherit; border-radius: 3px; padding: 0 1px; }
.sug-empty { padding: 18px 22px; color: var(--muted-color); font-size: 1rem; }

/* ============ Seções ============ */
.content-section { padding: 40px 16px 20px; }
.section-title { font-weight: 800; color: var(--primary-color); letter-spacing: -0.5px; margin-bottom: 12px; font-size: clamp(1.45rem, 2.6vw, 1.9rem); line-height: 1.25; }
.section-subtitle { color: var(--muted-color); max-width: 68ch; margin: 0 auto 12px; font-size: clamp(1rem, 1.4vw, 1.08rem); line-height: 1.65; }
.section-divider { height: 2px; background: var(--divider-gradient); margin: 30px 0 10px; opacity: 0.6; }

.disclaimer {
  background: rgba(255, 193, 7, 0.12); border-left: 5px solid var(--warning);
  border-radius: 12px; padding: 20px 24px; font-size: 1rem; color: var(--text-color);
}
.disclaimer p { max-width: 72ch; }
.result-card > p, .fd-steps li, .alert-rules > div, .accordion-body, .component-card p, .component-card ul li div { max-width: 72ch; }

.form-section {
  background: var(--card-bg); border-radius: 24px; padding: 28px;
  box-shadow: var(--shadow); margin: 0 auto; max-width: 980px;
}

/* ============ Badges de componente ============ */
.badge-comp {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 50px;
  font-size: 1rem; font-weight: 700; color: #fff; letter-spacing: 0.3px; margin: 2px;
}
.badge-comp::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.85); }
.badge-comp.cbaf { background: var(--cbaf); }
.badge-comp.cesaf { background: var(--cesaf); }
.badge-comp.ceaf { background: var(--ceaf); }
.badge-comp.outro { background: #475569; }
.badge-comp.no-match { background: #b42318; }
.badge-ceaf {
  display: inline-block; background: var(--ceaf); color: #fff; font-size: 1rem; font-weight: 700;
  padding: 3px 10px; border-radius: 50px; vertical-align: middle; letter-spacing: 0.5px;
}

/* ============ Resultado ============ */
.result-card {
  background: var(--card-bg); border-radius: 20px; padding: 26px;
  box-shadow: var(--shadow); border-top: 4px solid var(--secondary-color);
  animation: fadeInUp 0.4s ease;
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.result-card.not-found { border-top-color: var(--danger); }
.result-card.ok-ceaf { border-top-color: var(--ceaf); }

.result-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.result-head h3 { font-weight: 800; color: var(--primary-color); margin: 0; letter-spacing: -0.4px; }
.result-head .result-kind { color: var(--muted-color); font-size: 1rem; line-height: 1.5; }

.brand-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.brand-chip {
  background: rgba(99, 102, 241, 0.10); color: #4338ca; border: 1px solid rgba(67, 56, 202, 0.28);
  border-radius: 50px; padding: 3px 12px; font-size: 1rem; font-weight: 600;
}
body.dark-mode .brand-chip { color: #c7d2fe; border-color: rgba(199, 210, 254, 0.3); }
.brand-more { font-size: 1rem; color: var(--muted-color); align-self: center; cursor: pointer; }

.meds-table { width: 100%; font-size: 1rem; border-collapse: collapse; }
.meds-table th {
  text-align: left; padding: 8px 10px; color: var(--muted-color); font-size: 1rem;
  text-transform: uppercase; letter-spacing: 0.6px; border-bottom: 2px solid rgba(6, 78, 59, 0.14);
}
.meds-table td { padding: 9px 10px; border-bottom: 1px solid rgba(6, 78, 59, 0.08); vertical-align: top; }
.meds-table tr:last-child td { border-bottom: none; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin: 16px 0; }
.info-item {
  background: var(--background-color); border-radius: 14px; padding: 12px 16px; font-size: 1rem; line-height: 1.5;
}
.info-item b { display: block; color: #52627a; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.info-item small { display: block; margin-top: 5px; color: var(--muted-color); line-height: 1.4; }
body.dark-mode .info-item b { color: #c9d3e0; }

.disease-chip {
  display: inline-block; background: rgba(4, 120, 87, 0.08); color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.28); border-radius: 50px;
  padding: 3px 12px; font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1.5; margin: 2px;
}
body.dark-mode .disease-chip { color: #6ee7b7; }
.disease-chip.clickable { cursor: pointer; }
.disease-chip.clickable:hover { background: rgba(5, 150, 105, 0.22); }

.cid-chip {
  display: inline-block; background: rgba(124, 58, 237, 0.1); color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.25); border-radius: 6px;
  padding: 2px 8px; font-size: 1rem; font-weight: 700; margin: 2px; font-family: monospace;
}
body.dark-mode .cid-chip { color: #c4b5fd; }

.docs-list { list-style: none; padding: 0; margin: 8px 0; }
.docs-list li {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: 12px;
  background: var(--background-color); margin-bottom: 8px; font-size: 1rem; line-height: 1.5;
}
.docs-list i { color: var(--secondary-color); margin-top: 3px; }
.docs-list a { font-weight: 600; }

.alert-rules {
  background: rgba(16, 185, 129, 0.10); border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 16px; color: var(--text-color); font-size: 1rem;
}
.alert-warn {
  background: rgba(220, 53, 69, 0.07); border: 1px solid rgba(220, 53, 69, 0.25);
  border-radius: 16px; color: var(--text-color); font-size: 1rem;
}
.status-callout {
  margin: 12px 0 16px; padding: 12px 15px; border-radius: 12px;
  font-size: 1rem; line-height: 1.45;
}
.status-unconfirmed {
  background: rgba(180, 35, 24, 0.08); border: 1px solid rgba(180, 35, 24, 0.30); color: #8f1d14;
}
body.dark-mode .status-unconfirmed { color: #fda29b; border-color: rgba(253, 162, 155, 0.38); }
.component-owner {
  margin: 10px 0 12px; padding: 10px 13px; border-left: 4px solid var(--secondary-color);
  border-radius: 8px; background: rgba(16, 185, 129, 0.08); font-size: 1rem;
}

.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.result-actions .btn { border-radius: 50px; font-weight: 600; font-size: 1rem; padding: 11px 24px; min-height: 44px; }
.pdf-share-status { border: 1px solid var(--border-color); border-radius: 14px; padding: 16px; font-size: 1rem; }
.pdf-share-status p { line-height: 1.6; }
.pdf-share-status .btn { font-size: 1rem; min-height: 44px; padding: 10px 20px; }
.btn-whatsapp {
  --bs-btn-color: #047857; --bs-btn-border-color: #047857;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #047857; --bs-btn-hover-border-color: #047857;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #065f46; --bs-btn-active-border-color: #065f46;
}
body.dark-mode .btn-whatsapp {
  --bs-btn-color: #6ee7b7; --bs-btn-border-color: #6ee7b7;
  --bs-btn-hover-color: #022c22; --bs-btn-hover-bg: #6ee7b7; --bs-btn-hover-border-color: #6ee7b7;
  --bs-btn-active-color: #022c22; --bs-btn-active-bg: #34d399; --bs-btn-active-border-color: #34d399;
}

.flow-mini { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.flow-mini span {
  font-size: 1rem; background: var(--background-color); border-radius: 50px; padding: 4px 12px;
  border: 1px solid rgba(6, 78, 59, 0.12); color: var(--text-color);
}

/* ============ Cards de componente ============ */
.component-card {
  background: var(--card-bg); border-radius: 22px; padding: 26px; box-shadow: var(--shadow);
  position: relative; overflow: hidden; transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.component-card:hover { transform: translateY(-6px); box-shadow: 0 18px 50px rgba(6, 78, 59, 0.18); }
.component-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
}
.component-card.cbaf::after { background: var(--cbaf); }
.component-card.cesaf::after { background: var(--cesaf); }
.component-card.ceaf::after { background: var(--ceaf); }
.comp-icon {
  width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff; margin-bottom: 14px;
}
.component-card.cbaf .comp-icon { background: linear-gradient(135deg, #0e7490, #06b6d4); }
.component-card.cesaf .comp-icon { background: linear-gradient(135deg, #b45309, #f59e0b); }
.component-card.ceaf .comp-icon { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.comp-tag { font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; }
.comp-tag.cbaf { color: var(--cbaf); } .comp-tag.cesaf { color: var(--cesaf); } .comp-tag.ceaf { color: var(--ceaf); }
.component-card h3 { font-size: 1.15rem; font-weight: 800; color: var(--text-color); margin: 6px 0 10px; }
.component-card p { font-size: 1rem; color: var(--muted-color); }
.component-card ul { list-style: none; padding: 0; margin: 12px 0; }
.component-card ul li { display: flex; gap: 10px; font-size: 1rem; margin-bottom: 10px; text-align: left; }
.component-card ul i { color: var(--secondary-color); margin-top: 3px; }
.comp-link { font-size: 1rem; font-weight: 700; text-decoration: none; }

/* ============ Passos CEAF ============ */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.step-card {
  background: var(--card-bg); border-radius: 20px; padding: 24px; box-shadow: var(--shadow);
  position: relative; transition: transform var(--transition-speed);
}
.step-card:hover { transform: translateY(-4px); }
.step-num {
  position: absolute; top: -16px; left: 22px; width: 38px; height: 38px; border-radius: 12px;
  background: var(--gradient-primary); color: #fff; font-weight: 800; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(6, 78, 59, 0.32);
}
.step-card h3 { font-size: 1rem; font-weight: 800; margin: 12px 0 10px; color: var(--primary-color); }
.step-card ul { padding-left: 18px; margin: 0; }
.step-card li { font-size: 1rem; margin-bottom: 8px; }

/* ============ Links ============ */
.link-grid { justify-content: center; }
.link-tile {
  display: flex; align-items: center; gap: 14px; background: var(--card-bg); border-radius: 16px;
  padding: 16px 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--text-color);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.link-tile:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(6, 78, 59, 0.16); color: var(--text-color); }
.link-tile i { font-size: 1.3rem; color: var(--secondary-color); min-width: 30px; text-align: center; }
.link-tile b { display: block; font-size: 1rem; }
.link-tile small { color: var(--muted-color); font-size: 1rem; }

/* ============ FAQ ============ */
.faq-accordion .accordion-item {
  border: none; border-radius: 16px !important; margin-bottom: 12px; overflow: hidden;
  background: var(--card-bg); box-shadow: var(--shadow);
}
.faq-accordion .accordion-button {
  font-weight: 700; font-size: 1rem; background: var(--card-bg); color: var(--text-color);
  padding: 18px 22px;
}
.faq-accordion .accordion-button:not(.collapsed) { color: var(--primary-color); box-shadow: none; }
.faq-accordion .accordion-button:focus { box-shadow: none; border: none; }
.faq-accordion .accordion-button::after {
  background-size: 0.9rem; background-color: var(--secondary-color); border-radius: 50%;
  background-position: center; width: 1.6rem; height: 1.6rem;
}
.faq-accordion .accordion-body { font-size: 1rem; color: var(--muted-color); padding-top: 0; }

/* ============ Footer (rodapé oficial SES-MG, igual ao do Licenciamento Sanitário) ============ */
footer {
  background: var(--background-color); color: var(--text-color);
  padding: 2rem 0; margin-top: 40px; text-align: center;
  border-top: 1px solid #e2e8f0; font-size: 1rem; line-height: 1.5;
}
body.dark-mode footer { background: #1e1e1e; border-top-color: #444; }
footer .footer-logo-img { height: 105px; width: auto; }
body:not(.dark-mode) footer .footer-logo { filter: invert(1); }
body.dark-mode footer .footer-logo { filter: none; }
footer .info-text { font-family: Arial, sans-serif; }
footer a { color: var(--text-color); }
footer a:hover { color: var(--primary-color); }
footer .info-text .text-decoration-underline { display: inline-block; }
body.dark-mode footer a { color: var(--text-color); }
body.dark-mode footer a:hover { color: var(--primary-color); }
.footer-social { display: flex; justify-content: center; gap: 0; margin: -8px 0 -10px; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; font-size: 1.125rem; text-decoration: none;
}
.footer-version {
  width: 100%; text-align: center; margin-top: 1.25rem; padding: 0.75rem 12px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.75rem; line-height: 1.5; font-weight: 500; letter-spacing: 0.5px; color: var(--muted-color);
}
footer .footer-credit { max-width: none; margin: 0 0 0.25rem; font-size: 0.75rem; line-height: 1.5; letter-spacing: 0; text-align: center; }
body.dark-mode .footer-version { border-top-color: rgba(255, 255, 255, 0.1); }

/* ============ Responsivo ============ */
@media (max-width: 768px) {
  body { padding-top: 100px; }
  .hero { min-height: 92vh; padding: 70px 16px 50px; }
  .form-section { padding: 18px; border-radius: 18px; }
  .search-input { padding: 14px 50px 14px 44px; font-size: 1rem; }
  .hero .search-input { font-size: 1rem; }
  .meds-table { display: block; overflow-x: auto; }
  .stat { min-width: 120px; padding: 10px 14px; }
  .result-card { padding: 18px; }
  .steps { gap: 26px; }
  p, li, .accordion-body, .disclaimer, blockquote { text-align: left; }
}

@media (max-width: 480px) {
  header { padding: 0 10px; }
  .logo-container { gap: 8px; }
  .logo-mark { width: 36px; height: 36px; }
  .logo-text { font-size: 1.02rem; }
  .logo-text small { font-size: 0.875rem; letter-spacing: 0; }
}

/* ============ Fluxo encadeado (stepper) ============ */
.chain { display: flex; flex-direction: column; gap: 26px; position: relative; max-width: 980px; margin: 0 auto; }
.chain-step { position: relative; display: flex; gap: 16px; }
.chain-marker {
  width: 44px; height: 44px; min-width: 44px; border-radius: 14px; z-index: 2;
  background: var(--card-bg); border: 2px solid var(--secondary-color); color: var(--primary-color);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem;
  box-shadow: 0 6px 18px rgba(6, 78, 59, 0.20); transition: all var(--transition-speed);
}
.chain-marker i { display: none; }
.chain-step::before {
  content: ''; position: absolute; left: 21px; top: 44px; bottom: -32px; width: 2px;
  background: linear-gradient(to bottom, var(--secondary-color), rgba(16, 185, 129, 0.16)); z-index: 1;
}
.chain-step:last-child::before { display: none; }
.chain-step.disabled .chain-marker {
  background: var(--background-color); border-color: rgba(100, 116, 139, 0.35); color: var(--muted-color);
  box-shadow: none;
}
.chain-step.disabled .chain-card { pointer-events: none; }
.chain-step.done .chain-marker { background: var(--gradient-primary); border-color: transparent; color: #fff; }
.chain-step.done .chain-marker span { display: none; }
.chain-step.done .chain-marker i { display: block; font-size: 1rem; }
.chain-card { flex: 1; min-width: 0; }
.chain-card .search-wrap, .chain-card .search-input { max-width: 100%; }
.meds-table code, #chainResult code { white-space: normal; word-break: break-word; }
.chain-title { font-weight: 800; color: var(--primary-color); font-size: 1.05rem; margin-bottom: 4px; }

/* Opções de apresentação (dose conforme receita) */
.apres-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.apres-option {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; cursor: pointer;
  background: var(--card-bg); border: 2px solid rgba(6, 78, 59, 0.14); border-radius: 16px;
  transition: all 0.18s ease;
}
.apres-option:hover { border-color: var(--secondary-color); transform: translateX(3px); }
.apres-option.selected {
  border-color: var(--secondary-color); background: rgba(16, 185, 129, 0.10);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.20);
}
.apres-radio {
  width: 22px; height: 22px; min-width: 22px; border-radius: 50%; margin-top: 2px;
  border: 2px solid rgba(6, 95, 70, 0.35); display: flex; align-items: center; justify-content: center;
  transition: all 0.18s ease; color: transparent; font-size: 1rem;
}
.apres-option.selected .apres-radio { border-color: var(--secondary-color); background: var(--secondary-color); color: #fff; }
.apres-main { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.apres-sub { color: var(--muted-color); font-size: 1rem; line-height: 1.4; }
.apres-side { margin-left: auto; text-align: right; }

.chosen-summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(25, 135, 84, 0.08); border: 1px solid rgba(25, 135, 84, 0.3);
  border-radius: 14px; padding: 10px 16px; font-size: 1rem; animation: fadeInUp 0.3s ease;
}
.chosen-summary .x-btn {
  margin-left: auto; border: none; background: none; color: var(--danger); cursor: pointer; font-size: 1rem;
  width: 44px; height: 44px; border-radius: 50%;
}
@media (max-width: 768px) {
  .chain { gap: 20px; }
  .chain-marker { width: 36px; height: 36px; min-width: 36px; border-radius: 11px; font-size: 1rem; }
  .chain-step { gap: 10px; }
  .chain-step::before { left: 17px; top: 36px; bottom: -26px; }
  .apres-side { margin-left: 0; text-align: left; width: 100%; }
}

/* Bloco Farmácia Digital */
.fd-card { border-top: 4px solid #0ea5a4; }
.fd-steps { padding-left: 20px; margin: 6px 0 10px; }
.fd-steps li { font-size: 1rem; margin-bottom: 6px; }
.fd-links { display: flex; gap: 16px; flex-wrap: wrap; }
.fd-links a { font-size: 1rem; font-weight: 700; }
.disease-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* Município, regionalização e ponto de dispensação */
.privacy-inline {
  margin: 12px 2px 0; color: var(--muted-color); font-size: 1rem;
}
.municipio-picked {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 15px; border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 14px; background: rgba(16, 185, 129, 0.08);
}
.municipio-picked strong { color: var(--primary-color); }
.municipio-picked > span { flex: 1 1 260px; min-width: 0; }
.municipio-change-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; margin-left: auto; padding: 0 15px;
  border: 1px solid rgba(4, 120, 87, 0.28); border-radius: 999px;
  background: var(--card-bg); color: var(--primary-color);
  font: inherit; font-size: 1rem; font-weight: 750; line-height: 1;
  cursor: pointer; box-shadow: 0 4px 12px rgba(6, 78, 59, 0.08);
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease, transform 0.18s ease;
}
.municipio-change-btn:hover {
  color: var(--accent-color); background: rgba(16, 185, 129, 0.12);
  border-color: var(--secondary-color); box-shadow: 0 6px 16px rgba(6, 78, 59, 0.14);
  transform: translateY(-1px);
}
.municipio-change-btn:active { box-shadow: none; transform: translateY(0); }
body.dark-mode .municipio-change-btn {
  background: rgba(16, 185, 129, 0.10); border-color: rgba(110, 231, 183, 0.42);
}
body.dark-mode .municipio-change-btn:hover {
  color: #ecfdf5; background: rgba(16, 185, 129, 0.22); border-color: var(--primary-color);
}
.territory-card { border-top: 4px solid #0e7490; }
.access-title {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.access-title h4 { margin: 2px 0 0; color: var(--primary-color); font-weight: 800; }
.eyebrow {
  display: block; color: var(--muted-color); font-size: 1rem; font-weight: 800;
  letter-spacing: 0.7px;
}
.verified-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  color: #0f766e; background: rgba(13, 148, 136, 0.1); border: 1px solid rgba(13, 148, 136, 0.24);
  font-size: 1rem; font-weight: 800;
}
.access-journey { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.journey-stage {
  min-width: 0; padding: 18px; border-radius: 18px; border: 1px solid rgba(6, 78, 59, 0.14);
  background: var(--background-color);
}
.opening-stage { border-top: 4px solid #2563eb; }
.withdrawal-stage { border-top: 4px solid var(--secondary-color); }
.stage-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.stage-heading > span {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 11px; color: #fff; background: var(--gradient-primary);
  font-size: 1rem; font-weight: 900;
}
.opening-stage .stage-heading > span { background: #2563eb; }
.stage-heading small { display: block; color: var(--muted-color); font-size: 1rem; font-weight: 900; letter-spacing: 0.65px; }
.stage-heading h5 { margin: 0; color: var(--text-color); font-size: 1rem; font-weight: 850; line-height: 1.25; }
.journey-stage > p { font-size: 1rem; }
.journey-stage .dispensing-unit { padding: 14px; }
.journey-stage .dispensing-unit h5, .journey-stage .dispensing-unit h6 { font-size: 1rem; }
.unit-hours { margin: 6px 0 8px; color: var(--text-color); font-size: 1rem; }
.unit-hours i { color: #2563eb; }
.stage-action {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 12px; padding: 11px 12px;
  border-radius: 12px; background: rgba(37, 99, 235, 0.08); font-size: 1rem;
}
.stage-action.neutral { background: transparent; padding: 6px 0 0; }
.request-channel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.request-channel-grid.has-digital { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.request-channel {
  min-width: 0; padding: 15px; border-radius: 15px; color: var(--text-color);
  border: 1px solid rgba(6, 78, 59, 0.16); background: var(--card-bg);
}
.digital-channel { align-self: start; background: rgba(14, 165, 164, 0.09); border-color: rgba(14, 165, 164, 0.28); }
.presencial-channel { background: rgba(37, 99, 235, 0.045); border-color: rgba(37, 99, 235, 0.2); }
.channel-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.channel-heading > span {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 10px; color: #fff; background: #0f766e;
}
.presencial-channel .channel-heading > span { background: #2563eb; }
.channel-heading small { display: block; color: var(--muted-color); font-size: 1rem; font-weight: 900; letter-spacing: 0.65px; }
.channel-heading h4, .channel-heading h6 { margin: 0; color: var(--text-color); font-size: 1rem; font-weight: 850; }
.request-channel > p, .request-channel > div > p { font-size: 1rem; }
.request-channel .dispensing-list { margin-top: 10px; }
.method-details { margin-top: 16px; }
.method-details > summary { color: var(--primary-color); }
.territory-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 10px; margin: 14px 0 4px;
}
.territory-item {
  min-width: 0; padding: 12px 14px; border-radius: 13px;
  border: 1px solid rgba(14, 116, 144, 0.2); background: rgba(14, 116, 144, 0.06);
  overflow-wrap: anywhere;
}
.territory-item span {
  display: block; margin-bottom: 3px; color: var(--muted-color);
  font-size: 1rem; font-weight: 800; letter-spacing: 0.45px; text-transform: uppercase;
}
.territory-item b { display: block; color: var(--text-color); font-size: 1rem; }
.route-status {
  display: flex; align-items: flex-start; gap: 11px; margin: 14px 0;
  padding: 13px 15px; border-radius: 14px; border: 1px solid rgba(124, 58, 237, 0.22);
  background: rgba(124, 58, 237, 0.07); font-size: 1rem;
}
.route-status > i { margin-top: 3px; color: var(--ceaf); }
.dispensing-list { display: grid; gap: 12px; margin-top: 12px; }
.dispensing-unit {
  border: 1px solid rgba(6, 78, 59, 0.16); border-radius: 16px;
  padding: 16px; background: var(--card-bg);
}
.dispensing-unit-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.dispensing-unit h5, .dispensing-unit h6 { margin: 0; color: var(--text-color); font-size: 1rem; font-weight: 800; }
.channel-jump { display: none; }
.diagnosis-codes { margin-top: 7px; }
.diagnosis-codes summary {
  cursor: pointer; color: var(--muted-color); font-size: 1rem; font-weight: 700;
}
.diagnosis-codes div { margin-top: 5px; }
.unit-type {
  display: inline-flex; margin-bottom: 5px; color: var(--ceaf); font-size: 1rem;
  font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase;
}
.unit-cnes {
  flex: 0 0 auto; padding: 4px 8px; border-radius: 999px;
  background: var(--background-color); color: var(--muted-color); font: 700 1rem/1.5 monospace;
}
.unit-address { margin: 10px 0 8px; color: var(--text-color); font-size: 1rem; }
.unit-address i { color: var(--secondary-color); }
.unit-contact { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.unit-contact a, .unit-contact span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
  padding: 7px 11px; border: 1px solid rgba(6, 95, 70, 0.2); border-radius: 999px;
  color: var(--primary-color); background: rgba(16, 185, 129, 0.06);
  font-size: 1rem; font-weight: 700; text-decoration: none;
}
.unit-contact a:hover { background: rgba(16, 185, 129, 0.14); }
.unit-source { margin-top: 10px; color: var(--muted-color); font-size: 1rem; }
.source-freshness {
  margin-top: 14px; padding: 12px 14px; border-left: 4px solid #d97706;
  border-radius: 10px; background: rgba(217, 119, 6, 0.08); font-size: 1rem;
}
.live-note { color: var(--muted-color); font-size: 1rem; }
body.dark-mode .territory-item { border-color: rgba(103, 232, 249, 0.2); background: rgba(14, 116, 144, 0.13); }
body.dark-mode .route-status { border-color: rgba(196, 181, 253, 0.28); }
body.dark-mode .unit-contact a, body.dark-mode .unit-contact span { color: #6ee7b7; }
body.dark-mode .verified-pill { color: #99f6e4; }

@media (max-width: 1100px) {
  .request-channel-grid.has-digital { grid-template-columns: 1fr; }
  .channel-jump { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 1rem; font-weight: 750; }
}

@media (max-width: 480px) {
  .journey-stage { padding: 14px; }
  .stage-action .btn { width: 100%; }
}

/* ============ Impressão ============ */
@media print {
  .pdf-share-status { display: none !important; }
  header, footer, .hero, .hero-hints, .suggestions, .btn-search, .btn-clear, .result-actions, #faq, #links, #componentes, #fluxo, .search-wrap, .section-divider, .chain-step.disabled { display: none !important; }
  body { padding-top: 0; background: #fff; }
  .result-card, .form-section, .chain-card { box-shadow: none; border: 1px solid #ddd; }
  .disclaimer { background: #fffbea; }
}

/* Botão instalar (PWA) */
.install-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gradient-primary); color: #fff; border: none;
  border-radius: 50px; padding: 8px 16px; font-weight: 700; font-size: 1rem;
  cursor: pointer; margin-right: 6px;
  box-shadow: 0 6px 16px rgba(6, 95, 70, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.install-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(6, 95, 70, 0.45); }
.install-btn[hidden] { display: none; }
@media (max-width: 768px) { .install-btn { padding: 6px 12px; font-size: 1rem; } }

/* Detalhes técnicos (recolhíveis) */
.tech-details {
  margin: 10px 0 0; border: 1px dashed rgba(6, 78, 59, 0.3); border-radius: 12px;
  padding: 8px 14px; background: var(--background-color);
}
.tech-details summary {
  cursor: pointer; font-size: 1rem; font-weight: 700; color: var(--muted-color);
  list-style: none; user-select: none;
}
.tech-details summary::-webkit-details-marker { display: none; }
.tech-details[open] summary { margin-bottom: 8px; }
.tech-details .info-grid { margin: 4px 0 8px; }

/* ===== UX / Acessibilidade — boas práticas (WCAG 2.1 AA + eMAG) ===== */

/* Foco visível para navegação por teclado */
:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 8px;
}
.hero :focus-visible { outline-color: #fff; }
.sug-item:focus-visible, .apres-option:focus-visible { outline-offset: -3px; }

/* Link "Pular para o conteúdo" (recomendação eMAG) */
.skip-link {
  position: fixed; left: 12px; top: 0; transform: translateY(-150%); z-index: 2000;
  background: var(--primary-color); color: #fff; font-weight: 700; font-size: 1rem;
  padding: 12px 20px; border-radius: 0 0 12px 12px; text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* Âncoras não ficam escondidas atrás do header fixo */
#inicio, #consulta, #componentes, #fluxo, #links, #faq, #doenca, #chainStep2, #chainStep3, #chainStep4 {
  scroll-margin-top: calc(var(--header-height, 128px) + 16px);
}

/* Títulos longos de medicamentos quebram sem vazar */
#chainResultCard h3, .result-head h3 { word-break: break-word; overflow-wrap: anywhere; }

/* Inputs com 16px no mobile: evita o zoom automático do iOS */
@media (max-width: 768px) {
  .search-input, .hero .search-input { font-size: 1rem; }
  .navbar-nav .nav-link { padding: 0.8rem 1rem; }
  .hint-chip { padding: 10px 18px; }
  .dispensing-unit-head { display: block; }
  .unit-cnes { display: inline-flex; margin-top: 7px; }
}

/* Respeita usuários com sensibilidade a movimento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .hero::before { animation: none !important; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Seleção de texto na cor da marca */
::selection { background: rgba(16, 185, 129, 0.3); }

/* Botões outline-info: ciano do Bootstrap é ilegível (1,9:1) → ciano-700 (4,9:1) */
.btn-outline-info {
  --bs-btn-color: #0e7490;
  --bs-btn-border-color: #0e7490;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #0e7490;
  --bs-btn-hover-border-color: #0e7490;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #155e75;
  --bs-btn-active-border-color: #155e75;
}

/* ============ Leitura e controles confortáveis em qualquer tela ============ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, button, input, select, textarea { font-family: 'Inter', sans-serif; }
p, li, a, summary, .chosen-summary, .result-head { overflow-wrap: anywhere; }
p { max-width: 72ch; }
small, .small { font-size: 1rem; line-height: 1.6; }
.btn, .btn-sm, .form-control, .form-select { font-size: 1rem; line-height: 1.5; }
button, .btn, .hint-chip, .comp-link, .fd-links a,
.unit-contact a, .unit-contact span, .brand-more,
.diagnosis-codes summary, .method-details > summary, .tech-details summary {
  min-height: 44px;
}
.btn { white-space: normal; }
.comp-link, .fd-links a, .brand-more {
  display: inline-flex; align-items: center; padding-top: 8px; padding-bottom: 8px;
}
.navbar-brand { white-space: normal; margin-right: 8px; max-width: calc(100% - 64px); }
.logo-container, .logo-text { min-width: 0; }
.logo-mark { flex: 0 0 auto; }
.logo-text span { color: var(--primary-color); }
.navbar-toggler { min-width: 48px; min-height: 48px; }
.navbar-nav .nav-link { font-size: 1rem; }
.hero .lead { font-size: 1.25rem; }
.hero-badge, .hero-hints { font-size: 1rem; line-height: 1.5; }
.hero-hints { color: #fff; }
.hero .search-input, .search-input { font-size: 1.125rem; line-height: 1.5; min-height: 60px; }
.hero .search-input { padding-right: 52px; }
.hero .btn-clear { right: 8px; }
.search-input:disabled { opacity: 1; color: var(--muted-color); background: var(--background-color); }
.search-wrap .btn-search:disabled { opacity: 0.65; }
.suggestions { max-height: min(420px, 60vh); overscroll-behavior: contain; }
.sug-item { align-items: flex-start; min-height: 64px; }
.sug-item > div, .sug-item > span:not(.sug-ico) { min-width: 0; }
.sug-item .sug-main { font-size: 1.125rem; line-height: 1.5; overflow-wrap: anywhere; }
.sug-item .sug-sub, .sug-empty { font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.sug-header, .comp-tag, .eyebrow, .unit-type, .territory-item span,
.stage-heading small, .channel-heading small, .info-item b {
  text-transform: none; letter-spacing: 0; line-height: 1.5;
}
.section-subtitle, .disclaimer, .info-item, .docs-list li, .alert-rules, .alert-warn,
.status-callout, .component-owner, .chosen-summary, .component-card p,
.component-card ul li, .step-card li, .fd-steps li, .journey-stage > p,
.request-channel > p, .request-channel > div > p, .unit-address, .unit-hours,
.stage-action, .route-status, .faq-accordion .accordion-body, .modal-body {
  font-size: 1.125rem; line-height: 1.6;
}
.chain-title, .component-card h3, .step-card h3, .stage-heading h5,
.channel-heading h4, .channel-heading h6, .dispensing-unit h5, .dispensing-unit h6,
.journey-stage .dispensing-unit h5, .journey-stage .dispensing-unit h6 {
  font-size: 1.25rem; line-height: 1.4;
}
.result-head h3 { font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.35; }
.result-head h4, .access-title h4 { font-size: 1.35rem; line-height: 1.4; }
.result-head > div, .stage-heading > div, .channel-heading > div,
.dispensing-unit-head > div, .docs-list li > div, .docs-list li > span { min-width: 0; }
.info-item small, .result-head .result-kind, .unit-source,
.source-freshness, .live-note, .privacy-inline, .unit-contact a, .unit-contact span {
  font-size: 1rem; line-height: 1.6;
}
.badge-comp, .badge-ceaf, .brand-chip, .disease-chip, .cid-chip, .verified-pill {
  max-width: 100%; font-size: 1rem; line-height: 1.5; white-space: normal;
}
.badge-comp::before { flex: 0 0 8px; }
.badge-ceaf { vertical-align: baseline; }
.disease-chip.clickable { min-height: 44px; padding-top: 9px; padding-bottom: 9px; }
.apres-option { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; }
.apres-option > span { min-width: 0; }
.apres-main { font-size: 1.125rem; line-height: 1.5; }
.apres-sub { font-size: 1rem; line-height: 1.6; }
.apres-side { max-width: 230px; }
.unit-contact a, .unit-contact span { max-width: 100%; overflow-wrap: anywhere; }
.unit-contact i, .docs-list i { flex: 0 0 auto; }
.meds-table { font-size: 1rem; line-height: 1.6; }
.meds-table th { font-size: 1rem; letter-spacing: 0; text-transform: none; }
.faq-accordion .accordion-button { font-size: 1.125rem; line-height: 1.5; min-height: 64px; }
.faq-accordion .accordion-button::after { flex: 0 0 26px; margin-left: 16px; }
.faq-accordion .accordion-button:focus-visible { box-shadow: inset 0 0 0 3px var(--primary-color); }
.link-tile b { font-size: 1.125rem; line-height: 1.5; }
.link-tile small { display: block; font-size: 1rem; line-height: 1.6; }
.link-tile > div { min-width: 0; }
.modal-content { background: var(--card-bg); color: var(--text-color); }
.modal-header .btn-close { min-width: 44px; min-height: 44px; padding: 0; margin: 0; flex: 0 0 auto; }
body.dark-mode .modal-header .btn-close { filter: invert(1); }
body.dark-mode .skip-link { color: #fff; background: #065f46; }
body.dark-mode .comp-tag.cbaf { color: #67e8f9; }
body.dark-mode .comp-tag.cesaf { color: #fcd34d; }
body.dark-mode .comp-tag.ceaf, body.dark-mode .unit-type { color: #c4b5fd; }

/* Barras de conteúdo: os títulos ficam visíveis mesmo com o conteúdo recolhido. */
.disclosure-list { display: flex; flex-direction: column; gap: 16px; max-width: 980px; margin-left: auto; margin-right: auto; }
.content-disclosure {
  --disclosure-color: #047857;
  min-width: 0; border: 1px solid rgba(6, 78, 59, 0.18); border-left: 5px solid var(--disclosure-color);
  border-radius: 18px; background: var(--card-bg); color: var(--text-color); box-shadow: var(--shadow);
}
.content-disclosure.cbaf { --disclosure-color: var(--cbaf); }
#chainResult > .content-disclosure { margin-top: 16px; }
.content-disclosure.cesaf { --disclosure-color: var(--cesaf); }
.content-disclosure.ceaf { --disclosure-color: var(--ceaf); }
.content-disclosure.opening-disclosure { --disclosure-color: #2563eb; }
.content-disclosure.documents-disclosure { --disclosure-color: var(--ceaf); }
.content-disclosure.withdrawal-disclosure { --disclosure-color: #047857; }
.content-disclosure > summary {
  display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 20px 24px;
  cursor: pointer; list-style: none; border-radius: 14px; color: var(--text-color);
}
.content-disclosure > summary::-webkit-details-marker { display: none; }
.content-disclosure > summary::marker { content: ''; }
.content-disclosure > summary > span:not(.disclosure-icon) { min-width: 0; flex: 1; }
.content-disclosure > summary::after {
  content: ''; width: 10px; height: 10px; flex: 0 0 10px; margin: 0 3px 5px 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform var(--transition-speed);
}
.content-disclosure[open] > summary::after { transform: rotate(225deg); margin-top: 8px; }
.content-disclosure > summary:hover { background: rgba(16, 185, 129, 0.06); }
.content-disclosure > summary:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 3px; }
.disclosure-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 13px; background: var(--disclosure-color); color: #fff; font-size: 1.25rem; font-weight: 800;
}
.disclosure-title { display: block; font-size: 1.25rem; font-weight: 800; line-height: 1.4; }
.disclosure-subtitle { display: block; margin-top: 5px; color: var(--muted-color); font-size: 1rem; font-weight: 500; line-height: 1.5; }
.disclosure-body { min-width: 0; padding: 4px 24px 24px; font-size: 1.125rem; line-height: 1.6; }
.disclosure-body > :last-child { margin-bottom: 0 !important; }
.disclosure-body > .component-card, .disclosure-body > .step-card { box-shadow: none; padding: 0; border-radius: 0; }
.disclosure-body > .component-card:hover, .disclosure-body > .step-card:hover { transform: none; }
.disclosure-body > .component-card::after { display: none; }
.content-disclosure[open] > summary { margin-bottom: 8px; }
.component-disclosure .disclosure-body > ul { list-style: none; padding: 0; margin: 16px 0; }
.component-disclosure .disclosure-body > ul > li { display: flex; gap: 12px; margin-bottom: 14px; }
.component-disclosure .disclosure-body > ul > li > i { flex: 0 0 20px; margin-top: 5px; color: var(--primary-color); }
.component-disclosure .disclosure-body > ul > li > div { min-width: 0; max-width: 72ch; }
.flow-disclosure .disclosure-body > ul { padding-left: 24px; }
.flow-disclosure .disclosure-body > ul > li { margin-bottom: 12px; max-width: 72ch; }


@media (max-width: 991.98px) {
  #navbarNav { max-height: calc(100dvh - 110px); overflow-y: auto; }
  .navbar-nav { align-items: stretch !important; padding: 12px 0; }
  .navbar-nav .nav-link { padding: 12px 16px !important; }
  .dark-mode-toggle { width: 100%; text-align: left; }
}
@media (max-width: 768px) {
  .apres-option { grid-template-columns: 22px minmax(0, 1fr); gap: 10px; }
  .apres-side { grid-column: 2; max-width: 100%; }
  .content-disclosure > summary { padding: 18px; }
  .disclosure-body { padding: 4px 18px 20px; }
  .install-btn { font-size: 1rem; min-height: 44px; }
  .hero .search-input, .search-input { font-size: 1.125rem; }
}
@media (max-width: 575.98px) {
  .content-section { padding: 32px 12px 16px; }
  .hero { min-height: auto; padding: 50px 16px 48px; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.75rem); line-height: 1.2; letter-spacing: -0.6px; }
  .hero .lead { font-size: 1.125rem; }
  .hero-badge { padding: 9px 14px; }
  .hero .search-input { padding-left: 42px; padding-right: 52px; }
  .hero .search-icon { left: 15px; }
  .chain { gap: 24px; }
  .chain-step { display: flex; flex-direction: column; gap: 10px; }
  .chain-marker { width: 40px; height: 40px; min-width: 40px; font-size: 1.125rem; }
  .chain-step::before { display: none; }
  .chain-card { width: 100%; }
  .form-section, .result-card { padding: 16px; }
  .chain-title { margin-bottom: 10px; }
  .result-title { margin-bottom: 16px; }
  .sug-item { padding: 14px 12px; gap: 9px; }
  .sug-item .sug-ico { width: 30px; height: 30px; min-width: 30px; }
  .sug-header { padding-left: 14px; padding-right: 14px; }
  .apres-option { padding: 14px 12px; }
  .apres-option:hover { transform: none; }
  .chosen-summary, .municipio-picked { padding: 12px; }
  .municipio-picked > span { flex-basis: 100%; }
  .municipio-change-btn { margin-left: 0; }
  .result-head { gap: 10px; }
  .result-head > .ms-auto { margin-left: 0 !important; text-align: left !important; max-width: 100%; }
  .result-actions .btn, .stage-action .btn { width: 100%; padding: 11px 16px; }
  .disclaimer { padding: 16px; }
  .content-disclosure > summary { gap: 10px; padding: 16px 12px; align-items: flex-start; }
  .disclosure-icon { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; font-size: 1.125rem; }
  .disclosure-title { font-size: 1.125rem; line-height: 1.45; }
  .content-disclosure > summary::after { margin-top: 10px; margin-left: 2px; }
  .content-disclosure[open] > summary::after { margin-top: 16px; }
  .disclosure-body { padding: 0 12px 18px; }
  .request-channel, .journey-stage { padding: 12px; }
  .dispensing-unit, .journey-stage .dispensing-unit { padding: 12px; }
  .docs-list li { padding: 12px 10px; gap: 9px; }
  .faq-accordion .accordion-button { padding: 18px 16px; }
  .faq-accordion .accordion-body { padding: 0 16px 20px; }
  .link-tile { padding: 16px; gap: 12px; }
}
@media print {
  body { color: #111 !important; font-size: 12pt; line-height: 1.5; }
  .chain-step { display: block; }
  .chain-marker, .chain-step::before { display: none !important; }
  .content-disclosure { box-shadow: none; border: 1px solid #aaa; margin: 12px 0; }
  .content-disclosure > summary { padding: 12px; min-height: 0; }
  .content-disclosure > summary::after { display: none; }
  .disclosure-body { padding: 0 12px 12px; }
  .disclosure-icon { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  #chainResult .collapse { display: block !important; height: auto !important; }
  .disclosure-title, .disclosure-subtitle { color: #111 !important; }
  .request-channel-grid.has-digital { grid-template-columns: 1fr; }
  .disclosure-body > p, .docs-list li, .dispensing-unit { break-inside: avoid; }
}

/* Contraste de controles e links em ambos os temas. */
.btn-outline-primary {
  --bs-btn-color: #0758c0; --bs-btn-border-color: #0758c0;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #0758c0; --bs-btn-hover-border-color: #0758c0;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #06499f; --bs-btn-active-border-color: #06499f;
}
.btn-outline-secondary {
  --bs-btn-color: #545e68; --bs-btn-border-color: #545e68;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #545e68; --bs-btn-hover-border-color: #545e68;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #424b54; --bs-btn-active-border-color: #424b54;
}
.btn-link { color: #0758c0; }
body.dark-mode .btn-outline-primary {
  --bs-btn-color: #93c5fd; --bs-btn-border-color: #93c5fd;
  --bs-btn-hover-color: #121212; --bs-btn-hover-bg: #93c5fd; --bs-btn-hover-border-color: #93c5fd;
  --bs-btn-active-color: #121212; --bs-btn-active-bg: #bfdbfe; --bs-btn-active-border-color: #bfdbfe;
}
body.dark-mode .btn-outline-secondary {
  --bs-btn-color: #b9c3ce; --bs-btn-border-color: #b9c3ce;
  --bs-btn-hover-color: #121212; --bs-btn-hover-bg: #b9c3ce; --bs-btn-hover-border-color: #b9c3ce;
  --bs-btn-active-color: #121212; --bs-btn-active-bg: #dbe3ec; --bs-btn-active-border-color: #dbe3ec;
}
body.dark-mode .btn-outline-info {
  --bs-btn-color: #67e8f9; --bs-btn-border-color: #67e8f9;
  --bs-btn-hover-color: #121212; --bs-btn-hover-bg: #67e8f9; --bs-btn-hover-border-color: #67e8f9;
  --bs-btn-active-color: #121212; --bs-btn-active-bg: #a5f3fc; --bs-btn-active-border-color: #a5f3fc;
}
body.dark-mode .btn-link { color: #93c5fd; }
body.dark-mode a.btn-outline-primary,
body.dark-mode a.btn-outline-secondary,
body.dark-mode a.btn-outline-info { color: var(--bs-btn-color); }
body.dark-mode a.btn-outline-primary:hover,
body.dark-mode a.btn-outline-secondary:hover,
body.dark-mode a.btn-outline-info:hover { color: var(--bs-btn-hover-color); }
.alert-info a, body.dark-mode .alert-info a { color: #075568; text-decoration: underline; }

/* A impressão usa o mesmo resumo do PDF, sem escolhas descartadas. */
#printConsultation { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body.has-print-consultation { margin: 0; padding: 0; background: #fff !important; }
  body.has-print-consultation > :not(#printConsultation) { display: none !important; }
  #printConsultation {
    display: block !important; margin: 0; padding: 0; color: #1e293b;
    font-family: Arial, sans-serif; font-size: 12pt; line-height: 1.42;
  }
  #printConsultation, #printConsultation * {
    animation: none !important; transition: none !important; opacity: 1 !important;
    outline: 0 !important; box-shadow: none !important;
  }
  #printConsultation h1 { color: #047857; font-size: 23pt; margin: 0 0 2pt; }
  #printConsultation h2 { color: #1e293b; font-size: 17pt; margin: 12pt 0 6pt; }
  #printConsultation h3 { color: #1e293b; font-size: 14pt; margin: 10pt 0 5pt; }
  #printConsultation h4 { color: #1e293b; font-size: 12pt; margin: 9pt 0 5pt; }
  #printConsultation h1, #printConsultation h2, #printConsultation h3, #printConsultation h4 { break-after: avoid; }
  #printConsultation p { max-width: none; margin: 0 0 8pt; orphans: 3; widows: 3; }
  #printConsultation .print-subtitle { margin-bottom: 14pt; }
  #printConsultation .print-municipality { font-weight: bold; margin-bottom: 12pt; }
  #printConsultation .print-caption { color: #4b5563; font-size: 11pt; }
  #printConsultation .print-section {
    color: #047857; border-left: 3pt solid #047857; background: #e8f6ef;
    padding: 6pt 8pt; font-size: 15pt; print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  #printConsultation a, body.dark-mode #printConsultation a { color: #047857 !important; text-decoration: underline; }
  #printConsultation .print-emphasis { font-weight: bold; }
  #printConsultation ul { padding-left: 16pt; margin: 0 0 10pt; }
  #printConsultation li { margin: 0 0 6pt; break-inside: avoid; }
  #printConsultation table { width: 100%; border-collapse: collapse; margin: 8pt 0; }
  #printConsultation th, #printConsultation td { padding: 6pt; border: 0.5pt solid #b8ccc4; text-align: left; vertical-align: top; }
  #printConsultation tr { break-inside: avoid; }
  #printConsultation .print-notice { font-weight: bold; font-size: 11pt; margin-top: 12pt; break-after: avoid; }
  #printConsultation .print-return { font-size: 10.5pt; overflow-wrap: anywhere; break-inside: avoid; }
}
