/* ═══════════════════════════════════════════════════════════════════
   wCnpjBrasil.com — Sistema de Design Corporativo Sólido & Colorido
   Aparência Profissional • Alto Contraste • Sem Cara de IA
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tokens de Cores e Tipografia ───────────────────────────────── */
:root {
  /* Fundo do site com tom ardósia suave (evita branco estourado) */
  --bg: #edf2f7;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-hover: #f1f5f9;

  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #cbd5e1;
  --border-subtle: #e2e8f0;

  /* Identidade Corporativa Navy / Royal */
  --header-bg: #0a2240;
  --header-border: #0284c7;

  --blue: #1d4ed8;
  --blue-hover: #1e40af;
  --blue-light: #eff6ff;
  --blue-border: #93c5fd;

  --green: #15803d;
  --green-bg: #dcfce7;
  --green-border: #86efac;

  --red: #b91c1c;
  --red-bg: #fee2e2;
  --red-border: #fca5a5;

  --amber: #b45309;
  --amber-bg: #fef3c7;
  --amber-border: #fcd34d;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;

  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.09), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }

h1, h2, h3, h4 { color: var(--text); line-height: 1.3; font-weight: 700; letter-spacing: -0.015em; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* ── Layout Container ───────────────────────────────────────────── */
.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}
.page-body {
  padding: 28px 20px 60px;
  max-width: 1140px;
  margin: 0 auto;
}

/* ── Header Principal (wCnpjBrasil.com) ─────────────────────────── */
.header {
  background-color: var(--header-bg);
  border-bottom: 3px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}
.header__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.header__brand:hover { text-decoration: none; }
.header__brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header__brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  display: block;
  flex-shrink: 0;
  background: #ffffff;
}
.header__brand-text {
  display: flex;
  flex-direction: column;
}
.header__brand-title {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.header__brand-title .highlight {
  color: #38bdf8;
}
.header__brand-title .tld {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
}
.header__brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.2;
  margin-top: 2px;
}

/* Barra de Busca no Header */
.header__search {
  flex: 1;
  max-width: 440px;
  display: flex;
  align-items: center;
}
.header__search-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #ffffff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.header__search input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  background: transparent;
  border: 0;
  color: #0f172a;
  font: inherit;
  font-size: 13.5px;
  outline: none;
}
.header__search input::placeholder {
  color: #64748b;
}
.header__search button {
  height: 38px;
  padding: 0 16px;
  background: #1d4ed8;
  border: 0;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 120ms ease;
}
.header__search button:hover {
  background: #1e40af;
}

/* Menu de Navegação */
.header__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.header__nav a {
  padding: 8px 12px;
  color: #e2e8f0;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 120ms ease;
  text-decoration: none;
}
.header__nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

/* ── Hero Principal com Profundidade e Cor ──────────────────────── */
.hero {
  background: linear-gradient(135deg, #0a2240 0%, #0f3460 60%, #164273 100%);
  color: #ffffff;
  padding: 48px 0 56px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.hero__inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.hero h1 {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.hero__desc {
  font-size: 15.5px;
  line-height: 1.6;
  color: #cbd5e1;
  max-width: 700px;
  margin: 0 auto 28px;
}

/* Caixa de Busca do Hero */
.hero__search-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid #38bdf8;
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  margin-bottom: 18px;
}
.hero__search-box input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border: 0;
  outline: none;
  font-size: 15px;
  color: #0f172a;
  background: transparent;
}
.hero__search-box input::placeholder {
  color: #64748b;
}
.hero__search-box button {
  height: 48px;
  padding: 0 28px;
  background: #1d4ed8;
  color: #ffffff;
  border: 0;
  border-radius: 4px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero__search-box button:hover {
  background: #1e40af;
}

/* Exemplos de Busca */
.hero__chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: #94a3b8;
}
.hero__chips span {
  color: #cbd5e1;
  font-weight: 600;
}
.hero__chip {
  color: #e2e8f0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero__chip:hover {
  color: #38bdf8;
}

/* ── Barra de Métricas com Destaque de Cores Sólidas ─────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: -24px auto 40px;
  position: relative;
  z-index: 10;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 120ms ease;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.metric-card:nth-child(1) { border-top: 3px solid #2563eb; }
.metric-card:nth-child(2) { border-top: 3px solid #059669; }
.metric-card:nth-child(3) { border-top: 3px solid #d97706; }
.metric-card:nth-child(4) { border-top: 3px solid #4f46e5; }

.metric-card__value {
  font-size: 23px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 3px;
}
.metric-card__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}
.metric-card__sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* ── Títulos de Seção com Barra de Destaque ──────────────────────── */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
  border-left: 4px solid #1d4ed8;
  padding-left: 12px;
}
.section-header__title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}
.section-header__desc {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

/* ── Painéis e Caixas de Conteúdo Sólidas ────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.panel__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Navegação Regional por Estados ──────────────────────────────── */
.regions-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 36px;
}
.region-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
.region-block__head {
  font-size: 13px;
  font-weight: 700;
  color: #1e3a5f;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.region-block__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.state-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition: all 120ms ease;
}
.state-chip:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0369a1;
  text-decoration: none;
}
.state-chip strong {
  display: inline-block;
  padding: 2px 6px;
  background: #0f294a;
  color: #ffffff;
  border-radius: 3px;
  font-size: 11px;
}

