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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #333;
    font-size: 24px;
    margin-bottom: 8px;
}

.header p {
    color: #666;
    font-size: 14px;
}

.screen {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.info {
    background: #e8f4f8;
    border-left: 4px solid #667eea;
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}

.info.success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.votacao-info {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
    margin-bottom: 20px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.error.show {
    display: block;
}

button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading {
    display: none;
    text-align: center;
    color: #667eea;
    font-size: 14px;
    margin-top: 20px;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.timer {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-top: 12px;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
}

.back-link a:hover {
    text-decoration: underline;
}

.placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.placeholder p {
    font-size: 16px;
    margin-bottom: 10px;
}

/* Tela de Seleção de Método 2FA */
.metodos-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.metodo-option {
    width: 100%;
}

.metodo-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    text-align: center;
    background: white;
    border: 2px solid #e0e0e0;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.metodo-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: none;
    box-shadow: none;
}

.metodo-btn:active {
    border-color: #667eea;
    background: #f0f2ff;
}

.metodo-icon {
    font-size: 24px;
}

.metodo-label {
    font-weight: 600;
    font-size: 14px;
    display: block;
}

.metodo-desc {
    font-size: 12px;
    color: #999;
    display: block;
}

/* Tela de Votação */
#votacaoScreen {
    max-width: 600px;
}

.bloco-votacao {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s;
}

.titulo-votacao {
    margin-bottom: 20px;
}

.titulo-votacao h2 {
    color: #333;
    font-size: 18px;
    margin: 0;
}

.opcoes-votacao {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.opcao-voto {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    color: #333;
    width: auto;
}

.opcao-voto:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.opcao-voto.ativo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.opcao-voto-confirmar {
    background: green;
    color: #fff;
}

.opcao-voto-confirmar:hover {
    background: green;
    color: #fff;
}

.voto-numero {
    font-size: 24px;
    font-weight: 700;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.voto-nome {
    font-size: 12px;
    font-weight: 500;
}

.voto-confirmacao {
    background: #fffbea;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.voto-selecionado {
    text-align: center;
    color: #333;
    font-size: 14px;
    margin-bottom: 12px;
}

.botoes-confirmacao {
    display: flex;
    gap: 8px;
}

.btn-confirmar,
.btn-cancelar {
    flex: 1;
    padding: 10px;
    font-size: 14px;
}

.btn-cancelar {
    background: #e74c3c;
}

.btn-cancelar:hover {
    background: #c0392b;
}

.voto-registrado {
    text-align: center;
    color: #28a745;
    padding: 16px;
    background: #d4edda;
    border-radius: 6px;
    border: 1px solid #28a745;
}

.check-mark {
    font-size: 32px;
    margin-bottom: 8px;
}

.voto-registrado p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.votacao-final {
    margin-top: 24px;
    text-align: center;
}

#btn-finalizar {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    margin-top: 16px;
}

#btn-finalizar:hover {
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4);
}

/* Admin Dashboard */
.container-admin {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 900px;
    padding: 40px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.dashboard-header h2 {
    color: #333;
    font-size: 20px;
    margin: 0;
}

.dashboard-info {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
}

.status-sistema {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.status-sistema.vivo {
    color: #28a745;
}

.status-sistema.offline {
    color: #ffc107;
}

.btn-logout {
    background: #e74c3c;
    padding: 8px 16px;
    font-size: 13px;
    width: auto;
    min-width: 100px;
}

.btn-logout:hover {
    background: #c0392b;
}

/* Cards de Estatísticas */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card-large {
    grid-column: auto / span 1;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

.stat-value-large {
    font-size: 36px;
    font-weight: 700;
}

.stat-subtext {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 8px;
}

/* Gráfico */
.grafico-container {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.grafico-container h3 {
    color: #333;
    font-size: 16px;
    margin: 0 0 20px 0;
}

.grafico-area {
    background: white;
    border-radius: 6px;
    padding: 16px;
    min-height: 250px;
}

.grafico-barras {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 4px;
}

.barra-grupo {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.barra {
    width: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 20px;
    transition: background 0.2s;
}

.barra:hover {
    background: linear-gradient(180deg, #764ba2 0%, #667eea 100%);
}

.barra-valor {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.barra-label {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    white-space: nowrap;
}

/* Ações do Dashboard */
.dashboard-actions {
    text-align: center;
}

.btn-atualizar {
    background: #667eea;
    padding: 12px 24px;
    font-size: 14px;
    width: auto;
    min-width: 150px;
}

.btn-atualizar:hover {
    background: #5568d3;
}

/* Admin Setup */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-opcao {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border: 2px solid #e0e0e0;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    justify-content: flex-start;
}

.btn-opcao:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(4px);
}

.btn-opcao .icon {
    font-size: 20px;
}

.resultado-box {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.resultado-campo {
    margin-bottom: 16px;
}

.resultado-campo:last-child {
    margin-bottom: 0;
}

.resultado-campo label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.resultado-valor {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    color: #333;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.resultado-valor.senha-temporaria {
    background: #fff9e6;
    border-color: #ffc107;
    color: #856404;
    font-weight: 600;
}

.aviso {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
    margin: 16px 0 0 0;
}

.btn-primary,
.btn-secondary {
    width: auto;
    padding: 12px 20px;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

input[type="email"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.admin-header h2 {
    color: #333;
    font-size: 20px;
    margin: 0;
}

.admin-header p {
    margin: 4px 0 0 0;
    font-size: 13px;
}

/* Abas */
.admin-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-btn {
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #999;
    transition: all 0.3s;
    width: auto;
}

.tab-btn:hover {
    color: #667eea;
    background: transparent;
    transform: none;
}

.tab-btn.ativo {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Conteúdo abas */
.tab-content {
    animation: fadeIn 0.3s;
}

.tab-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tab-title h3 {
    color: #333;
    font-size: 18px;
    margin: 0;
}

.btn-pequeno {
    background: #667eea;
    padding: 8px 12px;
    font-size: 12px;
    width: auto;
    min-width: auto;
}

/* Formulário Novo Observador */
.formulario-oculto {
    display: none;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

.button-group-pequeno {
    display: flex;
    gap: 8px;
}

.button-group-pequeno button {
    flex: 1;
}

/* Lista de Observadores */
.lista-observadores {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.observador-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.obs-info {
    flex: 1;
}

.obs-info strong {
    display: block;
    color: #333;
    margin-bottom: 4px;
}

.obs-email {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.admin {
    background: #667eea;
    color: white;
}

.badge.observer {
    background: #6c757d;
    color: white;
}

.obs-acoes {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-reset, .btn-deletar {
    background: #667eea;
    padding: 8px 12px;
    font-size: 12px;
    width: auto;
    white-space: nowrap;
}

.btn-deletar {
    background: #dc3545;
}

.btn-deletar:hover:not(:disabled) {
    background: #c82333;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: auto;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
}

.modal-footer button {
    flex: 1;
    padding: 10px;
    font-size: 13px;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Responsivo */
@media (max-width: 600px) {
    .container-admin {
        padding: 20px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .admin-header h2 {
        margin-bottom: 8px;
    }

    .btn-logout {
        width: 100%;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card-large {
        grid-column: span 2;
    }

    .grafico-barras {
        height: 150px;
    }

    .barra-valor {
        top: -20px;
        font-size: 11px;
    }

    .barra-label {
        font-size: 11px;
    }

    .observador-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-reset {
        width: 100%;
        margin-left: 0;
    }
}
