* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: #0f172a;
    color: #e2e8f0;
}

/* ===== LOGIN ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: #1e293b;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #334155;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #38bdf8;
    font-size: 28px;
}

.alert-error {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid #ef4444;
    color: #fecaca;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.campo {
    margin-bottom: 20px;
}

.campo label {
    display: block;
    color: #94a3b8;
    margin-bottom: 8px;
    font-weight: 500;
}

.campo input, .campo select, .campo textarea {
    width: 100%;
    padding: 12px;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 10px;
    color: white;
    font-size: 16px;
}

.campo input:focus, .campo select:focus {
    border-color: #38bdf8;
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: #38bdf8;
    color: #0f172a;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}

.btn-login:hover {
    background: #0284c7;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.contenedor {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.header {
    grid-column: 1 / -1;
    background: #1e293b;
    padding: 20px 25px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #334155;
}

.header h1 {
    color: white;
    font-size: 24px;
}

.header h1 span {
    color: #38bdf8;
}

/* ===== TARJETAS ===== */
.card {
    background: #1e293b;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #334155;
    margin-bottom: 20px;
}

.card h2 {
    color: white;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #38bdf8;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== BOTONES ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: #38bdf8;
    color: #0f172a;
}

.btn-success {
    background: #4ade80;
    color: #0f172a;
}

.btn-danger {
    background: #f87171;
    color: #0f172a;
}

.btn-warning {
    background: #fbbf24;
    color: #0f172a;
}

/* ===== OPCIONES ADMIN ===== */
.opcion-admin {
    background: #0f172a;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid #334155;
}

.opcion-admin form {
    display: flex;
    gap: 10px;
    flex: 1;
}

.opcion-admin input {
    flex: 1;
    padding: 10px;
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 8px;
    color: white;
}

/* ===== PARTICIPANTES ===== */
.participante {
    background: #0f172a;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #334155;
}

.participante-numero {
    background: #38bdf8;
    color: #0f172a;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.participante-info {
    flex: 1;
}

.participante-nombre {
    font-weight: bold;
    color: white;
    font-size: 16px;
}

.participante-detalle {
    display: flex;
    gap: 15px;
    color: #94a3b8;
    font-size: 14px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.participante-voto {
    background: #38bdf8;
    color: #0f172a;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
}

/* ===== RESULTADOS ===== */
.resultado-item {
    margin-bottom: 15px;
}

.resultado-header {
    display: flex;
    justify-content: space-between;
    color: #94a3b8;
    margin-bottom: 5px;
}

.barra {
    width: 100%;
    height: 25px;
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden;
}

.barra-lleno {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #0284c7);
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    font-weight: bold;
    font-size: 12px;
    transition: width 0.3s;
}

.total-votos {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #0f172a;
    border-radius: 10px;
    font-weight: bold;
    font-size: 18px;
}

/* ===== MODALES ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1e293b;
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    border: 1px solid #38bdf8;
}

.modal-content h2 {
    color: white;
    margin-bottom: 20px;
}

/* ===== CELULARES (SIN ZOOM, SIN DESBORDE) ===== */
@media screen and (max-width: 768px) {
    /* Evitar zoom y desborde */
    body {
        overflow-x: hidden;
        width: 100%;
    }

    .contenedor {
        width: 100%;
        max-width: 100%;
        padding: 10px;
        margin: 0;
        grid-template-columns: 1fr;
        overflow-x: hidden;
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 15px !important;
        width: 100%;
    }

    .header h1 {
        font-size: 22px !important;
    }

    .card {
        padding: 15px !important;
        width: 100%;
    }

    .card h2 {
        font-size: 18px !important;
    }

    .btn, button, .btn-login, .btn-consultar {
        width: 100%;
        margin: 5px 0;
        font-size: 15px !important;
        padding: 12px !important;
    }

    .campo input, .campo select, .campo textarea {
        font-size: 16px !important;
        padding: 12px !important;
        width: 100%;
    }

    .participante {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .participante span {
        font-size: 15px !important;
    }

    .participante-numero {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }

    .participante-voto {
        font-size: 14px !important;
        padding: 6px 16px !important;
    }

    .resultado-header span {
        font-size: 14px !important;
    }

    .total-votos {
        font-size: 18px !important;
    }

    .info-pagina {
        font-size: 14px !important;
    }

    .paginacion a, .paginacion span {
        font-size: 14px !important;
        padding: 8px 12px !important;
    }

    .opcion-admin {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .opcion-admin form {
        width: 100%;
        flex-direction: column;
    }

    .opcion-admin input {
        width: 100%;
    }

    .opcion-admin button {
        width: 100%;
    }
}

/* ===== CELULARES PEQUEÑOS ===== */
@media screen and (max-width: 480px) {
    .header h1 {
        font-size: 20px !important;
    }

    .card h2 {
        font-size: 16px !important;
    }

    .btn, button {
        font-size: 14px !important;
        padding: 10px !important;
    }

    .participante span {
        font-size: 14px !important;
    }

    .participante-numero {
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
    }

    .total-votos {
        font-size: 16px !important;
    }
}

/* ===== MENSAJES FLOTANTES ===== */
.mensaje-exito, .mensaje-error {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    grid-column: 1 / -1;
    animation: slideDown 0.5s ease;
}

.mensaje-exito {
    background: #10b981;
    color: white;
    border-left: 6px solid #059669;
}

.mensaje-error {
    background: #ef4444;
    color: white;
    border-left: 6px solid #dc2626;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #a7f3d0;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}