/* ===== SINAPO: folha de estilo única (site, painel do administrador e cabine de votação) =====
   Mesma fonte, cores, botões, caixas e tabelas em todas as telas.
   Cores do SINAPO: azul #2d59a3, verde #047e40, amarelo #f3c82e. */
:root {
  --azul: #2d59a3; --azul-escuro: #1b3a73; --azul-claro: #e8eef8;
  --verde: #047e40; --amarelo: #f3c82e; --vermelho: #b3261e;
  --texto: #1f2937; --suave: #5b6877; --borda: #d3d9e0; --fundo: #f3f5f8; --branco: #fff;
  --raio: 8px;
  --fonte: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
html, body { font-family: var(--fonte) !important; color: var(--texto); background: var(--fundo); font-size: 16px; line-height: 1.5; }
body, p, li, td, th, label, input, select, textarea, button, a, span, div { font-family: var(--fonte); }
tt, pre, code, .data, #election_hash { font-family: ui-monospace, "SFMono-Regular", Consolas, Menlo, monospace !important; font-size: .9em; }

/* títulos */
h1, h2, h3, h4, h5, h6 { font-family: var(--fonte) !important; color: var(--azul-escuro); font-weight: 700; line-height: 1.25; margin: 0 0 .6em; text-transform: none; }
h2, h2.title { font-size: 1.6rem; } h3 { font-size: 1.3rem; } h4 { font-size: 1.15rem; } h5 { font-size: 1.05rem; }
p { line-height: 1.55; margin: 0 0 1em; }
p.small, .small { font-size: .875rem; color: var(--suave); }

/* links */
a, a:link, a:visited { color: var(--azul); text-decoration: none; }
a:hover, a:active { color: var(--azul-escuro); text-decoration: underline; }

/* botões: um único estilo */
.button, button, input[type=submit], input[type=button], button.button, a.button {
  display: inline-block; background: var(--azul) !important; color: #fff !important; border: 1px solid var(--azul) !important;
  border-radius: var(--raio) !important; padding: .65em 1.3em !important; font-size: 1rem !important; font-weight: 600 !important;
  line-height: 1.2 !important; text-align: center; text-decoration: none !important; cursor: pointer; box-shadow: none !important;
  text-shadow: none !important; margin: 0 .4em .6em 0; transition: background .15s;
}
.button:hover, button:hover, input[type=submit]:hover, input[type=button]:hover, a.button:hover { background: var(--azul-escuro) !important; border-color: var(--azul-escuro) !important; color: #fff !important; }
.button.tiny, a.button.tiny { padding: .35em .8em !important; font-size: .8rem !important; }
.button.small { padding: .5em 1em !important; font-size: .9rem !important; }
.button.large { padding: .85em 1.8em !important; font-size: 1.1rem !important; }
.button.verde, button.verde, input[type=submit].verde { background: #2e7d32 !important; border-color: #2e7d32 !important; color: #fff !important; }
.button.verde:hover, button.verde:hover, input[type=submit].verde:hover { background: #1b5e20 !important; border-color: #1b5e20 !important; }
.button.secondary, button.secondary { background: #fff !important; color: var(--azul) !important; border-color: var(--azul) !important; }
.button.secondary:hover { background: var(--azul-claro) !important; color: var(--azul-escuro) !important; }
.button.success, .button.confirm { background: var(--verde) !important; border-color: var(--verde) !important; }
.button.alert, .button.danger { background: var(--vermelho) !important; border-color: var(--vermelho) !important; }
button.link-button { background: none !important; border: none !important; color: var(--azul) !important; padding: 0 !important; font-weight: 400 !important; margin: 0; }
button.link-button:hover { background: none !important; text-decoration: underline; }
button[disabled], input[disabled] { opacity: .5; cursor: not-allowed; }

/* campos de formulário */
input[type=text], input[type=password], input[type=email], input[type=number], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; max-width: 32em; padding: .6em .7em; font-size: 1rem; color: var(--texto); background: #fff;
  border: 1px solid #b6c0cc; border-radius: var(--raio); box-shadow: none; height: auto; box-sizing: border-box;
}
textarea { max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--azul-claro); border-color: var(--azul); }
label { color: var(--texto); font-weight: 600; font-size: .95rem; }
.errorlist, .error, p[style*="color: red"] { color: var(--vermelho) !important; }

/* caixas */
.highlight-box, .highlight-box-margin, .announcement-banner, div[style*="border: 1px solid #888"], div[style*="background: #eee"] {
  background: #fff !important; border: 1px solid var(--borda) !important; border-radius: var(--raio) !important; padding: 14px 16px !important; color: var(--texto) !important;
}
.announcement-banner { background: #fff8dc !important; border-color: var(--amarelo) !important; }
.highlight-box-margin { margin-right: 0 !important; }

/* tabelas */
table, table.pretty { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); margin: .5em 0 1.2em; }
table th, table.pretty th { background: var(--azul-claro); color: var(--azul-escuro); text-align: left; font-weight: 700; padding: .55em .7em; border: 1px solid var(--borda); }
table td, table.pretty td { padding: .5em .7em; border: 1px solid var(--borda); vertical-align: top; background: #fff; }
table tr:nth-child(even) td { background: #fafbfc; }

/* barra do topo, rodapé */
.top-bar, .top-bar-section ul li > a, .top-bar-section li:not(.has-form) a:not(.button), .top-bar .title-area, nav.top-bar { background: var(--azul-escuro) !important; }
.top-bar-section ul li > a:hover:not(.button) { background: var(--azul) !important; }
.top-bar-section li a:not(.button) { color: #fff !important; font-size: 1rem; font-weight: 600; text-decoration: none; }
.top-bar .name h1 a { color: #fff !important; font-size: 1.25rem; font-weight: 800; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.sinapo-marca { display: inline-flex; align-items: center; gap: .5em; }
.sinapo-marca b { color: #fff; font-size: 1.3rem; letter-spacing: .06em; }
.sinapo-marca i { width: .9em; height: .9em; border-radius: 50%; background: conic-gradient(var(--azul) 0 33%, var(--verde) 0 66%, var(--amarelo) 0); display: inline-block; border: 2px solid #fff; }
.sinapo-marca img { display: block; height: 60px; width: auto; background: #fff; padding: 4px 10px; border-radius: 8px; margin: 8px 0; }
@media (min-width: 40.0625em) {
  .top-bar { height: 76px !important; }
  .top-bar .title-area { height: 76px !important; }
  .top-bar-section ul li > a { line-height: 76px !important; }
}
.footer, #footer { background: #e6ebf1 !important; color: var(--suave); border-top: 1px solid var(--borda) !important; font-size: .9rem; padding: 8px 20px !important; }
.footer a, #footer a { color: var(--azul); }
.footer .button, #footer .button { margin: 0 0 0 .5em; }

/* cabine de votação */
#wrapper { background: #fff; border: 1px solid var(--borda) !important; border-radius: 12px; overflow: hidden; margin: 20px auto; max-width: 860px; box-shadow: 0 2px 10px rgba(27,58,115,.08); }
.edge { box-sizing: border-box; background: var(--azul-escuro) !important; color: #fff !important; font-size: 1.1rem !important; padding: 12px 16px !important; font-weight: 700; }
#banner > div { display: flex !important; align-items: center; justify-content: space-between; width: 100% !important; text-align: left !important; gap: 12px; }
#banner > div > div { float: none !important; margin: 0 !important; font-size: .9rem !important; white-space: nowrap; }
#footer.edge, .edge#footer { background: #e6ebf1 !important; color: var(--suave) !important; font-weight: 400; font-size: .85rem !important; display: block; word-break: break-all; border-top: 1px solid var(--borda) !important; }
.edge a { color: #fff !important; font-weight: 600; }
#header h1 { font-size: 1.7rem !important; background: none !important; border: none !important; padding: 8px 0 !important; }
#header h2 { font-size: 1.2rem !important; }
#page h2 { background: var(--azul-claro) !important; border-bottom: 2px solid var(--azul) !important; color: var(--azul-escuro); padding: 8px 12px !important; border-radius: 6px; }
#progress_div { font-size: 1rem !important; }
#progress_div td.unselected { background: #eef1f5 !important; color: var(--suave) !important; border: 1px solid var(--borda) !important; }
#progress_div td.selected { background: var(--azul) !important; color: #fff !important; border: 1px solid var(--azul) !important; font-weight: 700; }
#footer { font-size: .85rem !important; }
#election_info { font-size: 1.05rem !important; }
.selected { background: var(--azul-claro) !important; color: var(--azul-escuro); }
.answer, .ballot_answer { font-size: 1.1rem; }

/* ===== uniformização de tamanhos soltos no HTML antigo ===== */
*, *::before, *::after { box-sizing: border-box; }
#contentbody [style*="font-size"], #content [style*="font-size"], #page [style*="font-size"] { font-size: 1rem !important; }
#contentbody [style*="font-size:0.8em"], #contentbody [style*="font-size: 0.8em"], #contentbody [style*="font-size:0.7em"], #contentbody [style*="font-size: 0.7em"],
#content [style*="font-size:0.8em"], #content [style*="font-size: 0.8em"] { font-size: .85rem !important; color: var(--suave); }
#contentbody h3 [style*="font-size"], #contentbody h2 [style*="font-size"] { font-size: .9rem !important; font-weight: 400; }
tt, tt[style], td tt, #contentbody tt { font-size: .85rem !important; word-break: break-all; overflow-wrap: anywhere; font-weight: 600; }
[style*="lightyellow"] { background: #fff !important; border: 1px solid var(--borda) !important; border-radius: var(--raio) !important; padding: 12px 16px !important; max-width: none !important; }
[style*="lightyellow"] a { font-weight: 600; }
#contentbody { max-width: 1100px; margin: 0 auto; }
table { max-width: 100%; }
#contentbody table { display: block; overflow-x: auto; }
#contentbody table tbody, #contentbody table thead { display: table; width: 100%; }
a[style*="font-size"], p[align=center] { font-size: 1rem !important; }
/* menu de seções da eleição (perguntas | eleitores | curadores): mesmo tamanho dos demais links */
#contentbody p[align=center] a, #contentbody h4 a, #contentbody h5 a { font-size: 1.05rem !important; }
.top-bar { height: auto; } .title-area { background: transparent !important; }

/* faixa "Cabine de votação" no topo das telas de voto */
.cabine-topo { background: var(--azul-escuro); color: #fff; font-weight: 700; font-size: 1.05rem; padding: 10px 16px; border-radius: var(--raio); margin: 0 0 1.2rem; }

/* telas estreitas (celular): logo e título lado a lado, menu recolhido até tocar em MENU */
.sinapo-titulo, .sinapo-links { display: none; }
@media (max-width: 40em) {
  nav.top-bar, .top-bar { height: auto !important; overflow: visible !important; }
  .top-bar .title-area { height: auto !important; position: relative; display: flex; align-items: center; min-height: 60px; padding-right: 84px; margin: 0; }
  .top-bar .title-area .name { height: auto !important; line-height: normal !important; flex: 1 1 auto; margin: 0; }
  .top-bar .name h1 { margin: 0; }
  .sinapo-marca img { height: 44px !important; padding: 3px 7px !important; margin: 8px 0 !important; }
  .top-bar .name h1 a { gap: 12px; }
  .sinapo-titulo { display: block; color: #fff; font-size: .98rem; font-weight: 800; line-height: 1.15; white-space: nowrap; letter-spacing: .01em; }
  .top-bar .title-area .toggle-topbar { position: absolute !important; right: 0; top: 50%; transform: translateY(-50%); height: auto !important; }
  .top-bar .title-area .toggle-topbar a { line-height: 1 !important; padding: 12px 14px !important; height: auto !important; }
  .top-bar .title-area .toggle-topbar { display: none !important; }
  .top-bar-section { display: none !important; }
  .top-bar .title-area { padding-right: 78px; }
  .sinapo-links { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
  .sinapo-links a { color: #fff !important; font-weight: 700; font-size: .95rem; text-decoration: underline; padding: 2px 0; }
}