/* ── Caixa Expansível de Municípios (lista.html) ─────────────────── */
.munis-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.munis-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  user-select: none;
}
.munis-summary:hover {
  background: #f1f5f9;
}
.munis-toggle {
  font-size: 12px;
  color: var(--blue);
  font-weight: 600;
}
.munis-content {
  padding: 18px 20px;
  max-height: 380px;
  overflow-y: auto;
}
.munis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.muni-chip {
  display: block;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-2);
  text-decoration: none;
  transition: all 100ms ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.muni-chip:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
  text-decoration: none;
}

/* ── Cidades Populares ───────────────────────────────────────────── */
.cities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 36px;
}
.city-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 120ms ease;
  box-shadow: var(--shadow-sm);
}
.city-card:hover {
  border-color: #38bdf8;
  background: #f0f9ff;
  color: #0369a1;
  text-decoration: none;
}
.city-card span.uf-tag {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: #1e3a5f;
  padding: 2px 5px;
  border-radius: 3px;
}

/* ── Setores Econômicos (CNAE) ───────────────────────────────────── */
.cnae-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}
.cnae-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 120ms ease;
  box-shadow: var(--shadow-sm);
}
.cnae-card:hover {
  border-color: #38bdf8;
  background: #f0f9ff;
  text-decoration: none;
}
.cnae-card strong {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  color: #1d4ed8;
}
.cnae-card span {
  color: var(--text-2);
  line-height: 1.4;
}

/* ── Lista de Empresas e Cards de Busca ──────────────────────────── */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #1d4ed8;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 120ms ease;
  box-shadow: var(--shadow-sm);
}
.card-item:hover {
  border-color: #38bdf8;
  border-left-color: #0284c7;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.card-item__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-item__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.card-item__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.card-item__meta .mono {
  font-weight: 600;
  color: var(--text-2);
}

/* ── Badges de Situação Cadastral (Cores Vivas e Sólidas) ─────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge--ok {
  background-color: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}
.badge--bad {
  background-color: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}
.badge--warn {
  background-color: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.chip {
  display: inline-block;
  padding: 2px 7px;
  background-color: #e2e8f0;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 600;
}
.chip--muted {
  color: var(--muted);
}

/* ── Página de Detalhe da Empresa (empresa.html) ─────────────────── */
.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
}
.crumbs a {
  color: var(--muted);
}
.crumbs a:hover {
  color: var(--blue);
}
.crumbs .sep {
  color: var(--border);
}

.company-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid #1d4ed8;
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.company-header h1 {
  font-size: 23px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.company-header .company-cnpj {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, monospace;
  margin-left: 6px;
}
.company-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.company-header .fantasia {
  font-size: 13.5px;
  color: var(--text-2);
  margin-top: 8px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .header__search { display: none; }
}

/* Tabela Chave-Valor com Linhas Alternadas */
.kv {
  display: flex;
  flex-direction: column;
}
.kv__row {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13.5px;
}
.kv__row:nth-child(even) {
  background: #f8fafc;
}
.kv__row:last-child {
  border-bottom: 0;
}
.kv__key {
  color: var(--muted);
  font-weight: 500;
  flex-basis: 35%;
  flex-shrink: 0;
}
.kv__val {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  flex-basis: 65%;
  word-break: break-word;
}

/* CNAE e QSA Lista */
.cnae-list, .partner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cnae-item, .partner-item {
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 120ms ease;
}
.btn:hover { text-decoration: none; }
.btn--primary {
  background: #1d4ed8;
  color: #ffffff;
}
.btn--primary:hover {
  background: #1e40af;
}
.btn--outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn--outline:hover {
  border-color: #1d4ed8;
  color: #1d4ed8;
  background: #f0f9ff;
}
.btn--sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 0;
}
.faq summary {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.faq details p {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ── RODAPÉ CORPORATIVO SÓLIDO (wCnpjBrasil.com) ─────────────────── */
.site-footer {
  background-color: #071526;
  color: #94a3b8;
  border-top: 3px solid #1d4ed8;
  margin-top: auto;
  font-size: 13px;
}
.site-footer__main {
  padding: 48px 0 36px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 1fr;
  gap: 36px;
}
@media (max-width: 900px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}

.footer-col h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.footer-col ul a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  transition: color 100ms ease;
}
.footer-col ul a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.footer-brand-name {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
}
.footer-brand-desc {
  font-size: 12.5px;
  line-height: 1.6;
  color: #64748b;
  margin-bottom: 14px;
}

/* Barra Inferior com Aviso Legal */
.site-footer__bottom {
  background-color: #040d18;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 20px 0;
  font-size: 12px;
  color: #64748b;
}
.site-footer__disclaimer {
  line-height: 1.6;
  margin-bottom: 12px;
  color: #64748b;
}
.site-footer__copyright {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: #94a3b8;
  font-weight: 500;
}
