* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;

    /* Fondo alegre y moderno */
    background: linear-gradient(135deg, #dff6ff, #e8f8f5);

    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;
}

.contenedor-login {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login {
    background: #ffffff;

    padding: 35px;

    border-radius: 18px;

    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);

    border-top: 5px solid #20b8a6;
}

.encabezado {
    text-align: center;
    margin-bottom: 30px;
}

.encabezado h1 {
    font-size: 40px;
    font-weight: 800;

    color: #168aad;

    margin-bottom: 8px;
}

.encabezado p {
    color: #64748b;
    font-size: 14px;
}

/* Campos */

.campo {
    margin-bottom: 20px;
}

.campo label {
    display: block;

    margin-bottom: 7px;

    color: #1e293b;

    font-weight: bold;
    font-size: 16px;
    font-weight: 700;

    transition: color 0.2s ease;
}

.campo input {
    width: 100%;

    padding: 13px;

    border: 2px solid #dbe4ea;

    border-radius: 9px;

    background: #f8fafc;

    color: #334155;

    font-size: 17px;
    font-weight: 500;

    outline: none;

    transition: all 0.25s ease;
}

/* Campo seleccionado */

.campo input:focus {
    border-color: #20b8a6;

    background: #ffffff;

    box-shadow: 0 0 0 4px rgba(32, 184, 166, 0.15);

    transform: translateY(-1px);
}

/* Etiqueta del campo seleccionado */

.campo:focus-within label {
    color: #168aad;
}

/* Botón */

.boton {
    width: 100%;

    padding: 14px;

    border: none;

    border-radius: 9px;

    background: linear-gradient(135deg, #168aad, #20b8a6);

    color: white;

    font-size: 18px;

    font-weight: bold;

    cursor: pointer;

    transition: all 0.25s ease;
}

.boton:hover {
    transform: translateY(-2px);

    box-shadow: 0 7px 18px rgba(22, 138, 173, 0.30);
}

.boton:active {
    transform: translateY(0);
}

/* Pie */

.pie {
    text-align: center;

    margin-top: 25px;

    color: #475569;

    font-size: 15px;
    font-weight: 600;
}


/* ==========================================
   ANIMACIÓN DE ACCESO DENEGADO
   ========================================== */

.pantalla-error {
    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    z-index: 9999;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;

    background: #168aad;

    animation: aparecerError 0.2s ease forwards;
}


/* ==========================================
   PUERTAS DE CIERRE
   ========================================== */

.puerta {
    position: absolute;

    top: 0;

    width: 50%;
    height: 100%;

    background: linear-gradient(
        135deg,
        #168aad,
        #20b8a6
    );

    z-index: 1;
}


.puerta-izquierda {
    left: 0;

    animation: cerrarIzquierda 1.2s ease-in forwards;
}


.puerta-derecha {
    right: 0;

    animation: cerrarDerecha 1.2s ease-in forwards;
}


/* ==========================================
   MENSAJE DE ACCESO DENEGADO
   ========================================== */

.mensaje-error {
    position: relative;

    z-index: 2;

    text-align: center;

    color: white;

    opacity: 0;

    animation: mostrarMensaje 0.5s ease forwards;

    animation-delay: 1s;
}


.candado {
    font-size: 65px;

    margin-bottom: 15px;

    animation: aparecerCandado 0.5s ease forwards;

    animation-delay: 1s;
}


.mensaje-error h1 {
    font-size: 28px;

    margin-bottom: 8px;
}


.mensaje-error p {
    font-size: 15px;

    opacity: 0.9;
}


/* ==========================================
   DESAPARECER PANTALLA DE ERROR
   ========================================== */

.pantalla-error.ocultar {
    animation: desaparecerError 0.5s ease forwards;
}


/* ==========================================
   ANIMACIÓN DE ACCESO AUTORIZADO
   ========================================== */

.pantalla-exito {
    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    z-index: 10000;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;

    background: #168aad;

    animation: aparecerExito 0.3s ease forwards;
}


/* ==========================================
   CORTINAS
   ========================================== */

.cortina {
    position: absolute;

    top: 0;

    width: 50%;
    height: 100%;

    background: linear-gradient(
        135deg,
        #168aad,
        #20b8a6
    );

    z-index: 1;

    transition: transform 1.5s ease-in-out;
}


/* Cortina izquierda */

.cortina-izquierda {
    left: 0;

    transform: translateX(0);
}


/* Cortina derecha */

.cortina-derecha {
    right: 0;

    transform: translateX(0);
}


/* ==========================================
   ABRIR CORTINAS
   ========================================== */

.pantalla-exito.abrir .cortina-izquierda {
    transform: translateX(-100%);
}


.pantalla-exito.abrir .cortina-derecha {
    transform: translateX(100%);
}


/* ==========================================
   MENSAJE DE ACCESO AUTORIZADO
   ========================================== */

.mensaje-exito {
    position: relative;

    z-index: 2;

    text-align: center;

    color: white;

    opacity: 0;

    transform: scale(0.7);

    animation: mostrarExito 0.7s ease forwards;

    animation-delay: 0.4s;
}


/* ==========================================
   CANDADO ABIERTO
   ========================================== */

.candado-abierto {
    font-size: 70px;

    margin-bottom: 15px;

    animation: aparecerCandadoAbierto 0.7s ease forwards;

    animation-delay: 0.5s;
}


/* ==========================================
   TÍTULO DE ACCESO AUTORIZADO
   ========================================== */

.mensaje-exito h1 {
    font-size: 32px;

    font-weight: 800;

    margin-bottom: 10px;

    letter-spacing: 0.3px;
}


/* ==========================================
   TEXTO DE CREDENCIALES
   ========================================== */

.mensaje-exito p {
    font-size: 18px;

    font-weight: 600;

    opacity: 0.95;
}


/* ==========================================
   ANIMACIONES DE ACCESO DENEGADO
   ========================================== */

@keyframes aparecerError {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }

}


@keyframes cerrarIzquierda {

    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(0);
    }

}


@keyframes cerrarDerecha {

    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(0);
    }

}


@keyframes mostrarMensaje {

    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }

}


@keyframes aparecerCandado {

    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }

}


@keyframes desaparecerError {

    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        visibility: hidden;
    }

}


/* ==========================================
   ANIMACIONES DE ACCESO AUTORIZADO
   ========================================== */

@keyframes aparecerExito {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }

}


@keyframes mostrarExito {

    0% {
        opacity: 0;
        transform: scale(0.7);
    }

    70% {
        opacity: 1;
        transform: scale(1.08);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }

}


@keyframes aparecerCandadoAbierto {

    0% {
        opacity: 0;
        transform: scale(0.4) rotate(-15deg);
    }

    60% {
        opacity: 1;
        transform: scale(1.15) rotate(5deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

}

