:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #141a2b;
  --muted: #5b6478;
  --line: #e3e6ee;
  --brand: #17306b;
  --brand-2: #2a56c6;
  --lula: #c62828;
  --lula-soft: #fdecec;
  --flavio: #1d4fb8;
  --flavio-soft: #e8effc;
  --ok: #138a4c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 26, 43, .06), 0 6px 20px rgba(20, 26, 43, .06);
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-2); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); letter-spacing: -.01em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.container { width: min(var(--max), 100% - 32px); margin-inline: auto; }

/* Header */
.site-header {
  background: var(--brand);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.logo { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #ffd34d, #ffb000); color: var(--brand); font-weight: 900;
}
.nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: #dfe6ff; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .95rem;
}
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; }
.nav a.live { background: #e53935; color: #fff; }
.nav a.live::before { content: "● "; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* Hero */
.hero { background: linear-gradient(180deg, var(--brand) 0%, #22408a 100%); color: #fff; padding: 48px 0 64px; }
.hero p.lead { font-size: 1.15rem; color: #dbe3ff; max-width: 720px; }
.badge {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.15); color: #fff; margin-bottom: 14px;
}
.countdown { display: flex; gap: 12px; margin: 24px 0; flex-wrap: wrap; }
.countdown div {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 12px;
  padding: 12px 16px; min-width: 84px; text-align: center;
}
.countdown strong { display: block; font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.countdown span { font-size: .8rem; color: #c9d4ff; }

.btn {
  display: inline-block; padding: 12px 20px; border-radius: 10px; font-weight: 700; text-decoration: none;
  background: #ffd34d; color: var(--brand); border: 0; cursor: pointer; font-size: 1rem;
}
.btn.secondary { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.5); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Layout */
main { padding: 32px 0 48px; }
.section { margin: 40px 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* Candidate cards */
.cand-card { border-top: 6px solid var(--c); }
.cand-card.lula { --c: var(--lula); --soft: var(--lula-soft); }
.cand-card.flavio { --c: var(--flavio); --soft: var(--flavio-soft); }
.cand-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.cand-photo {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--soft);
  border: 3px solid var(--c); flex-shrink: 0;
}
.cand-num {
  font-weight: 900; font-size: 1.6rem; color: var(--c); background: var(--soft);
  border-radius: 10px; padding: 2px 12px; display: inline-block;
}
.cand-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0 0; font-size: .95rem; }
.cand-card dt { color: var(--muted); }
.cand-card dd { margin: 0; font-weight: 600; }

/* Propostas */
.theme-nav {
  display: flex; gap: 8px; flex-wrap: wrap; position: sticky; top: 64px; z-index: 10;
  background: var(--bg); padding: 12px 0; border-bottom: 1px solid var(--line);
}
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none;
  padding: 6px 12px; border-radius: 999px; font-size: .88rem; font-weight: 600; cursor: pointer;
}
.chip:hover, .chip.active { border-color: var(--brand-2); color: var(--brand-2); }
.view-toggle { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; align-items: center; }

.theme { margin: 36px 0; scroll-margin-top: 140px; }
.theme h2 { display: flex; align-items: center; gap: 10px; }
.theme h2 .ico { font-size: 1.4rem; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare .col { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; border-top: 5px solid var(--c); }
.compare .col.lula { --c: var(--lula); }
.compare .col.flavio { --c: var(--flavio); }
.compare .col h3 { color: var(--c); }
.compare ul { margin: 0; padding-left: 1.1em; }
.compare li { margin-bottom: .45em; }
body.only-lula .col.flavio, body.only-flavio .col.lula { display: none; }
body.only-lula .compare, body.only-flavio .compare { grid-template-columns: 1fr; }

/* Notice */
.notice {
  background: #fff8e1; border: 1px solid #ffe08a; border-radius: 12px; padding: 14px 16px; font-size: .93rem;
}
.notice.info { background: #eef4ff; border-color: #c9d9ff; }

/* Ads */
.ad-wrap { margin: 28px auto; text-align: center; min-height: 100px; }
.ad-wrap::before {
  content: "Publicidade"; display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  color: #9aa2b4; margin-bottom: 4px;
}

/* Apuração */
.status-bar { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.progress { height: 12px; background: #e7eaf2; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ok); transition: width .6s ease; }
.tabs { display: inline-flex; background: #e7eaf2; border-radius: 10px; padding: 4px; gap: 4px; }
.tabs button {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--muted);
}
.tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

.result-list { display: grid; gap: 14px; }
.result {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; border-left: 6px solid var(--c, #8a93a8);
}
.result img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #eef0f5; }
.result .name { font-weight: 800; font-size: 1.1rem; }
.result .meta { color: var(--muted); font-size: .88rem; }
.result .pct { font-size: 1.9rem; font-weight: 900; font-variant-numeric: tabular-nums; text-align: right; color: var(--c, var(--ink)); }
.result .votes { font-size: .85rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.result .bar { grid-column: 1 / -1; height: 10px; background: #eef0f5; border-radius: 999px; overflow: hidden; }
.result .bar span { display: block; height: 100%; background: var(--c, #8a93a8); transition: width .6s ease; }
.eleito {
  display: inline-block; background: var(--ok); color: #fff; font-size: .72rem; font-weight: 800;
  padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle; text-transform: uppercase;
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #fff; border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .82rem; color: var(--muted); }

.uf-map {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 460px; margin: 0 auto;
}
.uf-tile {
  aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  color: #fff; background: #c3c9d6; cursor: default; position: relative; line-height: 1.1; text-align: center;
}
.uf-tile small { display: block; font-weight: 600; font-size: .65rem; opacity: .9; }
.uf-legend { display: flex; gap: 16px; justify-content: center; margin-top: 12px; font-size: .88rem; flex-wrap: wrap; }
.uf-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

table.uf-table { width: 100%; border-collapse: collapse; font-size: .93rem; background: #fff; }
.uf-table th, .uf-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.uf-table th:first-child, .uf-table td:first-child { text-align: left; }
.uf-table th { background: #f0f2f8; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table-scroll { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.lead-l { color: var(--lula); font-weight: 800; }
.lead-f { color: var(--flavio); font-weight: 800; }

/* Prose pages */
.prose { max-width: 780px; }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

/* FAQ */
details { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 10px; }
summary { font-weight: 700; cursor: pointer; }
details p { margin: 10px 0 0; }

/* Footer */
.site-footer { background: #0f1b3d; color: #b8c2e0; padding: 36px 0; font-size: .92rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }

/* Cookie banner */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100; max-width: 720px; margin: 0 auto;
  background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: 16px 18px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: .9rem;
}
.cookie p { margin: 0; flex: 1 1 320px; }

@media (max-width: 760px) {
  .compare { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav { width: 100%; margin-left: 0; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
  .nav a { white-space: nowrap; }
  .theme-nav { top: 108px; overflow-x: auto; flex-wrap: nowrap; }
  .chip { white-space: nowrap; }
  .result { grid-template-columns: 48px 1fr auto; }
  .result img { width: 48px; height: 48px; }
  .result .pct { font-size: 1.5rem; }
}

/* Quiz de afinidade */
.quiz-opcoes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quiz-op {
  border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 10px;
  font-weight: 700; font-size: 1rem; cursor: pointer; color: var(--ink);
}
.quiz-op:hover, .quiz-op.active { border-color: var(--brand-2); background: #eef4ff; }
.quiz-op.sim:hover, .quiz-op.sim.active { border-color: var(--ok); background: #e8f6ee; }
.quiz-op.nao:hover, .quiz-op.nao.active { border-color: #c0392b; background: #fdecec; }
#quiz-voltar:disabled { opacity: .4; cursor: default; }
@media (max-width: 520px) { .quiz-opcoes { grid-template-columns: 1fr; } }
.ig-card { display: grid; grid-template-columns: 1fr 220px; gap: 24px; align-items: center; margin-top: 20px; }
.ig-card img { width: 100%; border-radius: 12px; box-shadow: var(--shadow); }
.ig-btn { background: linear-gradient(45deg, #f58529, #dd2a7b 50%, #8134af); color: #fff; }
@media (max-width: 620px) { .ig-card { grid-template-columns: 1fr; } .ig-card img { max-width: 260px; margin: 0 auto; } }
.quiz-qtd { font-size: 3rem; line-height: 1; white-space: nowrap; }
.quiz-qtd small { font-size: 1.1rem; color: var(--muted); font-weight: 800; }

/* Espaços "Anuncie seu negócio aqui" (venda direta; conteúdo em assets/anuncios.js)
   .biz-layout        conteúdo estreito (780px): laterais a partir de 1200px
   .biz-layout.wide   conteúdo largo (1120px): laterais a partir de 1560px
   .biz-banner        banner horizontal, sempre visível
   .biz-banner.so-sem-lateral  só aparece quando as laterais estão escondidas */
.biz-rail { display: none; }
.biz-slot {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; background: linear-gradient(180deg, #fffdf3, #fff6d6); border: 2px dashed #f0c64a;
  border-radius: 14px; padding: 28px 14px 18px; color: var(--ink); overflow: hidden;
}
.biz-slot strong { font-size: 1.15rem; line-height: 1.25; }
.biz-slot p { font-size: .88rem; color: var(--muted); margin: 0; }
.biz-slot .btn { padding: 10px 14px; font-size: .9rem; white-space: nowrap; }
.biz-ico { font-size: 2.6rem; line-height: 1; }
.biz-label {
  position: absolute; top: 6px; left: 0; right: 0; font-size: .62rem; letter-spacing: .08em;
  text-transform: uppercase; color: #9aa2b4; text-align: center;
}
.biz-slot.biz-vendido { background: none; border: 0; padding: 18px 0 0; }
.biz-link, .biz-link picture { display: block; width: 100%; }
.biz-link img { width: 100%; height: auto; border-radius: 10px; }

.biz-rail .biz-slot { height: 600px; }
.biz-rail .biz-slot.biz-vendido { height: auto; }

.biz-banner { margin: 28px auto; max-width: 728px; }
.biz-banner .biz-slot { flex-direction: row; text-align: left; min-height: 96px; padding: 22px 18px 12px; gap: 14px; }
.biz-banner .biz-slot.biz-vendido { padding: 18px 0 0; min-height: 0; }
.biz-banner .biz-ico { font-size: 2.2rem; }
.biz-banner .biz-txt { flex: 1; }
.biz-banner strong { font-size: 1.05rem; display: block; }
.biz-banner p { font-size: .85rem; }

@media (min-width: 1200px) {
  .biz-layout:not(.wide) { display: grid; grid-template-columns: 1fr minmax(0, 780px) 1fr; column-gap: 40px; align-items: start; }
  .biz-layout:not(.wide) > main { width: 100%; }
  .biz-layout:not(.wide) > .biz-rail { display: block; }
  .biz-layout:not(.wide) .so-sem-lateral { display: none; }
}
@media (min-width: 1560px) {
  .biz-layout.wide { display: grid; grid-template-columns: 1fr minmax(0, 1120px) 1fr; column-gap: 40px; align-items: start; }
  .biz-layout.wide > main { width: 100%; }
  .biz-layout.wide > .biz-rail { display: block; }
  .biz-layout.wide .so-sem-lateral { display: none; }
}
.biz-layout > .biz-rail { position: sticky; top: 96px; margin-top: 32px; width: 160px; }
.biz-layout > .biz-rail:first-child { justify-self: end; }
.biz-layout > .biz-rail:last-child { justify-self: start; }

@media (max-width: 520px) {
  .biz-banner .biz-slot { padding: 22px 12px 12px; gap: 10px; }
  .biz-banner .biz-ico { font-size: 1.8rem; }
  .biz-banner strong { font-size: .98rem; }
  .biz-banner p { font-size: .8rem; }
}
