:root{
  --primary:#6f2bd9;
  --primary-dark:#4b14a9;
  --primary-soft:#efe7ff;
  --primary-soft-2:#f8f4ff;
  --ink:#111318;
  --muted:#667085;
  --paper:#f6f4fb;
  --line:#e6e0f3;
  --green:#16794b;
  --green-bg:#eaf8f1;
  --yellow:#9a6700;
  --yellow-bg:#fff6d8;
  --danger:#b42318;
  --danger-bg:#fff0ef;
  --shadow:0 18px 55px rgba(16,24,40,.10);
  --shadow-soft:0 12px 36px rgba(16,24,40,.08);
  --radius:22px;
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--ink);
  background:var(--paper)
}
*{box-sizing:border-box}
[hidden]{display:none !important}
html{scroll-behavior:smooth}
body{margin:0;background:var(--paper);color:var(--ink)}
button,input,select{font:inherit}
img{max-width:100%;height:auto}
.container{width:min(1180px,calc(100% - 36px));margin:auto}

.site-header{position:sticky;top:0;z-index:20;background:rgba(255,255,255,.92);backdrop-filter:blur(12px);border-bottom:1px solid #ece7f7}
.header-inner{min-height:88px;display:flex;align-items:center;justify-content:space-between;gap:24px}
.brand img{display:block;width:min(390px,52vw);height:auto}
.project-by{display:flex;align-items:center;gap:12px;color:#777;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.08em}
.project-by img{width:180px;max-width:34vw;height:auto}

.hero{position:relative;overflow:hidden;background:
  radial-gradient(circle at 78% 26%,rgba(163,117,255,.45) 0,rgba(111,43,217,.18) 22%,rgba(111,43,217,0) 48%),
  linear-gradient(135deg,#2e0b63 0%,#4b14a9 38%,#6f2bd9 68%,#8f63ff 100%);
  color:#fff}
.hero::before{content:"";position:absolute;inset:0;background:
  linear-gradient(125deg,transparent 0 55%,rgba(255,255,255,.05) 55% 56%,transparent 56% 100%),
  radial-gradient(circle at 18% 18%,rgba(255,255,255,.10),transparent 30%);
  pointer-events:none}
.hero-grid{position:relative;z-index:1;min-height:380px;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(300px,.85fr);align-items:center;gap:42px;padding:54px 0 58px}
.eyebrow,.kicker,.section-kicker,.election-kind{font-size:11px;font-weight:900;letter-spacing:.14em;text-transform:uppercase}
.eyebrow{color:#efe4ff}
.hero-copy{max-width:720px}
.hero h1{font-size:clamp(38px,6vw,72px);line-height:.97;letter-spacing:-.045em;margin:13px 0 20px}
.hero h1 span{color:#e3d2ff}
.hero p{font-size:clamp(16px,2vw,20px);line-height:1.6;color:#f5efff;margin:0}
.hero-source{display:inline-flex;align-items:center;margin-top:24px;padding:10px 14px;border:1px solid rgba(255,255,255,.24);border-radius:999px;color:#fff;font-size:12px;font-weight:700;background:rgba(255,255,255,.10);box-shadow:0 12px 30px rgba(0,0,0,.12)}
.hero-visual{display:flex;justify-content:center;align-items:center}
.hero-visual-card{position:relative;display:grid;place-items:center;width:min(100%,470px);padding:22px;border-radius:28px;background:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,.05));border:1px solid rgba(255,255,255,.18);box-shadow:0 28px 64px rgba(14,5,30,.33)}
.hero-visual-card::after{content:"";position:absolute;inset:auto 10% 10px 10%;height:34px;border-radius:50%;background:rgba(0,0,0,.28);filter:blur(24px);z-index:0}
.hero-visual-card img{position:relative;z-index:1;display:block;width:min(100%,430px);max-height:340px;object-fit:contain;filter:drop-shadow(0 22px 38px rgba(0,0,0,.18))}

.main-content{padding:38px 0 68px}
.dashboard-card{background:#fff;border:1px solid #e7e3f2;border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.dashboard-head{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:26px 28px;border-bottom:1px solid var(--line)}
.dashboard-head h2{font-size:28px;margin:4px 0 0;letter-spacing:-.03em}
.kicker{color:var(--primary)}
.source-pill{border:1px solid #e5d7ff;background:#faf7ff;border-radius:999px;padding:9px 13px;font-size:12px;font-weight:800;color:#5b2aac;white-space:nowrap}
.source-pill span{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--primary);margin-right:6px}

.filters{padding:22px 28px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;background:#fcfbfe;border-bottom:1px solid var(--line);align-items:end}
.filters label{display:grid;gap:7px;font-size:11px;font-weight:900;color:#525866;text-transform:uppercase;letter-spacing:.08em}
.filters select,.candidate-tools input,.candidate-tools select{
  appearance:none;
  border:1px solid #d9dde4;
  background:#fff;
  border-radius:12px;
  min-height:48px;
  padding:0 14px;
  color:#1d2939;
  outline:none;
  box-shadow:0 1px 2px rgba(16,24,40,.02)
}
.filters select:focus,.candidate-tools input:focus,.candidate-tools select:focus{border-color:#9a76ee;box-shadow:0 0 0 3px rgba(111,43,217,.10)}

.notice{margin:22px 28px 0;border:1px solid #e7d9ff;background:#faf6ff;color:#6327c8;border-radius:13px;padding:13px 15px;font-size:13px;line-height:1.55}
.result-heading{padding:26px 28px 20px;display:flex;align-items:flex-start;justify-content:space-between;gap:18px}
.election-kind{color:var(--primary)}
.result-heading h3{font-size:clamp(28px,4vw,42px);margin:5px 0 5px;letter-spacing:-.04em}
.result-heading p{margin:0;color:var(--muted);line-height:1.5}
.city-tag{font-size:11px;font-weight:900;letter-spacing:.12em;padding:10px 12px;border-radius:9px;background:#f3effb;color:#4a3c69;white-space:nowrap}

.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.metric{padding:21px 23px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.metric:nth-child(4n){border-right:0}
.metric small{display:block;color:#7b8190;font-weight:800;font-size:10px;text-transform:uppercase;letter-spacing:.1em}
.metric strong{display:block;font-size:25px;margin-top:6px;letter-spacing:-.03em}
.metric.emphasis strong{color:var(--primary)}

.legend-summary{margin:22px 28px 0;border-radius:18px;border:1px solid #ede7f9;background:var(--primary-soft-2);padding:19px 20px}
.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}
.section-head.compact{margin-bottom:10px}
.section-head h3{margin:5px 0 0;font-size:24px;letter-spacing:-.03em}
.section-description{margin:0 0 16px;color:#6a7080;line-height:1.55;font-size:14px}
#legendTotal{font-size:15px;color:#422073}
.legend-rows{display:grid;gap:10px}
.legend-row{display:flex;justify-content:space-between;gap:18px;padding:11px 13px;border-radius:12px;background:#fff;border:1px solid #e8ddfa}
.legend-row b{font-size:14px}
.legend-row span,.legend-empty{color:#656d7a;font-size:14px}
.legend-empty{padding:10px 0}

.candidates-section{padding:28px}
.candidate-tools{display:flex;gap:10px;align-items:center}
.candidate-tools input{min-width:270px}
.candidates{display:grid;gap:13px}
.candidate{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:14px;align-items:center;padding:15px 16px;border:1px solid #e4e7ec;border-radius:16px;background:#fff;box-shadow:var(--shadow-soft);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.candidate:hover{transform:translateY(-1px);border-color:#d7cbf1;box-shadow:0 16px 30px rgba(16,24,40,.10)}
.candidate-rank{width:38px;height:38px;border-radius:12px;background:var(--primary-soft);color:var(--primary-dark);font-weight:900;display:grid;place-items:center;font-size:14px}
.candidate-main{min-width:0}
.candidate-line{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px}
.candidate-name{font-weight:900;font-size:18px;letter-spacing:-.02em;min-width:0}
.candidate-number{color:#6e7480;font-size:13px;font-weight:800}
.candidate-meta{margin-top:4px;color:#68707e;font-size:13px;line-height:1.5}
.candidate-meta b{color:#384250}
.candidate-right{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;text-align:right}
.candidate-votes{font-size:17px;font-weight:900;color:#1b1f28}
.candidate-pct{font-size:13px;color:#6e7480;font-weight:800}
.status-badge{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:900;white-space:nowrap}
.status-elected{color:var(--green);background:var(--green-bg);border:1px solid #b9e2cb}
.status-alternate{color:#7a2ee8;background:#f3eaff;border:1px solid #dac3ff}
.status-runoff{color:var(--yellow);background:var(--yellow-bg);border:1px solid #efd88c}
.status-not-elected{color:var(--danger);background:var(--danger-bg);border:1px solid #f3c5c1}
.empty-results{padding:30px;text-align:center;color:#6d7481;border:1px dashed #d5d9df;border-radius:13px;margin-top:14px;background:#fcfcfd}

.source-box{margin:0 28px 10px;border-radius:16px;background:#f8f5ff;border:1px solid #e4daf9;padding:15px 17px;display:flex;gap:13px;align-items:flex-start}
.source-icon{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--primary);color:#fff;font-weight:900;flex:0 0 auto}
.source-box strong{font-size:13px}
.source-box p{margin:3px 0 0;color:#69707d;font-size:12px;line-height:1.55}

.panel-actions-end{padding:0 28px 30px;display:flex;justify-content:flex-end}
.print-button{height:48px;border:0;border-radius:12px;background:var(--primary);color:#fff;padding:0 18px;font-weight:850;cursor:pointer;white-space:nowrap;display:inline-flex;align-items:center;gap:10px;box-shadow:0 10px 22px rgba(111,43,217,.20)}
.print-button:hover{background:var(--primary-dark)}
.button-icon{width:18px;height:18px;display:block;flex:0 0 auto}

.loading-state{display:flex;align-items:center;justify-content:center;gap:12px;padding:52px 24px;color:#5f6672}
.spinner{width:22px;height:22px;border:3px solid #e2e4e8;border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

.footer{background:#171120;color:#d7dae0;padding:42px 0 23px;border-top:5px solid var(--primary)}
.footer-grid{display:grid;grid-template-columns:1fr auto;gap:34px;align-items:center}
.footer-title{font-size:24px;font-weight:950;color:#fff}
.footer p{max-width:610px;color:#b8b2c7;line-height:1.6;margin:8px 0 0;font-size:13px}
.footer-brand{display:flex;align-items:center;gap:12px;text-transform:uppercase;font-size:10px;font-weight:900;letter-spacing:.09em;color:#b9b2cb}
.footer-logo-box{background:#fff;border-radius:11px;padding:9px 12px}
.footer-logo-box img{display:block;width:180px;max-width:42vw}
.footer-bottom{border-top:1px solid #32263f;margin-top:30px;padding-top:18px;display:flex;justify-content:space-between;gap:18px;color:#a49db3;font-size:11px}
.print-head{display:none}

@media (max-width:1080px){
  .hero-grid{grid-template-columns:1fr;gap:22px;padding-bottom:42px}
  .hero-copy{max-width:none}
  .hero-visual{justify-content:flex-start}
  .hero-visual-card{width:min(100%,420px)}
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .metric:nth-child(2n){border-right:0}
}

@media (max-width:900px){
  .header-inner{gap:16px}
  .filters{grid-template-columns:1fr 1fr}
  .filters label:last-child{grid-column:1 / -1}
  .project-by span{display:none}
  .dashboard-head{align-items:flex-start;flex-direction:column}
  .source-pill{display:none}
  .candidate{grid-template-columns:42px minmax(0,1fr)}
  .candidate-right{grid-column:2;justify-content:flex-start;text-align:left}
  .footer-grid{grid-template-columns:1fr}
  .footer-brand{justify-self:start}
}

@media (max-width:620px){
  .container{width:min(100% - 22px,1180px)}
  .site-header{position:static}
  .header-inner{min-height:72px;gap:10px;flex-wrap:wrap}
  .brand img{width:250px;max-width:64vw}
  .project-by{margin-left:auto}
  .project-by img{width:110px;max-width:32vw}
  .hero-grid{min-height:0;padding:34px 0 36px}
  .hero h1{font-size:42px}
  .hero p{font-size:16px}
  .hero-source{margin-top:18px;border-radius:16px;line-height:1.4}
  .hero-visual{justify-content:center}
  .hero-visual-card{padding:16px;border-radius:24px}
  .hero-visual-card img{width:min(100%,300px);max-height:240px}
  .main-content{padding-top:20px}
  .dashboard-head,.result-heading{padding:21px 17px}
  .filters{grid-template-columns:1fr;padding:17px}
  .filters label:last-child{grid-column:auto}
  .notice{margin:18px 16px 0}
  .metrics{grid-template-columns:1fr 1fr}
  .metric{padding:17px}
  .metric strong{font-size:21px}
  .legend-summary{margin:18px 16px 0;padding:16px}
  .candidates-section{padding:23px 16px}
  .section-head{align-items:stretch;flex-direction:column}
  .section-head h3{font-size:22px}
  .candidate-tools{flex-direction:column}
  .candidate-tools input,.candidate-tools select{width:100%;min-width:0}
  .candidate{padding:14px 12px;border-radius:14px}
  .candidate-name{font-size:17px}
  .candidate-votes{font-size:15px}
  .source-box{margin:0 16px 10px}
  .panel-actions-end{padding:0 16px 22px;justify-content:stretch}
  .print-button{width:100%;justify-content:center}
  .city-tag{display:none}
  .footer-bottom{flex-direction:column}
  .footer-brand{align-items:flex-start;flex-direction:column}
}

@media (max-width:420px){
  .hero h1{font-size:36px}
  .brand img{max-width:100%;width:220px}
  .project-by{width:100%;justify-content:flex-start}
  .metrics{grid-template-columns:1fr}
  .metric{border-right:0}
  .candidate{grid-template-columns:1fr}
  .candidate-rank{width:34px;height:34px}
  .candidate-right{grid-column:auto;display:grid;justify-items:start;gap:6px}
  .candidate-line{gap:6px 8px}
}

@media print{
  @page{size:A4 portrait;margin:12mm}
  :root{--paper:#fff}
  body{background:#fff;font-size:10pt}
  .site-header,.hero,.filters,.candidate-tools,.print-button,.footer,.loading-state,.notice{display:none!important}
  .main-content{padding:0}
  .container{width:100%;max-width:none}
  .dashboard-card{border:0;box-shadow:none;border-radius:0}
  .dashboard-head{display:none}
  .print-head{display:flex!important;align-items:center;justify-content:space-between;border-bottom:2px solid var(--primary);padding:0 0 8mm;margin-bottom:7mm}
  .print-main-logo{width:90mm;height:auto}
  .print-head>div{text-align:right}
  .print-head small{display:block;font-weight:800;color:#555;margin-bottom:2mm}
  .print-cordis-logo{width:48mm;height:auto}
  .result-heading{padding:0 0 5mm}
  .result-heading h3{font-size:22pt}
  .metrics{grid-template-columns:repeat(4,1fr);border:1px solid #ddd}
  .metric{padding:3mm;border-color:#ddd}
  .metric small{font-size:7pt}
  .metric strong{font-size:14pt}
  .legend-summary{margin:5mm 0 0;padding:4mm;break-inside:avoid}
  .candidates-section{padding:7mm 0 0}
  .section-head{margin-bottom:3mm}
  .candidates{border-color:#ddd}
  .candidate{grid-template-columns:11mm 1fr auto;padding:3mm 2.5mm;break-inside:avoid;border-color:#ddd;box-shadow:none}
  .candidate:hover{background:#fff;transform:none}
  .candidate-rank{width:8mm;height:8mm}
  .candidate-name{font-size:10pt}
  .candidate-meta,.candidate-pct{font-size:7.5pt}
  .candidate-votes{font-size:10pt}
  .status-badge{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .source-box{margin:7mm 0 0;padding:4mm;break-inside:avoid}
  .source-box:after{content:" · Projeto do Cordis Notícias";font-weight:800}
  .city-tag{display:block}
  .legend-row{break-inside:avoid}
  .election-kind,.section-kicker,.kicker{color:var(--primary)!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
