* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0b3d2e, #0f766e, #111827);
    color: white;
}

.login-container,
.panel-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card,
.panel-card {
    width: 100%;
    background: rgba(8, 32, 28, 0.92);
    border: 2px solid rgba(74, 222, 128, 0.4);
    border-radius: 25px;
    padding: 35px;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.25);
    text-align: center;
}

.login-card {
    max-width: 430px;
}

.panel-card {
    max-width: 750px;
}

.login-card h1,
.panel-card h1 {
    color: #86efac;
    margin-bottom: 10px;
    font-size: clamp(28px, 5vw, 40px);
}

.login-card p,
.subtitulo {
    color: #a7f3d0;
    margin-bottom: 25px;
}

input {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border-radius: 12px;
    border: none;
    outline: none;
    background: #ecfdf5;
    color: #064e3b;
    font-size: 16px;
}

.login-card button {
    width: 100%;
    padding: 14px;
    margin-top: 15px;
    border: none;
    border-radius: 12px;
    background: #22c55e;
    color: white;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
}

#mensajeError {
    margin-top: 15px;
    color: #f87171;
}

.oculto {
    display: none;
}

.control {
    margin: 20px 0;
    padding: 18px;
    background: rgba(15, 118, 110, 0.3);
    border: 1px solid rgba(94, 234, 212, 0.4);
    border-radius: 18px;
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 15px;
}

.control h2 {
    text-align: left;
    font-size: clamp(18px, 4vw, 24px);
}

.luz {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 12px currentColor;
}

.roja {
    background: red;
    color: red;
}

.verde {
    background: #22c55e;
    color: #22c55e;
}

.switch {
    position: relative;
    width: 82px;
    height: 42px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #991b1b;
    border-radius: 40px;
    transition: 0.3s;
    border: 3px solid #111;
}

.slider::before {
    content: "";
    position: absolute;
    width: 32px;
    height: 32px;
    left: 4px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.switch input:checked + .slider {
    background: #16a34a;
}

.switch input:checked + .slider::before {
    transform: translateX(38px);
}

.capacidad-box {
    margin: 20px 0;
    padding: 20px;
    background: rgba(6, 78, 59, 0.8);
    border-radius: 18px;
    border: 1px solid #34d399;
}

.capacidad-box h2 {
    margin-bottom: 15px;
}

.barra {
    width: 100%;
    height: 35px;
    background: #1f2937;
    border-radius: 20px;
    overflow: hidden;
}

.barra-interna {
    width: 65%;
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #facc15);
    color: #111827;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
}

.alerta {
    margin: 20px 0;
    padding: 15px;
    background: rgba(220, 38, 38, 0.25);
    border: 2px solid #ef4444;
    border-radius: 15px;
    color: #fecaca;
    font-weight: bold;
    animation: parpadeo 1s infinite;
}

@keyframes parpadeo {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.25;
    }
}

.boton-normal,
.boton-peligro,
.cerrar {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

.boton-normal {
    background: #0ea5e9;
}

.boton-peligro {
    background: #dc2626;
}

.cerrar {
    margin-top: 20px;
    background: #374151;
}

@media (max-width: 600px) {
    .login-card,
    .panel-card {
        padding: 25px 18px;
        border-radius: 20px;
    }

    .control {
        grid-template-columns: 32px 1fr;
        gap: 12px;
    }

    .control button,
    .switch {
        grid-column: 2;
        justify-self: start;
    }

    .luz {
        width: 24px;
        height: 24px;
    }
}