/* BRASIL VOTA 2026 — estilos isolados do site institucional */
:root {
  --bv-navy: #082744;
  --bv-ink: #0f1f33;
  --bv-muted: #5a6b7d;
  --bv-line: #dbe3eb;
  --bv-bg: #f3f6f9;
  --bv-panel: #ffffff;
  --bv-soft: #eef3f7;
  --bv-gold: #c99636;
  --bv-blue: #1f63ad;
  --bv-ok: #15803d;
  --bv-err: #b91c1c;
  /* Cores dos candidatos do 2º turno (definidas pela AQUISEFAZ):
     c1 = menor número (13, Lula) em vermelho; c2 = maior número (22, Flávio Bolsonaro) em azul. */
  --bv-c1: #c62828;
  --bv-c2: #1d4ed8;
  --bv-c3: #8a97a6;
  --bv-radius: 12px;
  --bv-top: 64px;
  --bv-foot: 30px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bv-bg);
  color: var(--bv-ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--bv-blue); }
:focus-visible { outline: 3px solid var(--bv-gold); outline-offset: 2px; }
h2, h3, p { margin: 0; }

/* ── Cabeçalho ─────────────────────────────────────── */
.bv-top { background: var(--bv-navy); color: #fff; }
.bv-top__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 10px 16px;
}
.bv-marca { flex: 1 1 auto; min-width: 0; }
.bv-title { margin: 0; font-size: clamp(22px, 3vw, 30px); line-height: 1; font-weight: 900; letter-spacing: .01em; }
.bv-kicker { margin-top: 3px; font-size: 12px; color: rgba(255,255,255,.75); }

