* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: #e2e8ff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.container {
    display: flex;
    flex-direction: row;
    width: 55%;
    max-width: 90rem;
    height: 50%;
    max-height: 40rem;
    box-shadow: 0 0.3rem 1.5rem rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    overflow: hidden;
    background-color: white;
    transition: all 0.3s ease;
}

/* Lado izquierdo */
.left {
    flex: 1;
    background-color: #4f7cff;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

.left img {
    width: 60%;
    max-width: 220px;
    margin-bottom: -2rem;
}

.left h2 {
    font-size: 2rem;
    margin-bottom: -1rem;
}

.left h1 {
    font-size: 2.5rem;
    font-weight: 600;
}

/* Lado derecho */
.right {
    flex: 1;
    padding: 2.5rem;
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%; /* asegura que no colapse */
    width: 100%;
    overflow-y: auto;
}


/* Título */
.right h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Grupo de inputs */
.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    border: 0.15rem solid #4f7cff;
    border-radius: 0.625rem;
    font-size: 1rem;
    outline: none;
}

.input-group i,
.input-group .icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #4f7cff;
    cursor: pointer;
}

/* Botón */
button {
    width: 100%;
    padding: 0.75rem;
    background-color: #4f7cff;
    color: white;
    border: none;
    border-radius: 0.625rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

button:hover {
    background-color: #3f67e0;
    transform: scale(1.05);
}

/* Olvidé contraseña */
.forgot {
    text-align: right;
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.forgot a {
    text-decoration: none;
    color: #666;
}

.forgot a:hover {
    text-decoration: underline;
    color: #4f7cff;
}

/* Validación */
.input-group input.valid {
    border-color: #28a745;
}

.input-group input.invalid {
    border-color: #dc3545;
}

.error-msg {
    display: none;
    font-size: 0.75rem;
    color: #dc3545;
    margin-top: 0.25rem;
    padding-left: 0.25rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .container {
        width: 70%;
        height: auto;
        flex-direction: column;
    }

    .left,
    .right {
        width: 100%;
        padding: 2rem;
    }

    .left img {
        width: 50%;
    }

    .left h1 {
        font-size: 2rem;
    }

    .left h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .container {
        width: 90%;
        height: auto;
        flex-direction: column;
    }

    .left,
    .right {
        width: 100%;
        padding: 1.5rem;
        min-height: auto;
    }

    .right {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .left img {
        width: 50%;
    }

    .left h1 {
        font-size: 1.75rem;
    }

    .left h2 {
        font-size: 1.25rem;
    }

    .right h2 {
        font-size: 1.25rem;
    }
}


@media (max-width: 480px) {
    .left h1 {
        font-size: 1.5rem;
    }

    .container {
        width: 90%;
        height: auto;
        flex-direction: column;
    }

    .left h2 {
        font-size: 1rem;
    }

    .input-group input {
        font-size: 0.9rem;
    }

    button {
        font-size: 0.9rem;
    }
}
@media (max-height: 700px) {
    .container {
        height: 60%;
    }
}
@media (max-height: 600px) {
    .container {
        height: 70%;
    }
}
@media (max-height: 500px) {
    .container {
        height: 85%;
    }
}