/* ==========================================================================
   URNA ELETRÔNICA - ESTILOS OFICIAIS E MODERNOS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=Roboto+Mono:wght@500;700&display=swap');

:root {
    --urna-bg: #121824;
    --urna-body: #2b3442;
    --urna-shadow: #141a24;
    --lcd-bg: #e2e8f0;
    --lcd-screen-bg: #f8fafc;
    --lcd-border: #94a3b8;
    --lcd-text: #0f172a;
    --btn-key-bg: #1e293b;
    --btn-key-hover: #334155;
    --btn-key-shadow: #0f172a;
    --btn-branco: #ffffff;
    --btn-corrigir: #f97316;
    --btn-confirmar: #16a34a;
    --accent-gold: #fbbf24;
}

body {
    background-color: var(--urna-bg);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #f8fafc;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* Container Principal da Urna */
.urna-wrapper {
    max-width: 1100px;
    margin: 2rem auto;
    width: 95%;
}

.urna-container {
    background: linear-gradient(145deg, #334155, #1e293b);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 2.5rem;
    border: 3px solid #475569;
}

.urna-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #475569;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}

.urna-header-title {
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #f1f5f9;
}

.justica-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #38bdf8;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Corpo Interno: Tela LCD + Teclado */
.urna-body {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
}

@media (max-width: 991px) {
    .urna-body {
        grid-template-columns: 1fr;
    }
}

/* --- TELA LCD DA URNA --- */
.urna-lcd-visor {
    background: var(--lcd-screen-bg);
    border: 10px solid #cbd5e1;
    border-radius: 16px;
    padding: 1.5rem;
    min-height: 480px;
    color: var(--lcd-text);
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.lcd-header {
    border-bottom: 2px dashed #cbd5e1;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.lcd-cargo {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lcd-instrucao {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
}

/* Digitação do Número e Caixas de Dígitos */
.digit-boxes-container {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
}

.digit-box {
    width: 55px;
    height: 68px;
    border: 3px solid #0f172a;
    background: #ffffff;
    font-family: 'Roboto Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.digit-box.pisca {
    animation: piscaBorder 1s infinite alternate;
}

@keyframes piscaBorder {
    from { border-color: #0f172a; background: #ffffff; }
    to { border-color: #0284c7; background: #e0f2fe; }
}

/* Dados do Candidato na Tela */
.candidato-info-grid {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 1rem;
    align-items: start;
}

.candidato-dados {
    font-size: 1.1rem;
}

.candidato-nome {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.candidato-partido {
    font-size: 1.05rem;
    font-weight: 700;
    color: #334155;
}

.candidato-foto-box {
    width: 140px;
    height: 175px;
    border: 3px solid #475569;
    border-radius: 8px;
    overflow: hidden;
    background: #e2e8f0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.candidato-foto-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Footer do Visor com Mensagens da Justiça Eleitoral */
.lcd-footer-help {
    border-top: 2px solid #0f172a;
    padding-top: 0.75rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #334155;
    font-weight: 600;
    line-height: 1.4;
}

.lcd-footer-help .btn-hint {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    color: white;
}
.btn-hint.confirmar { background-color: var(--btn-confirmar); }
.btn-hint.corrigir { background-color: var(--btn-corrigir); }

/* --- TECLADO DA URNA --- */
.urna-keyboard {
    background: #1e293b;
    border: 4px solid #334155;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    justify-content: center;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
}

.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    max-width: 320px;
    margin: 0 auto;
    width: 100%;
}

.numpad-grid .btn-num-row-zero {
    grid-column: 2;
}

.btn-key {
    background: linear-gradient(180deg, #334155, #1e293b);
    color: #ffffff;
    border: 2px solid #475569;
    border-radius: 10px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    height: 62px;
    cursor: pointer;
    box-shadow: 0 5px 0 #0f172a, 0 8px 10px rgba(0,0,0,0.3);
    transition: all 0.08s ease;
    user-select: none;
}

.btn-key:active, .btn-key.pressed {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #0f172a, 0 3px 5px rgba(0,0,0,0.2);
}

.action-keys-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-action {
    height: 65px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 0 #0f172a, 0 8px 12px rgba(0,0,0,0.4);
    transition: all 0.08s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.btn-action:active, .btn-action.pressed {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #0f172a;
}

.btn-action.branco {
    background: #ffffff;
    color: #0f172a;
    border: 2px solid #cbd5e1;
}

.btn-action.corrigir {
    background: #f97316;
    color: #ffffff;
}

.btn-action.confirmar {
    background: #16a34a;
    color: #ffffff;
    font-size: 0.95rem;
    height: 72px;
}

/* --- TELA FIM DA URNA --- */
.screen-fim-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 380px;
    background: #f8fafc;
}

.texto-fim {
    font-size: 6.5rem;
    font-weight: 900;
    letter-spacing: 12px;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    line-height: 1;
    animation: zoomFim 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.texto-voto-gravado {
    font-size: 1.25rem;
    font-weight: 700;
    color: #16a34a;
    margin-top: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes zoomFim {
    from { transform: scale(0.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Alertas da Urna */
.alert-urna {
    background: #fef2f2;
    border: 2px solid #ef4444;
    color: #991b1b;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-weight: 700;
}

.alert-urna-info {
    background: #eff6ff;
    border: 2px solid #3b82f6;
    color: #1e40af;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-weight: 700;
}