.bv-turnos { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.1); }
.bv-turno {
  min-height: 42px;
  padding: 4px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  line-height: 1.15;
}
.bv-turno small { display: block; font-weight: 600; font-size: 11px; opacity: .8; }
.bv-turno[aria-pressed="true"] { background: #fff; color: var(--bv-navy); }

.bv-assina {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  border-radius: 10px;
  background: #fff;
}
.bv-assina img { height: 30px; width: auto; }
.bv-assina p { font-size: 11px; line-height: 1.25; color: var(--bv-muted); }
.bv-assina span { display: block; font-weight: 800; color: var(--bv-ink); }
.bv-assina em { display: block; }

/* ── Painel ────────────────────────────────────────── */
.bv-dash { display: grid; gap: 12px; padding: 12px; }
.bv-col {
  min-width: 0;
  background: var(--bv-panel);
  border: 1px solid var(--bv-line);
  border-radius: var(--bv-radius);
  padding: 16px;
}
.bv-col--esq { display: grid; gap: 16px; align-content: start; }
.bv-bloco + .bv-bloco { border-top: 1px solid var(--bv-line); padding-top: 14px; }

/* Filtros */
.bv-filtros { display: grid; gap: 10px; }
.bv-field { display: grid; gap: 4px; margin: 0; min-width: 0; }
.bv-field span { font-size: 11px; font-weight: 800; color: var(--bv-muted); text-transform: uppercase; letter-spacing: .06em; }
.bv-field select, .bv-field input {
  width: 100%;
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid var(--bv-line);
  border-radius: 9px;
  background: #fff;
  color: var(--bv-ink);
  font: inherit;
}
.bv-field input:disabled { background: var(--bv-soft); }
.bv-busca__row { display: flex; gap: 6px; }
.bv-btn {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: var(--bv-navy);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.bv-btn:disabled { opacity: .45; cursor: default; }
.bv-btn--ghost { background: #fff; color: var(--bv-navy); border: 1px solid var(--bv-line); min-height: 36px; padding: 0 12px; font-size: 13px; }
.bv-crumbs { font-size: 13px; color: var(--bv-muted); }
.bv-crumbs a { font-weight: 700; }
.bv-crumbs span[aria-current] { font-weight: 800; color: var(--bv-ink); }

/* Controles do mapa */
.bv-mapa__lado h2 { font-size: 18px; color: var(--bv-navy); line-height: 1.2; }
.bv-mapa__sub { margin: 2px 0 10px; font-size: 13px; color: var(--bv-muted); }
.bv-modos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.bv-modo {
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid var(--bv-line);
  border-radius: 9px;
  background: #fff;
  color: var(--bv-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  line-height: 1.2;
}
.bv-modo[aria-pressed="true"] { border-color: var(--bv-navy); box-shadow: inset 0 0 0 1px var(--bv-navy); background: var(--bv-soft); }
.bv-legenda { margin-top: 12px; font-size: 12px; color: var(--bv-muted); display: grid; gap: 5px; }
.bv-legenda__linha { display: flex; align-items: center; gap: 8px; }
.bv-legenda__barra { height: 9px; flex: 1; border-radius: 999px; }
.bv-legenda__escala { display: flex; justify-content: space-between; }
.bv-legenda__sem { display: inline-block; width: 14px; height: 9px; border-radius: 3px; background: #dfe5eb; vertical-align: middle; margin-right: 4px; }
.bv-mapa__nota { margin-top: 10px; font-size: 12px; color: var(--bv-muted); }
.bv-mapa__nota:empty { display: none; }

.bv-sobre summary { font-weight: 800; cursor: pointer; font-size: 14px; }
.bv-sobre ul { margin: 8px 0 0; padding-left: 18px; color: var(--bv-muted); font-size: 12px; }
.bv-sobre li { margin-bottom: 4px; }

/* Mapa */
.bv-col--mapa { position: relative; display: flex; align-items: center; justify-content: center; padding: 8px; }
#bv-svg { display: block; width: 100%; height: auto; touch-action: manipulation; }
#bv-svg .m { stroke: #fff; stroke-width: .25; vector-effect: non-scaling-stroke; cursor: pointer; transition: opacity .2s; }
#bv-svg .m:hover, #bv-svg .m.sel { stroke: var(--bv-ink); stroke-width: 1.5; }
#bv-svg .m.fora, #bv-svg path.fora { opacity: .22; }
#bv-svg .bordas { fill: none; stroke: #fff; stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: none; }
#bv-svg .uf-sel { fill: none; stroke: var(--bv-ink); stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.bv-mapa__carregando { position: absolute; inset: 0; display: grid; place-items: center; color: var(--bv-muted); }
.bv-mapa__carregando[hidden] { display: none; }
.bv-mapa__voltar { position: absolute; top: 10px; left: 10px; z-index: 1; }
.bv-mapa__voltar[hidden] { display: none; }

.bv-tip {
  position: absolute;
  z-index: 2;
  min-width: 180px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bv-navy);
  color: #fff;
  font-size: 13px;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(8,39,68,.25);
}
.bv-tip strong { display: block; font-size: 14px; margin-bottom: 4px; }
.bv-tip span { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.bv-tip small { display: block; margin-top: 4px; opacity: .75; }

/* Resultado da localidade */
.bv-col--res { display: grid; gap: 12px; align-content: start; }
.bv-eyebrow { font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--bv-blue); }
.bv-local { margin-top: -8px; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.15; color: var(--bv-navy); }

.bv-alert:empty { display: none; }
.bv-alert {
  padding: 8px 12px;
  border-left: 4px solid var(--bv-blue);
  border-radius: 8px;
  background: #e8f0fa;
  font-size: 13px;
  font-weight: 600;
}
.bv-alert[data-tipo="aguardando"] { border-color: var(--bv-gold); background: #fdf6e7; }
.bv-alert[data-tipo="parcial"] { border-color: var(--bv-ok); background: #e9f7ee; }
.bv-alert[data-tipo="final"] { border-color: var(--bv-navy); background: #e9eef4; }
.bv-alert[data-tipo="erro"], .bv-alert[data-tipo="desatualizado"] { border-color: var(--bv-err); background: #fdecec; }

.bv-secoes__label { font-weight: 800; font-size: 14px; }
.bv-bar { height: 7px; margin: 5px 0 3px; border-radius: 999px; background: var(--bv-soft); overflow: hidden; }
.bv-bar span { display: block; height: 100%; background: var(--bv-navy); transition: width .5s ease; }
.bv-secoes small { color: var(--bv-muted); font-size: 12px; }

.bv-duel { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--bv-soft); position: relative; }
.bv-duel:empty { display: none; }
.bv-duel span { height: 100%; transition: width .5s ease; }
.bv-duel span:last-child { margin-left: auto; }
.bv-duel::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #fff; }

.bv-cands { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bv-cand {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--bv-line);
  border-left: 5px solid var(--cor, var(--bv-c3));
  border-radius: 10px;
}
.bv-cand img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; background: var(--bv-soft); grid-row: span 2; }
.bv-cand__nome { font-size: 16px; font-weight: 800; color: var(--bv-navy); line-height: 1.2; }
.bv-cand__meta { font-size: 12px; color: var(--bv-muted); }
.bv-cand__num { text-align: right; grid-row: span 2; }
.bv-cand__pct { display: block; font-size: 26px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.bv-cand__votos { display: block; font-size: 12px; color: var(--bv-muted); font-variant-numeric: tabular-nums; }

.bv-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  vertical-align: middle;
  background: var(--bv-soft);
  color: var(--bv-navy);
}
.bv-tag--eleito { background: var(--bv-navy); color: #fff; }

.bv-outros summary { cursor: pointer; font-size: 13px; font-weight: 800; color: var(--bv-muted); }
.bv-outros ol { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.bv-outros li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--bv-line); font-variant-numeric: tabular-nums; }
.bv-outros li span:last-child { color: var(--bv-muted); white-space: nowrap; }

.bv-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.bv-stats:empty { display: none; }
.bv-stats div { padding: 7px 10px; border-radius: 8px; background: var(--bv-soft); }
.bv-stats div:first-child { grid-column: 1 / -1; }
.bv-stats dt { font-size: 10px; font-weight: 800; color: var(--bv-muted); text-transform: uppercase; letter-spacing: .05em; }
.bv-stats dd { margin: 0; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.bv-stats dd small { font-weight: 600; color: var(--bv-muted); margin-left: 4px; }

.bv-updated { font-size: 11px; color: var(--bv-muted); }

/* Resultado geral do Brasil, sempre abaixo da seleção */
.bv-geral { border-top: 3px solid var(--bv-line); padding-top: 10px; display: grid; gap: 6px; }
.bv-geral[hidden] { display: none; }
.bv-geral h3 { font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--bv-muted); }
.bv-geral__cand { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.bv-geral__cor { width: 6px; height: 28px; border-radius: 3px; background: var(--cor); }
.bv-geral__nome { font-weight: 800; font-size: 14px; color: var(--bv-navy); line-height: 1.2; }
.bv-geral__nome small { display: block; font-weight: 600; font-size: 11px; color: var(--bv-muted); }
.bv-geral__pct { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; text-align: right; line-height: 1; }
.bv-geral__pct small { display: block; font-size: 11px; font-weight: 600; color: var(--bv-muted); }
.bv-geral__info { font-size: 11px; color: var(--bv-muted); }

.bv-skeleton { height: 64px; border-radius: 10px; background: linear-gradient(90deg, var(--bv-soft), #f8fafc, var(--bv-soft)); background-size: 200% 100%; animation: bv-shimmer 1.2s infinite; }
@keyframes bv-shimmer { to { background-position: -200% 0; } }

.bv-foot { background: var(--bv-navy); color: rgba(255,255,255,.8); font-size: 11px; padding: 8px 16px; }
.bv-foot strong { color: #fff; }
.bv-foot a { color: #f3d79b; }

/* ── Desktop: tudo numa tela, sem rolagem da página ── */
@media (min-width: 1100px) and (min-height: 620px) {
  body { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
  .bv-top__row { flex-wrap: nowrap; }
  .bv-dash {
    flex: 1;
    min-height: 0;
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(320px, 380px);
  }
  .bv-col { min-height: 0; overflow-y: auto; }
  .bv-col--mapa { overflow: hidden; }
  #bv-svg { height: 100%; width: 100%; }
  .bv-modos { grid-template-columns: 1fr; }
  .bv-foot { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* Telas baixas (notebooks): compacta para caber sem rolar */
@media (min-width: 1100px) and (max-height: 820px) {
  .bv-top__row { padding: 6px 14px; }
  .bv-title { font-size: 22px; }
  .bv-kicker { display: none; }
  .bv-turno { min-height: 36px; }
  .bv-dash { gap: 8px; padding: 8px; }
  .bv-col { padding: 12px; }
  .bv-col--esq, .bv-col--res { gap: 8px; }
  .bv-bloco + .bv-bloco { padding-top: 8px; }
  .bv-field select, .bv-field input, .bv-btn { min-height: 36px; }
  .bv-mapa__sub { margin-bottom: 6px; }
  .bv-modo { min-height: 34px; padding: 4px 10px; }
  .bv-legenda { margin-top: 8px; gap: 3px; }
  .bv-mapa__nota { font-size: 11px; margin-top: 6px; }
  .bv-local { font-size: 20px; margin-top: -4px; }
  .bv-alert { padding: 5px 10px; font-size: 12px; }
  .bv-cand { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 7px 10px; }
  .bv-cand img { width: 44px; height: 44px; }
  .bv-cand__nome { font-size: 14px; }
  .bv-cand__pct { font-size: 22px; }
  .bv-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .bv-stats div { padding: 4px 8px; }
  .bv-stats div:first-child { grid-column: auto; }
  .bv-stats dd { font-size: 13px; }
  .bv-stats dd small { display: block; margin-left: 0; }
  .bv-secoes small { display: none; }
  .bv-geral { padding-top: 6px; gap: 4px; }
  .bv-geral__cor { height: 22px; }
  .bv-geral__nome { font-size: 13px; }
  .bv-geral__pct { font-size: 17px; }
  .bv-geral__pct small, .bv-geral__info { display: none; }
}

@media (min-width: 1600px) and (min-height: 620px) {
  .bv-dash { grid-template-columns: 320px minmax(0, 1fr) 420px; }
}

/* ── Celular ───────────────────────────────────────── */
@media (max-width: 760px) {
  .bv-assina { width: 100%; }
  .bv-turnos { width: 100%; }
  .bv-turno { flex: 1; }
  .bv-dash { padding: 10px; gap: 10px; }
  .bv-col { padding: 12px; }
  /* Celular: filtros → resultado → mapa → controles do mapa → sobre os dados */
  .bv-col--esq { display: contents; }
  .bv-col--esq > .bv-bloco {
    background: var(--bv-panel);
    border: 1px solid var(--bv-line);
    border-radius: var(--bv-radius);
    padding: 12px;
  }
  .bv-bloco + .bv-bloco { border-top: 1px solid var(--bv-line); }
  .bv-filtros { order: 1; }
  .bv-col--res { order: 2; }
  .bv-col--mapa { order: 3; }
  .bv-mapa__lado { order: 4; }
  .bv-sobre { order: 5; }
  .bv-cand { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .bv-cand img { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
