:root {
  --blue: #0a4a86;
  --blue-deep: #002860;
  --blue-hover: #0c5ea8;
  --ink: #071426;
  --muted: rgba(7, 20, 38, 0.72);
  --line: rgba(0, 40, 96, 0.14);
  --bg: #f3f6fb;
  --bg-soft: #e7eef6;
  --white: #fff;
  --red: #c41616;
  --shadow: rgba(0, 40, 96, 0.1);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 112px; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 1.05rem;
  line-height: 1.6;
}
img { max-width: 100%; }
a { color: var(--blue); }
button, input { font: inherit; }
.skip {
  position: absolute;
  left: 12px;
  top: 10px;
  transform: translateY(-160%);
  background: #fff;
  color: var(--blue-deep);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  z-index: 100;
}
.skip:focus { transform: none; }
.container { width: min(1160px, 90%); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--blue-deep);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 12px rgba(0, 20, 48, 0.22);
}
.nav {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
}
.logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  background: #fff;
  border-radius: 12px;
  padding: 6px 10px;
  line-height: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.logo img { display: block; height: 64px; width: auto; }
.mn { position: absolute; opacity: 0; pointer-events: none; }
.burger { display: none; font-size: 1.7rem; cursor: pointer; color: #fff; line-height: 1; }
.menu { display: flex; align-items: center; gap: 6px 22px; list-style: none; margin: 0; padding: 0; }
.menu a { color: #fff; text-decoration: none; font-weight: 600; letter-spacing: 0.01em; }
.menu a:hover { color: #d7e6f5; }
.site-header .btn {
  width: auto;
  background: #fff;
  color: var(--blue-deep);
}
.site-header .btn:hover { background: #e7eef6; color: var(--blue-deep); }
.conta { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.conta form { margin: 0; }
.link {
  background: none;
  border: 0;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.ticker-wrap {
  background: var(--blue-deep);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ticker { transition: opacity 0.4s ease; }

.main { padding: 36px 0 20px; }
h1, .section-title {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
  color: var(--blue-deep);
  margin: 0 0 8px;
}
h1 { font-size: 2rem; }
.section-title { font-size: 1.7rem; margin-bottom: 18px; }
h1::after, .section-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  margin: 12px auto 0;
  background: var(--red);
}
.lead {
  text-align: center;
  color: var(--muted);
  font-weight: 400;
  margin: 18px auto 28px;
  max-width: 720px;
}

.busca-cidade { max-width: 440px; margin: -8px auto 22px; }
.busca-cidade label {
  display: block;
  margin-bottom: 6px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.busca-cidade input[type="search"] {
  min-height: 48px;
  border: 1.5px solid #d5e1ee;
  border-radius: 14px;
  background: #fff;
  padding: 12px 16px;
}
.busca-vazia { text-align: center; color: var(--muted); margin: 0 0 18px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 18px var(--shadow); }
.card[hidden] { display: none; }
.card .foto, .card .foto-fallback {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: #e9ecef;
  display: block;
}
.card-vereador .foto, .card-vereador .foto-fallback { height: 168px; object-position: center top; }
.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  text-align: center;
}
.card .nome { font-weight: 700; min-height: 2.6em; display: flex; align-items: center; justify-content: center; }
.partido { color: var(--muted); font-size: 0.92rem; margin: 0; }
.votos { margin: 0; color: var(--blue); font-weight: 700; }

.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
.btn:hover { background: var(--blue-hover); color: #fff; }
.btn-small { width: auto; padding: 8px 14px; font-size: 0.92rem; }
.btn-lg { width: auto; min-width: 220px; padding: 16px 36px; font-size: 1.2rem; }
.btn-row { display: flex; justify-content: center; margin: 8px 0 28px; }

.section { padding: 56px 0; }
.section-white { background: var(--white); }
.section-light { background: var(--bg-soft); }
.section-deep { background: var(--blue-deep); color: #fff; }
.section-deep .section-title, .section-deep p { color: #fff; }
.section p { max-width: 760px; margin: 0 auto 14px; text-align: center; }
.video {
  position: relative;
  width: min(860px, 100%);
  margin: 18px auto 0;
  padding-top: 56.25%;
  background: #d9e2ec;
  border-radius: var(--radius);
  overflow: hidden;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.sponsors { display: grid; gap: 20px; align-items: center; justify-items: center; }
.sponsors-2 { grid-template-columns: repeat(2, minmax(0, 280px)); justify-content: center; }
.sponsors-1 { grid-template-columns: minmax(0, 280px); justify-content: center; }
.sponsor { display: flex; align-items: center; justify-content: center; min-height: 120px; }
.sponsor img { max-height: 110px; width: auto; }
.sponsor-label {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3d4d63;
  font-size: 0.95rem;
  margin: 8px 0 12px;
}
.audit-note { text-align: center; color: var(--muted); padding: 8px 16px 28px; }

.site-footer { background: var(--blue-deep); color: rgba(255,255,255,0.88); padding: 40px 0 18px; }
.site-footer a { color: #fff; text-decoration: none; display: block; padding: 4px 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.footer-grid h2 { margin: 0 0 10px; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; }
.site-footer .logo-foot {
  display: inline-flex;
  width: auto;
  margin-bottom: 14px;
  padding: 6px 10px;
}
.site-footer .logo-foot img { height: 64px; width: auto; }
.social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.social a:hover { background: #fff; color: var(--blue-deep); }
.social svg { width: 20px; height: 20px; display: block; fill: currentColor; }
.copy { margin-top: 22px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.18); font-size: 0.88rem; }

.cookies {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow);
  padding: 14px 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.cookies[hidden] { display: none; }
.cookies p { margin: 0; }
.cookies-actions { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(7, 20, 38, 0.46);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  overflow: auto;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--white);
  width: min(460px, 100%);
  border-radius: 22px;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(0, 24, 56, 0.28);
}
.modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 40, 96, 0.12);
  z-index: 2;
}
.vote-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 58px 20px 22px;
  background: linear-gradient(145deg, #f7fbff 0%, #e4eef8 100%);
}
.eyebrow {
  margin: 0 0 2px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}
.modal h2 { margin: 0; color: var(--blue-deep); font-size: 1.35rem; text-align: left; text-transform: none; line-height: 1.25; }
.modal h2::after { display: none; }
.vote-city { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }
.modal-foto {
  width: 76px;
  height: 76px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  background: #e9ecef;
  border: 3px solid #fff;
  box-shadow: 0 8px 18px rgba(0, 40, 96, 0.16);
  flex-shrink: 0;
}
.vote-body { padding: 6px 22px 22px; }
.done-body { padding-top: 28px; }
.done-body p:last-of-type { color: var(--muted); }
.vote-body .field {
  margin: 16px 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.vote-body input:not([type]),
.vote-body input[type="text"],
.vote-body input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  background: #f5f8fb;
  border: 1.5px solid #d5e1ee;
  border-radius: 12px;
  min-height: 48px;
  padding: 12px 14px;
}
.vote-body input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #f5f8fb inset;
}
.vote-body input:not([type]):focus,
.vote-body input[type="text"]:focus,
.vote-body input[type="email"]:focus {
  background: #fff;
  border-color: var(--blue);
  outline: none;
}
.choice-grid { display: grid; gap: 10px; }
.choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1.5px solid #d7e2ee;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}
.choice-card input { width: 18px; height: 18px; accent-color: var(--blue); flex-shrink: 0; }
.choice-card:has(input:checked) {
  border-color: var(--blue);
  background: #f3f8fd;
  box-shadow: inset 0 0 0 1px var(--blue);
}
.btn-vote {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  border-radius: 14px;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.tabs { display: flex; gap: 8px; margin: 12px 0; }
.tab {
  flex: 1;
  border: 1px solid var(--line);
  background: #f6f8fb;
  border-radius: 8px;
  padding: 8px;
  font-weight: 700;
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.field { display: block; margin: 12px 0 4px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"] {
  width: 100%;
  border: 1px solid #c9d5e4;
  border-radius: 8px;
  padding: 10px 12px;
}
input:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.check { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0; font-weight: 500; }
.check input { margin-top: 4px; }
.choice { display: block; margin: 8px 0; font-weight: 600; }
.alert { background: #fdeeee; color: #8a1c1c; border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.alert.ok { background: #e7f4ea; color: #0e5a32; }
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.combo { position: relative; }
.combo-list {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #c9d5e4;
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
  box-shadow: 0 8px 18px var(--shadow);
}
.combo-list[hidden] { display: none; }
.combo-list li { padding: 8px 12px; cursor: pointer; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: #e7f0fa; }
.readonly { background: #f4f7fb; color: var(--muted); }

.admin-top { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.admin-top h1 { text-align: left; margin: 0; }
.admin-top h1::after { margin-left: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 22px; }
.stats-home { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.stat { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 4px 12px var(--shadow); }
.stat b { display: block; font-size: 1.6rem; color: var(--blue-deep); }
.city-list { display: grid; gap: 12px; }
.city-row {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 0.6fr) auto;
  gap: 10px;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 12px var(--shadow);
}
.city-row strong { color: var(--blue-deep); }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 0.95rem; }
th { background: var(--blue-deep); color: #fff; font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.filters a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--ink); font-weight: 600; }
.filters a.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.table-wrap { overflow: auto; }

.page-admin h1,
.page-admin .section-title { text-align: left; text-transform: none; letter-spacing: 0; font-size: 1.7rem; }
.page-admin h1 .mini { display: inline-block; vertical-align: middle; margin-right: 8px; }
.page-admin h1 .partido { color: var(--muted); font-size: 1rem; font-weight: 600; margin-left: 8px; }
.page-admin h1::after,
.page-admin .section-title::after { margin-left: 0; }
.page-admin .btn { width: auto; }
.admin-menu { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.admin-menu a.on { color: #fff; box-shadow: inset 0 -2px 0 #fff; }
.admin-menu form { margin: 0; }
.admin-sub { margin: 6px 0 0; color: var(--muted); }
.admin-foot { padding: 28px 0 36px; color: var(--muted); font-size: 0.92rem; }
.panel {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 10px 28px var(--shadow);
  max-width: 640px;
}
.login-panel { margin: 0 auto; }
.page-admin input:not([type]),
.page-admin input[type="text"],
.page-admin input[type="email"],
.page-admin input[type="password"],
.page-admin input[type="number"],
.page-admin input[type="search"],
.page-admin input[type="url"],
.page-admin select,
.login-panel input[type="email"],
.login-panel input[type="password"] {
  width: 100%;
  border: 1.5px solid #d5e1ee;
  border-radius: 12px;
  min-height: 48px;
  padding: 12px 14px;
  background: #f5f8fb;
  font: inherit;
}
.page-admin input:focus,
.page-admin select:focus,
.login-panel input:focus {
  background: #fff;
  border-color: var(--blue);
  outline: none;
}
.page-admin input[type="file"] { width: 100%; margin-top: 6px; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 0.92rem; }
.row-actions { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; }
.page-admin td .row-actions { white-space: nowrap; }
.row-actions form { margin: 0; }
.btn-line { background: #fff; color: var(--blue); border: 1.5px solid #c5d7ea; }
.page-admin .btn-line:hover,
.btn-line:hover { background: #f3f8fd; color: var(--blue); }
.btn-danger { background: #fff; color: #8a1c1c; border: 1.5px solid #e7c4c4; }
.page-admin .btn-danger:hover,
.btn-danger:hover { background: #fdeeee; color: #8a1c1c; }
.quem { display: flex; align-items: center; gap: 10px; }
.quem .slug { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.page-admin .row-actions .btn { padding: 6px 10px; font-size: 0.78rem; }
.mini { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; background: #e9ecef; display: block; flex-shrink: 0; }
.mini-vazio { display: inline-block; }
.form-foto { width: 120px; height: 80px; object-fit: cover; border-radius: 12px; display: block; margin-top: 8px; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 0.75rem; font-weight: 700; background: #e7f4ea; color: #0e5a32; vertical-align: middle; }
.badge.off { background: #eef2f6; color: var(--muted); }
.page-admin table { box-shadow: 0 8px 24px var(--shadow); }
.page-admin th { white-space: nowrap; }
.page-admin th a { color: inherit; text-decoration: none; }
.page-admin th a:hover { text-decoration: underline; }
.page-admin th.ordena a::after,
.page-admin th.asc a::after,
.page-admin th.desc a::after { margin-left: 6px; font-weight: 500; }
.page-admin th.ordena a::after { content: "↕"; opacity: 0.45; }
.page-admin th.asc a::after { content: "↑"; }
.page-admin th.desc a::after { content: "↓"; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 4px; }
.pager p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.pager-links { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pager-links a, .pager-links span {
  display: inline-flex; min-width: 36px; height: 36px; align-items: center; justify-content: center;
  padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  text-decoration: none; color: var(--ink); font-weight: 600;
}
.pager-links a:hover { border-color: var(--blue); color: var(--blue); }
.pager-links .on { background: var(--blue); color: #fff; border-color: var(--blue); }
.pager-links .off { color: var(--muted); }
.page-admin .filters { align-items: end; }
.page-admin .filters label { display: grid; gap: 4px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.page-admin .filters select,
.page-admin .filters input { min-width: 220px; }
.city-row .badge { margin-left: 8px; }

@media (max-width: 900px) {
  .burger { display: block; }
  .menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--blue-deep);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 8% 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 14px 24px rgba(0, 20, 48, 0.28);
  }
  .menu a { padding: 10px 0; }
  .site-header .menu .btn { width: 100%; margin-top: 6px; }
  .mn:checked ~ .menu { display: flex; }
  .logo img { height: 52px; }
  .footer-grid, .city-row, .stats { grid-template-columns: 1fr; }
  .sponsors-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .cookies { flex-direction: column; align-items: stretch; }
  .btn-lg { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .ticker { transition: none; }
  .card:hover { transform: none; }
}
