* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #3d4a5c;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 20px;
}

/* ===== CORPO DA URNA ===== */
.urna {
  width: 100%;
  max-width: 1000px;
  background: linear-gradient(180deg, #e9e4d6, #d8d2c1);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  gap: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45), inset 0 2px 0 #fff;
}

/* ===== TELA ===== */
.tela {
  flex: 1.5;
  background: #555;
  padding: 16px;
  border-radius: 8px;
  box-shadow: inset 0 0 12px #000;
}

.tela-conteudo {
  background: #f1f1ee;
  height: 100%;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  font-family: "Courier New", monospace;
  color: #000;
}

.d-1 {
  flex: 1;
  display: flex;
  padding: 14px;
}

.d-1-esquerda {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.d-1-topo {
  font-size: 15px;
  font-weight: bold;
  min-height: 18px;
}

.d-1-cargo {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  margin: 22px 0 18px;
}

.d-1-numeros {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  margin-bottom: 14px;
}

.numero {
  width: 38px;
  height: 48px;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: bold;
  background: #fff;
}

.numero.pisca {
  animation: pisca 1s steps(1) infinite;
}

@keyframes pisca {
  0%   { background: #fff; }
  50%  { background: #000; }
}

.d-1-info {
  font-size: 17px;
  line-height: 1.7;
}

.d-1-aviso {
  margin-top: auto;
  text-align: center;
}

.aviso-grande {
  font-size: 34px;
  font-weight: bold;
  animation: piscaTexto 1s steps(1) infinite;
}

.aviso-pequeno {
  font-size: 17px;
  font-weight: bold;
  margin-bottom: 8px;
}

@keyframes piscaTexto {
  50% { opacity: 0; }
}

.d-1-direita {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.foto {
  text-align: center;
  font-size: 12px;
}

.foto-img {
  width: 110px;
  height: 130px;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: bold;
  color: #fff;
  font-family: Arial, sans-serif;
  margin-bottom: 3px;
}

img.foto-img {
  display: block;
  object-fit: cover;
  object-position: center top;
  background: #ccc;
}

.foto.pequena .foto-img {
  width: 76px;
  height: 90px;
  font-size: 26px;
}

.d-2 {
  border-top: 1px solid #000;
  padding: 8px 14px;
  font-size: 14px;
  line-height: 1.5;
  visibility: hidden;
}

.d-2 .verde   { color: #0a7a32; font-weight: bold; }
.d-2 .laranja { color: #d35400; font-weight: bold; }

.fim {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
}

.fim-texto {
  font-size: 110px;
  font-weight: bold;
  letter-spacing: 8px;
}

.fim-sub {
  font-size: 16px;
  color: #444;
  margin-top: 6px;
}

/* ===== LATERAL / TECLADO ===== */
.lateral {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.marca {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  font-size: 15px;
  color: #333;
  letter-spacing: 1px;
}

.brasao {
  font-size: 34px;
}

.teclado {
  background: #1d1d1d;
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 0 8px #000;
}

.teclado-linha {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.tecla {
  width: 72px;
  height: 46px;
  background: linear-gradient(180deg, #2e2e2e, #151515);
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  border: 1px solid #000;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 3px 0 #000;
}

.tecla:active,
.botao:active {
  transform: translateY(3px);
  box-shadow: none;
}

.acoes {
  margin-top: 8px;
  gap: 8px;
}

.botao {
  flex: 1;
  height: 50px;
  border: 1px solid #000;
  border-radius: 5px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 0 #000;
}

.botao-branco   { background: #fff;    color: #000; }
.botao-corrige  { background: #e87722; color: #000; }
.botao-confirma { background: #1f9d4b; color: #000; height: 62px; margin-top: -12px; }

/* ===== CONTROLES / MODAL ===== */
.controles {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  color: #d9dee6;
  font-size: 14px;
}

.controles button,
.modal-botoes button {
  padding: 9px 16px;
  border: none;
  border-radius: 6px;
  background: #fff;
  font-weight: bold;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.aberto { display: flex; }

.modal-caixa {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
}

.modal-caixa h2 { margin-bottom: 14px; }
.modal-caixa h3 { margin: 16px 0 6px; font-size: 15px; }

.modal-caixa table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.modal-caixa td {
  padding: 6px 4px;
  border-bottom: 1px solid #eee;
}

.modal-caixa td:last-child { text-align: right; font-weight: bold; }

.modal-caixa th {
  text-align: left;
  font-size: 12px;
  color: #666;
  padding: 6px 4px;
  border-bottom: 2px solid #ddd;
}

.relatorio h1 { font-size: 18px; margin-bottom: 10px; }
.relatorio h2 { font-size: 16px; margin-top: 12px; }
.relatorio p  { font-size: 14px; margin: 6px 0; }
.relatorio hr { margin: 14px 0; border: none; border-top: 1px solid #ddd; }

.alerta {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
  font-weight: bold;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.modal-botoes {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-botoes button { background: #e5e7eb; }
.modal-botoes .perigo { background: #dc2626; color: #fff; }

/* Botões de administração: escondidos para os eleitores */
body:not(.modo-admin) .so-admin {
  display: none;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 820px) {
  .urna { flex-direction: column; padding: 16px; }
  .tela-conteudo { min-height: 320px; }
  .fim-texto { font-size: 70px; }
  .tecla { width: 64px; }
}
