/*
 * design-system.css — folha única, não processada pelo Vite (servida tal qual, sem
 * hash), compartilhada pela home (index.html) e por toda página de perfil gerada em
 * dist/candidato/*.html.
 *
 * Unifica as duas paletas dos mockups originais (em_quem_votar_mockup_v7.html e
 * em_quem_votar_perfil_erika_hilton_v3.html), que divergiam entre si — ver
 * registro-de-alteracoes/2026-09-11-*.md. Seletores mantidos o mais parecido possível
 * com os mockups pra minimizar risco de regressão visual; só os nomes das variáveis
 * mudaram.
 */

:root {
  --brand-dark: #10233f; /* header/texto principal — do v7 */
  --brand-accent: #168b68; /* ações/links/estado ativo — do v7 (mais contraste que o verde escuro da Erika Hilton) */
  --brand-accent-dark: #0f6f53; /* hover / texto sobre --surface-accent */
  --surface-accent: #edf8f3; /* fundo de chip/tag/badge ativo */
  --bg: #f7f9fa; /* fundo de página */
  --surface: #fff; /* fundo de cartão */
  --muted: #647184; /* texto secundário */
  --border: #dbe2e8;
  --shadow: 0 8px 28px rgba(16, 35, 63, 0.07);

  /* Badges de "Autoria/Coautoria" (dado oficial) vs. "Resumo gerado por IA" — ver
   * render-profile-content.ts. */
  --tag-authored: #ece9f5;
  --tag-vote-yes: #e7f1eb;
  --tag-vote-no: #f3e9e7;
  --ai-badge-bg: #fff9e8;
  --ai-badge-border: #ead797;
  --ai-badge-text: #705c19;
  --official-badge-bg: var(--surface-accent);
  --official-badge-text: var(--brand-accent-dark);
}

* {
  box-sizing: border-box;
}
.hidden {
  display: none !important;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--brand-dark);
  background: var(--bg);
  line-height: 1.55;
}
button,
input,
select {
  font: inherit;
}
img {
  max-width: 100%;
}
a {
  color: var(--brand-accent);
}

/* ---------- header / footer (compartilhado) ---------- */
header.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 18px 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.logo {
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.8px;
}
.logo span {
  color: var(--brand-accent);
}
.logo small {
  display: block;
  font-size: 9px;
  letter-spacing: 1.8px;
  color: var(--muted);
  font-weight: 600;
  margin-top: -2px;
}
header.site-header nav a,
.back {
  text-decoration: none;
  color: #344258;
  font-size: 14px;
  font-weight: 650;
}
footer.site-footer {
  background: var(--brand-dark);
  color: #fff;
  margin-top: 45px;
  padding: 27px 4vw;
}
.footer-inner {
  width: min(1180px, 92vw);
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
  flex-wrap: wrap;
}

.container {
  width: min(1180px, 92vw);
  margin: 0 auto;
}

/* ---------- home / busca (index.html) ---------- */
.hero {
  padding: 48px 0 24px;
}
.hero h1 {
  font-size: 40px;
  line-height: 1.12;
  letter-spacing: -1.3px;
  margin: 0 0 15px;
  max-width: 850px;
}
.hero p {
  color: var(--muted);
  max-width: 900px;
  font-size: 16px;
  margin: 14px 0 0;
}
.hero p:first-child {
  margin-top: 0;
}
.hero strong {
  color: var(--brand-dark);
}
.search-wrap {
  margin: 24px 0 28px;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 17px 52px 17px 18px;
  border: 1px solid #cfd8df;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 15px;
  outline: none;
}
.search-wrap input:focus {
  border-color: #8bcbb6;
  box-shadow: 0 0 0 3px rgba(22, 139, 104, 0.08);
}
.search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 20px;
}
.section-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 25px;
}
.section-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
}
.role-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.role-btn {
  min-height: 78px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--brand-dark);
  cursor: pointer;
  padding: 12px;
  font-weight: 650;
  transition: 0.18s;
}
.role-btn:hover {
  border-color: #8bcbb6;
}
.role-btn.active {
  border: 1.5px solid var(--brand-accent);
  background: var(--surface-accent);
  color: var(--brand-accent);
}
.role-icon {
  display: block;
  font-size: 24px;
  margin-bottom: 4px;
}
.info {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 25px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 22px;
  margin-bottom: 22px;
}
.info h2 {
  font-size: 25px;
  margin: 0 0 8px;
}
.info p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.source-box {
  background: var(--surface-accent);
  border-radius: 10px;
  padding: 16px;
  font-size: 12px;
  color: #335b50;
}
.source-box strong {
  display: block;
  margin-bottom: 5px;
}
.filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.filter-group {
  border-top: 1px solid var(--border);
  padding-top: 13px;
}
.filter-group h3 {
  font-size: 13px;
  margin: 0 0 8px;
}
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  padding: 10px 11px;
  color: #344258;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 205px;
  overflow: auto;
}
.chip-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: #42516a;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}
.chip-btn.active {
  background: var(--brand-accent);
  color: #fff;
  border-color: var(--brand-accent);
}
.chip-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.help {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 23px 0 12px;
}
.count {
  font-weight: 750;
}
.count span {
  color: var(--brand-accent);
}
.alphabetical-note {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 14px;
}
.candidates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.candidate {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: 0.18s;
}
.candidate:hover {
  box-shadow: 0 5px 15px rgba(16, 35, 63, 0.09);
  transform: translateY(-1px);
  border-color: #b6d6ca;
}
.avatar-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  background: #e7edf0;
  flex: none;
  position: relative;
}
.avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #607084;
  background: #e7edf0;
}
.candidate strong {
  font-size: 14px;
  display: block;
}
.candidate small {
  color: var(--muted);
  font-size: 12px;
}
.empty {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 10px;
  grid-column: 1 / -1;
}
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.pagination button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 7px;
  padding: 8px 14px;
  cursor: pointer;
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.about-app h2 {
  font-size: 25px;
  margin: 0 0 7px;
}
.about-intro {
  color: var(--muted);
  max-width: 840px;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}
