@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

:root {
  --bg-page: #f7f8fa;
  --bg-card: #ffffff;
  --bg-alt: #eef0f4;
  --text-primary: #1a2332;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --accent: #1e4976;
  --accent-light: #2c5a8f;
  --accent-soft: rgba(30, 73, 118, 0.08);
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(26, 35, 50, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 35, 50, 0.08);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.25s ease;

  /* COGNIN — cores do logo (menu padrão do site) */
  --cognin-bg: #202020;
  --cognin-bg-soft: #282828;
  --cognin-steel: #707070;
  --cognin-steel-light: #b0b0b0;
  --cognin-steel-highlight: #e8e8e8;
  --cognin-text: #a8a8a8;
  --cognin-neon: #00d4ff;
  --cognin-neon-dim: #00b8e6;
  --cognin-neon-glow: 0 0 8px rgba(0, 212, 255, 0.6), 0 0 16px rgba(0, 212, 255, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Sans 3', -apple-system, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 17px;
}

h1, h2, h3, h4, .brand {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-weight: 700;
  color: var(--text-primary);
}

/* Layout */
.container {
  width: 92%;
  max-width: 1100px;
  margin: 0 auto;
}

section {
  padding: 4.5rem 0;
}

/* ========== MENU PADRÃO COGNIN (todo o site) ========== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: var(--cognin-bg);
  padding: 0 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 2px 0 rgba(0, 0, 0, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.25),
    0 8px 24px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}

nav .container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  gap: 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.nav-logo .cognin-logo {
  height: 38px;
  width: auto;
  display: block;
  object-fit: contain;
}

.hero-logo {
  display: block;
  height: 72px;
  width: auto;
  margin: 0 auto 1.25rem;
  object-fit: contain;
}

/* Botão marca: aço escovado com "COGNIN-IA" vazado */
nav .brand {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: #505060;
  background: linear-gradient(180deg, var(--cognin-steel-light) 0%, var(--cognin-steel) 50%, #5a5a6a 100%);
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 2px 4px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(0, 0, 0, 0.2);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15),
    0 -1px 2px rgba(0, 0, 0, 0.5),
    0 1px 1px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}
nav .brand:hover {
  color: #454555;
  background: linear-gradient(180deg, var(--cognin-steel-highlight) 0%, var(--cognin-steel-light) 50%, var(--cognin-steel) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 2px 6px rgba(0, 0, 0, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  color: var(--cognin-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s, text-shadow 0.2s;
  text-shadow: 0 0 6px rgba(0, 212, 255, 0.25);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--cognin-neon);
  text-shadow: var(--cognin-neon-glow);
}

.nav-links .btn-primary {
  color: var(--cognin-neon);
  background: transparent;
  border: 1px solid rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}
.nav-links .btn-primary:hover {
  color: var(--cognin-bg);
  background: var(--cognin-neon);
  border-color: var(--cognin-neon);
  text-shadow: none;
  box-shadow: var(--cognin-neon-glow);
}

/* Barra do contador logo abaixo do menu — estreita, largura total */
.countdown-bar {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 999;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.4rem 1rem;
  background: var(--cognin-bg-soft);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.countdown-bar .countdown-block {
  min-width: 3.5rem;
  padding: 0.35rem 0.6rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3) inset;
}
.countdown-bar .countdown-block .num {
  font-size: 1.1rem;
  color: var(--cognin-neon);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}
.countdown-bar .countdown-block .label {
  font-size: 0.6rem;
  color: var(--cognin-text);
  margin-top: 0.15rem;
}
.countdown-bar .countdown-caption {
  font-size: 0.75rem;
  color: var(--cognin-text);
  margin: 0 0 0 0.5rem;
  max-width: none;
}
.countdown-bar .countdown-block.countdown-done .num,
.countdown-bar .countdown-block.countdown-done .label {
  color: #2ee68a;
  text-shadow: 0 0 8px rgba(46, 230, 138, 0.5);
}
.countdown-bar #countdown-hero,
.countdown-bar #countdown-leg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-outline {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

.btn-outline:hover {
  background: var(--accent-soft);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

/* Contador regressivo */
.countdown-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
  min-height: 5rem;
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(30, 73, 118, 0.04) 0%, transparent 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.countdown-block {
  background: linear-gradient(145deg, #fff 0%, #f5f7fa 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.35rem;
  min-width: 5.5rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(26, 35, 50, 0.07), 0 1px 0 rgba(255,255,255,0.9) inset;
}
.countdown-block .num {
  display: block;
  font-family: 'Libre Baskerville', serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.countdown-block .label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-weight: 600;
}
.countdown-block.countdown-done .num { color: #0d8050; }
.countdown-block.countdown-done .label { color: #0d8050; }
.countdown-caption {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero (espaço para nav 48px + countdown-bar 44px + folga) */
.hero {
  padding-top: 9rem;
  padding-bottom: 5rem;
  text-align: center;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.hero-content h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.2;
  margin-bottom: 1.25rem;
  max-width: 20ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-content .lead {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2rem;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.card h3, .card h4 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Section titles */
.section-title {
  text-align: center;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-size: 1.05rem;
}

/* Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.comparison-table th,
.comparison-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  background: var(--bg-alt);
  color: var(--accent);
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comparison-table td.highlight,
.comparison-table th.highlight {
  background: var(--accent-soft);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

/* Simulator: impacto no caixa */
.sim-impacto-caixa {
  padding: 2.25rem 2rem;
  margin-bottom: 2rem;
}

.sim-impacto-caixa .sim-header {
  margin-bottom: 1.5rem;
}

.sim-impacto-caixa .sim-header .section-title {
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}

.sim-impacto-caixa .sim-header .section-subtitle {
  margin-bottom: 0;
}

.sim-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.75rem;
  padding: 1rem 1.1rem;
  background: var(--bg-page);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.sim-presets-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.sim-presets-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sim-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2.25rem;
  align-items: start;
}

@media (max-width: 768px) {
  .sim-impacto-caixa {
    padding: 1.5rem 1.25rem;
  }
  .sim-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .sim-presets {
    flex-direction: column;
    align-items: flex-start;
  }
}

.sim-inputs .input-group {
  margin-bottom: 1.25rem;
}

.sim-inputs .input-group:last-child {
  margin-bottom: 0;
}

.sim-inputs-row {
  display: flex;
  gap: 1rem;
}

.sim-inputs-row .input-group {
  flex: 1;
  margin-bottom: 1.25rem;
}

.sim-tributos-op {
  margin-top: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.input-group input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
  font-size: 0.95rem;
}

.result-row:last-of-type {
  margin-bottom: 0;
}

.result-row.final {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
  font-size: 1.05rem;
}

.result-row.final span:last-child,
.result-row.final strong:last-child {
  white-space: nowrap;
}

.sim-results.card h4 {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem;
}

.sim-results-block {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sim-cenarios {
  padding-top: 0.25rem;
}

.sim-cenarios-title {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.scenario-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .scenario-cards {
    grid-template-columns: 1fr;
  }
}

.scenario-card {
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.scenario-card.highlight {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.scenario-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.scenario-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
  flex-shrink: 0;
}

.scenario-card .result-row {
  margin-bottom: 0.6rem;
}

.scenario-card .float-note {
  margin-top: auto;
  padding-top: 1rem;
}

.float-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.sim-perda-float {
  margin-top: 0.25rem;
}

.sim-projecao {
  margin-top: 0.25rem;
}

/* Calculadora RTC: parâmetros em grupos */
.rtc-params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.rtc-param-group {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.rtc-param-group-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.rtc-param-group-title em {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85em;
}

.rtc-param-group-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.rtc-param-local .rtc-param-group-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
}

@media (max-width: 420px) {
  .rtc-param-local .rtc-param-group-inner {
    grid-template-columns: 1fr;
  }
}

.rtc-param-local .rtc-municipio-wrap {
  margin-bottom: 0;
  min-width: 0;
}

.rtc-param-local .rtc-uf-wrap {
  width: 4.5rem;
}

.rtc-param-aliquotas .input-group {
  min-width: 5.5rem;
  flex: 1;
}

.rtc-param-data .input-group {
  min-width: 10rem;
}

.rtc-itens-section {
  margin-bottom: 1rem;
}

.rtc-itens-section .rtc-param-group-title {
  margin-bottom: 0.5rem;
  border-bottom: none;
  padding-bottom: 0;
}

.rtc-itens-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rtc-itens-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Calculadora RTC: município (SP) + código IBGE */
.rtc-municipio-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rtc-municipio-code-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

.rtc-municipio-wrap .rtc-municipio-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.rtc-municipio-wrap .rtc-municipio-input {
  font-size: 0.95rem;
  max-width: 10rem;
}

.api-steps code {
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  background: var(--bg-alt);
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}

/* Texto da legislação formatado */
.leg-text-formatted { font-size: 0.95rem; line-height: 1.75; color: var(--text-primary); }
.leg-text-formatted .leg-book { font-weight: 700; font-size: 1.1rem; color: var(--accent); margin: 2rem 0 0.75rem; display: block; }
.leg-text-formatted .leg-title { font-weight: 700; font-size: 1.05rem; color: var(--text-primary); margin: 1.5rem 0 0.5rem; display: block; }
.leg-text-formatted .leg-chapter { font-weight: 700; color: var(--accent); margin: 1.25rem 0 0.5rem; display: block; }
.leg-text-formatted .leg-section { font-weight: 600; color: var(--text-secondary); margin: 1rem 0 0.4rem; display: block; }
.leg-text-formatted .leg-art { font-weight: 700; color: var(--accent); margin: 1.25rem 0 0.35rem; display: block; }
.leg-text-formatted .leg-para { font-weight: 600; color: var(--text-primary); margin: 0.5rem 0 0.25rem; margin-left: 1rem; display: block; font-size: 0.92em; }
.leg-text-formatted .leg-line { margin-bottom: 0.25rem; line-height: 1.55; }
.leg-text-formatted .leg-line:empty { margin-bottom: 0.25rem; }

/* Persona / Roles */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.persona-card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
}

.persona-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.persona-card ul {
  list-style: none;
  margin-top: 1rem;
}

.persona-card ul li {
  margin-bottom: 0.5rem;
  padding-left: 1.25rem;
  position: relative;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.persona-card ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* FAQ */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.faq-item {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.faq-item h4 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.faq-item p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Checklist */
.checklist-list {
  list-style: none;
  max-width: 640px;
  margin: 0 auto;
}

.checklist-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.checklist-list li span.icon {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* Footer */
footer {
  padding: 3rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

footer .brand {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Utilities */
/* Conteúdo visível por padrão; animação no scroll é opcional */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.bg-alt {
  background: var(--bg-alt);
}

.callout {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Chat Widget — visual estilo ChatGPT */
#chat-toggle,
.chat-toggle-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  border-radius: 2rem;
  padding: 0.85rem 1.35rem;
  font-size: 0.95rem;
  box-shadow: var(--shadow-md);
  z-index: 1000;
}

#chat-widget {
  position: fixed;
  bottom: 4.5rem;
  right: 1.5rem;
  width: 400px;
  height: 560px;
  max-height: calc(100vh - 6rem);
  display: flex;
  flex-direction: column;
  background: #f7f7f8;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  z-index: 1001;
  overflow: hidden;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#chat-widget.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

#chat-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #202123;
  background: #fff;
}

.chat-header-title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.chat-header-title span {
  font-size: 0.95rem;
}

#chat-header button {
  background: none;
  border: none;
  color: #6e6e80;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 0.25rem;
  border-radius: 4px;
}

#chat-header button:hover {
  color: #202123;
  background: rgba(0, 0, 0, 0.05);
}

#chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background: #f7f7f8;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Bolhas estilo ChatGPT: assistente à esquerda, usuário à direita (verde) */
.message {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.message.bot {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.message.user {
  background: #0da37f;
  color: #fff;
  border: none;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.message p a {
  color: inherit;
  text-decoration: underline;
}

.message.user p a {
  color: #fff;
}

#chat-input-area {
  padding: 0.75rem 1rem 1rem;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

#chat-input {
  flex: 1;
  background: #f7f7f8;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  padding: 0.65rem 1rem;
  color: #202123;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#chat-input:focus {
  border-color: #0da37f;
  box-shadow: 0 0 0 1px #0da37f;
}

#send-btn {
  background: #0da37f;
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#send-btn:hover {
  background: #0b8c6a;
}

/* Calculadora RTC */
.rtc-item-row input {
  width: 100%;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
}
.btn-remove-row {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  line-height: 1;
}
.btn-remove-row:hover {
  color: var(--accent);
}

/* Referência / tabelas robustas */
.ref-table {
  min-width: 480px;
}
.ref-table td.highlight,
.ref-table th.highlight {
  min-width: 200px;
}
/* Busca legislação (API) */
.busca-lei {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.busca-lei-input {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}
.busca-lei-result {
  width: 100%;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.busca-lei-msg { margin: 0 0 0.5rem; color: var(--text-secondary); }
.busca-lei-err { color: #c53030; }
.busca-lei-list { list-style: none; margin: 0; padding: 0; }
.busca-lei-list li { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.busca-lei-list li:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.busca-lei-list a { color: var(--accent); font-weight: 500; }
.busca-lei-list small { display: block; margin-top: 0.25rem; color: var(--text-secondary); font-size: 0.9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

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

/* Glossário */
.glossario-list {
  max-width: 720px;
  margin: 0 auto;
}
.glossario-list dt {
  font-weight: 600;
  color: var(--accent);
  margin-top: 1.25rem;
  font-size: 1.05rem;
}
.glossario-list dt:first-child {
  margin-top: 0;
}
.glossario-list dd {
  margin-left: 0;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  padding-left: 0.5rem;
  border-left: 3px solid var(--border);
}

/* FAQ expandido */
.faq-grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (max-width: 768px) {
  section {
    padding: 3rem 0;
  }

  .hero {
    padding-top: 8.5rem;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .comparison-table {
    font-size: 0.85rem;
  }

  #chat-widget {
    width: calc(100vw - 2rem);
    right: 1rem;
    left: 1rem;
  }
}
