body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', sans-serif;
    position: relative;
    /* NO pongas fondo aquí porque usas .background-img */
}

.background-img {
    position: fixed;
    left: 0; top: 0; width: 100vw; height: 100vh;
    background: url('../img/fondo-login.jpg') no-repeat center center fixed;
    background-size: cover;
    z-index: 0;
}
.background-img::after {
    content: "";
    position: absolute;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(37, 18, 85, 0.65); /* Sombra oscura sobre el fondo */
    z-index: 1;
    pointer-events: none;
}

.login-container, .login-box {
    position: relative;
    z-index: 2;
}

.login-container {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: rgba(255,255,255,0.97);
    border-radius: 18px;
    box-shadow: 0 0 24px 3px #7c4dff50;
    padding: 42px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 350px;
    max-width: 92vw;
    transition: box-shadow 0.25s;
    will-change: transform;
}
.login-box:hover {
    box-shadow: 0 8px 32px 7px #7c4dff90;
    transform: translateY(-4px) scale(1.03);
}

.login-logo {
    width: 90px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 18px #7c4dff66);
}

.login-box h2 {
    color: #6d34e7;
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 25px;
    letter-spacing: 0.04em;
    text-align: center;
}
.login-box h2 .highlight {
    color: #2a185c;
}

.login-error {
    color: #fff;
    background: #eb5757;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 18px;
    text-align: center;
    font-weight: 500;
    font-size: 1em;
}

.login-box form {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* CORREGIDO: incluye text, email y password */
.login-box input[type="text"],
.login-box input[type="email"],
.login-box input[type="password"] {
    padding: 10px 14px;
    margin-bottom: 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    background: #fafaffcc;
    transition: border 0.2s, box-shadow 0.2s;
}
.login-box input:focus {
    outline: none;
    border-color: #7c4dff;
    box-shadow: 0 0 0 2px #c3a9f6bb;
}

.login-box button {
    background: linear-gradient(90deg, #6d34e7 0%, #8a4cfb 100%);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 11px 0;
    font-size: 1.13em;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s, box-shadow 0.22s;
    box-shadow: 0 2px 6px #beafff30;
}
.login-box button:hover {
    background: linear-gradient(90deg, #5633b0 0%, #a88ff0 100%);
    box-shadow: 0 5px 20px #a288e899;
    letter-spacing: 0.04em;
}

.register-link {
    margin-top: 12px;
    text-align: center;
}
.register-link a {
    color: #6d34e7;
    font-size: 0.97em;
    text-decoration: none;
    transition: color 0.2s;
}
.register-link a:hover {
    color: #4f259d;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 500px) {
    .login-box {
        width: 98vw;
        padding: 18px 7vw;
    }
    .login-logo {
        width: 65px;
    }
    .login-box h2 {
        font-size: 1.5em;
    }
}