.about-step {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 17px;
}
.about-step > span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-accent);
  color: var(--brand-accent);
  font-weight: 800;
  font-size: 12px;
}
.about-step h3 {
  font-size: 14px;
  margin: 11px 0 6px;
}
.about-step p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.about-limit {
  margin-top: 10px !important;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.method-note {
  margin-top: 18px;
  background: #f5faf8;
  border-left: 3px solid var(--brand-accent);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: #425d55;
}

@media (max-width: 850px) {
  .hero h1 {
    font-size: 33px;
  }
  .role-grid {
    grid-template-columns: 1fr 1fr;
  }
  .info {
    grid-template-columns: 1fr;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .candidates {
    grid-template-columns: 1fr;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- perfil de candidato (candidato.html, renderizado no cliente) ---------- */
main.profile {
  max-width: 1040px;
  margin: 34px auto 70px;
  padding: 0 22px;
}
.profile-hero {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 26px;
  align-items: start;
}
.profile-photo {
  width: 150px;
  height: 180px;
  border-radius: 14px;
  object-fit: cover;
  background: #ddd;
}
.kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-accent-dark);
  font-weight: 800;
  margin-bottom: 3px;
}
.profile-hero h1 {
  font-size: 36px;
  line-height: 1.05;
  margin: 4px 0 8px;
}
.profile-meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 15px;
}
.party-box {
  background: var(--surface-accent);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 14px;
}
.party-box strong {
  display: block;
  margin-bottom: 3px;
}
.source-line {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}
.profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.profile-chip {
  background: var(--surface-accent);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 650;
  color: var(--brand-accent-dark);
}
.profile-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}
/* Estado de loading/erro/não-encontrado em candidato.html, antes/no lugar do fetch de
 * GET /candidates/:id/summary — reaproveita a mesma aparência de ".empty" (home). */
.profile-status {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  margin-top: 18px;
}
.profile-status button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 7px;
  padding: 8px 14px;
  cursor: pointer;
  margin-top: 12px;
  font: inherit;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}
.card.wide {
  grid-column: 1 / -1;
}
.card h2 {
  font-size: 19px;
  margin: 0 0 12px;
}
.card p {
  margin: 0 0 12px;
}
.card .lead {
  font-size: 16px;
  line-height: 1.7;
}
.note-box {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 14px;
  background: #f1f1ec;
  border-radius: 10px;
  margin-top: 15px;
}
.examples {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.example {
  padding: 13px 0;
  border-bottom: 1px solid #ecece6;
}
.example:last-child {
  border-bottom: 0;
}
.example strong {
  font-size: 14px;
}
.example p {
  font-size: 14px;
  color: #404a47;
  margin: 5px 0 0;
}
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 8px;
  margin-right: 6px;
  background: var(--surface-accent);
}
.tag.authored {
  background: var(--tag-authored);
}
.tag.vote-yes {
  background: var(--tag-vote-yes);
}
.tag.vote-no {
  background: var(--tag-vote-no);
}
details {
  margin-top: 14px;
}
summary {
  cursor: pointer;
  color: var(--brand-accent-dark);
  font-weight: 750;
  font-size: 14px;
}
.method-box {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding: 17px 20px;
  border: 1px solid #cfd6d1;
  background: #eef2ee;
  border-radius: 14px;
  font-size: 13px;
  color: #48534f;
}
.method-box strong {
  display: block;
  color: var(--brand-dark);
  font-size: 14px;
  margin-bottom: 6px;
}
.method-box p {
  margin: 5px 0;
}

/* Distingue "dado oficial" (TSE/Câmara/Senado — sem IA) de "resumo gerado por IA" no
 * topo de cada card — requisito do Reliable-Strategy doc (perfil deve diferenciar
 * visualmente as duas fontes). Ver render-profile-content.ts. */
.data-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}
.data-badge.ai {
  background: var(--ai-badge-bg);
  border: 1px solid var(--ai-badge-border);
  color: var(--ai-badge-text);
}
.data-badge.official {
  background: var(--official-badge-bg);
  color: var(--official-badge-text);
}

@media (max-width: 700px) {
  .profile-hero {
    grid-template-columns: 1fr;
  }
  .profile-photo {
    width: 120px;
    height: 145px;
  }
  .profile-grid-2 {
    grid-template-columns: 1fr;
  }
  .card.wide {
    grid-column: auto;
  }
  .profile-hero h1 {
    font-size: 30px;
  }
}
