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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 50%, #01579b 100%) no-repeat center center fixed;
    min-height: 100vh;
}

.container {
    min-height: 100vh;
}

/* Pantallas */
.pantalla {
    display: none;
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 40px;
}

.pantalla.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* LOGIN */
#login {
    display: none;
    justify-content: center;
    align-items: center;
}

#login.active {
    display: flex;
}

.login-box {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 450px;
    width: 100%;
}

.logo-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.logo h1 {
    color: #1a237e;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.logo p {
    color: #666;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a237e;
}

.btn-primary {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(26, 35, 126, 0.4);
}

.btn-grande {
    width: 100%;
    padding: 18px;
    font-size: 1.2rem;
}

.btn-secondary {
    background: #78909c;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #546e7a;
}

.btn-danger {
    background: #c62828;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
}

.btn-danger:hover {
    background: #b71c1c;
}

.mensaje-error {
    color: #c62828;
    margin-top: 15px;
    font-weight: 500;
}

.link-admin {
    margin-top: 30px;
}

.link-admin a {
    color: #78909c;
    text-decoration: none;
    font-size: 0.9rem;
}

.link-admin a:hover {
    color: #1a237e;
}

/* VOTACION */
.header-votacion {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.header-votacion h2 {
    color: #1a237e;
    margin-bottom: 10px;
}

.saludo {
    color: #0d47a1;
    font-size: 1.3rem;
}

.saludo strong {
    color: #1a237e;
}

.contenido-votacion {
    max-width: 1200px;
    margin: 0 auto;
}

.instrucciones {
    background: #fff3e0;
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #ff9800;
}

.instrucciones p {
    color: #e65100;
    font-weight: 500;
}

.boletas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.boleta-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.boleta-card h3 {
    color: #1a237e;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e3f2fd;
}

.lista-opciones {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.opcion-candidato {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.opcion-candidato:hover {
    border-color: #1a237e;
    background: #e8eaf6;
}

.opcion-candidato.selected {
    border-color: #1a237e;
    background: #c5cae9;
}

.opcion-candidato input[type="radio"] {
    width: 22px;
    height: 22px;
    margin-right: 15px;
    accent-color: #1a237e;
}

.opcion-candidato .info-candidato {
    flex: 1;
}

.opcion-candidato .nombre {
    font-weight: 600;
    color: #1a237e;
    font-size: 1.1rem;
}

.opcion-candidato .propuesta {
    color: #666;
    font-size: 0.9rem;
    margin-top: 3px;
}

.opcion-blanco {
    border-style: dashed;
    background: #fafafa;
}

.acciones-voto {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* CONFIRMACION */
#confirmacion {
    display: none;
    justify-content: center;
    align-items: center;
}

#confirmacion.active {
    display: flex;
}

.confirmacion-box {
    background: white;
    padding: 60px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.icono-exito {
    font-size: 5rem;
    margin-bottom: 20px;
}

.confirmacion-box h2 {
    color: #2e7d32;
    font-size: 2rem;
    margin-bottom: 15px;
}

.confirmacion-box p {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.mensaje-secundario {
    color: #666 !important;
}

.confirmacion-box .btn-primary {
    margin-top: 25px;
}

/* ADMIN */
.header-admin {
    background: white;
    padding: 15px 25px;
    border-radius: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.header-admin h2 {
    color: #1a237e;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.header-admin .btn-secondary {
    padding: 8px 20px;
    font-size: 0.9rem;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.tab-btn {
    background: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #1a237e;
    color: white;
}

.tab-content {
    display: none;
    background: transparent;
    padding: 0;
    margin: 0 auto;
}

.tab-content.active {
    display: block;
}

.form-candidato-container {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 450px;
    margin: 0 auto;
}

.form-candidato-container h3 {
    color: #1a237e;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.5rem;
}

.form-candidato-container .form-group {
    margin-bottom: 18px;
}

.form-candidato-container .form-group label {
    font-size: 0.95rem;
}

.form-candidato-container .form-group input,
.form-candidato-container .form-group select {
    padding: 14px;
    font-size: 1rem;
}

.form-candidato-container .btn-primary {
    width: 100%;
    margin-top: 15px;
    padding: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.listas-candidatos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.lista-column h4 {
    color: #1a237e;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e3f2fd;
}

.lista-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.candidato-card {
    background: #f5f5f5;
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.candidato-card .info h5 {
    color: #1a237e;
    margin-bottom: 3px;
}

.candidato-card .info p {
    color: #666;
    font-size: 0.9rem;
}

.btn-eliminar {
    background: #ef5350;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
}

.btn-eliminar:hover {
    background: #c62828;
}

/* Fotos candidatos */
.preview-foto {
    margin-top: 10px;
}

.preview-foto img {
    max-width: 120px;
    max-height: 120px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.candidato-card .foto-candidato {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid #1a237e;
}

.candidato-card {
    display: flex;
    align-items: center;
}

.candidato-card .foto-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.8rem;
    color: #1a237e;
    flex-shrink: 0;
}

.candidato-card .info {
    flex: 1;
}

.opcion-candidato .foto-candidato {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid #1a237e;
}

.opcion-candidato .foto-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.5rem;
    color: #1a237e;
}

/* Resultados */
.estadisticas-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.stat-box {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    color: white;
    padding: 15px 10px;
    border-radius: 10px;
    text-align: center;
}

.stat-numero {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 3px;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

.resultados-container {
    display: grid;
    grid-template-columns: repeat(3, 290px);
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
}

.resultado-cargo h4 {
    color: #1a237e;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.barras-resultado {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.barra-item {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
}

.barra-item.ganador {
    background: #e8f5e9;
    border: 2px solid #4caf50;
}

.barra-item .nombre-votos {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.foto-resultado {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.foto-resultado-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.barra-item .nombre {
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
    flex: 1;
}

.barra-item .votos {
    color: #1a237e;
    font-weight: bold;
    font-size: 0.8rem;
}

.barra-item .barra {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.barra-item .barra-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a237e, #0d47a1);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.barra-item.ganador .barra-fill {
    background: linear-gradient(90deg, #2e7d32, #4caf50);
}

.acciones-admin {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.acciones-admin button {
    padding: 10px 20px;
    font-size: 0.85rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    color: #1a237e;
    margin-bottom: 25px;
}

.modal-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* SELECCION DE CARGO */
#seleccion-cargo {
    display: none;
    justify-content: center;
    align-items: center;
}

#seleccion-cargo.active {
    display: flex;
}

.seleccion-box {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.seleccion-box h2 {
    color: #1a237e;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.instruccion-seleccion {
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.botones-cargo {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn-cargo {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    color: white;
    border: none;
    padding: 40px 50px;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    min-width: 200px;
}

.btn-cargo:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(26, 35, 126, 0.4);
}

.btn-cargo:disabled,
.btn-cargo.btn-votado {
    background: #9e9e9e;
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

.btn-cargo .icono-cargo {
    font-size: 4rem;
}

.btn-cargo .texto-cargo {
    font-size: 1.4rem;
    font-weight: 600;
}

.btn-contralor {
    background: linear-gradient(135deg, #00695c, #00897b);
}

.btn-contralor:hover {
    box-shadow: 0 15px 40px rgba(0, 105, 92, 0.4);
}

.btn-consejo {
    background: linear-gradient(135deg, #4527a0, #7b1fa2);
}

.btn-consejo:hover {
    box-shadow: 0 15px 40px rgba(69, 39, 160, 0.4);
}

.btn-personero {
    background: linear-gradient(135deg, #c62828, #e53935);
}

.btn-personero:hover {
    box-shadow: 0 15px 40px rgba(198, 40, 40, 0.4);
}

.botones-ver-candidatos {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-ver-lista {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-ver-lista:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.lista-candidatos-admin {
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin: 20px auto 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 450px;
    max-width: 95vw;
}

.lista-candidatos-admin .header-lista {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.lista-candidatos-admin .header-lista h3 {
    color: #1a237e;
    margin: 0;
}

.btn-cerrar {
    background: #e53935;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

/* MODAL BIENVENIDA */
.modal-bienvenida {
    padding: 50px 40px;
}

.icono-bienvenida {
    font-size: 5rem;
    margin-bottom: 20px;
}

.modal-bienvenida h3 {
    color: #1a237e;
    font-size: 2rem;
    margin-bottom: 15px;
}

.nombre-estudiante {
    color: #0d47a1;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
}

.modal-bienvenida .btn-primary {
    padding: 15px 50px;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 600px) {
    .login-box {
        padding: 30px 20px;
    }

    .boletas-grid {
        grid-template-columns: 1fr;
    }

    .header-admin {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .admin-tabs {
        flex-direction: column;
    }

    .acciones-voto,
    .acciones-admin {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .seleccion-box {
        padding: 30px 20px;
    }

    .botones-cargo {
        flex-direction: column;
        gap: 20px;
    }

    .btn-cargo {
        padding: 30px 40px;
        min-width: auto;
        width: 100%;
    }

    .btn-cargo .icono-cargo {
        font-size: 3rem;
    }

    .btn-cargo .texto-cargo {
        font-size: 1.2rem;
    }
}
