﻿* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #009F48;
}


/* =========================================================
   PÁGINA
   ========================================================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}


/* =========================================================
   TARJETA PRINCIPAL
   ========================================================= */

.login-card {
    width: 100%;
    max-width: 540px;
    background-color: #ffffff;
    padding: 50px 55px 55px 55px;
    border-radius: 22px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   LOGO
   ========================================================= */

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 48px;
}

.logo {
    width: 220px;
    max-width: 70%;
    height: auto;
    object-fit: contain;
}


/* =========================================================
   FORMULARIO
   ========================================================= */

#formLogin {
    width: 100%;
}

.campo {
    margin-bottom: 32px;
}

    .campo label {
        display: block;
        margin-bottom: 12px;
        font-size: 18px;
        font-weight: 400;
        color: #666666;
    }

    .campo input {
        width: 100%;
        padding: 0 4px 11px 4px;
        border: none;
        border-bottom: 1px solid #bdbdbd;
        background-color: transparent;
        outline: none;
        font-size: 18px;
        color: #111111;
    }

        .campo input:focus {
            border-bottom: 2px solid #009F48;
        }


/* =========================================================
   MENSAJE DE ERROR
   ========================================================= */

/*
   Cuando no hay ningún error, el mensaje queda completamente
   oculto y no ocupa espacio en el formulario.
*/
.mensaje-error {
    display: none;
}


    /*
   JavaScript agrega la clase "visible" cuando hay que
   mostrar un mensaje al usuario.
*/
    .mensaje-error.visible {
        position: relative;
        width: 100%;
        min-height: 58px;
        display: flex;
        align-items: center;
        margin-top: -5px;
        margin-bottom: 20px;
        padding: 14px 16px 14px 54px;
        border: 1px solid #ef5350;
        border-radius: 10px;
        background-color: #ffebee;
        color: #d71920;
        font-size: 15px;
        font-weight: 600;
        line-height: 21px;
        text-align: left;
        box-shadow: 0 4px 12px rgba(215, 25, 32, 0.18);
    }


        /* Círculo rojo con signo de admiración */

        .mensaje-error.visible::before {
            content: "!";
            position: absolute;
            left: 16px;
            top: 50%;
            width: 27px;
            height: 27px;
            display: flex;
            align-items: center;
            justify-content: center;
            transform: translateY(-50%);
            border-radius: 50%;
            background-color: #e60000;
            color: #ffffff;
            font-size: 19px;
            font-weight: 700;
        }


/* =========================================================
   BOTÓN INGRESAR
   ========================================================= */

#btnIngresar {
    width: 100%;
    height: 56px;
    margin-top: 0;
    border: none;
    border-radius: 8px;
    background-color: #009F48;
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.10s ease, opacity 0.15s ease;
}

    #btnIngresar:hover {
        background-color: #2f9f75;
    }

    #btnIngresar:active {
        transform: scale(0.99);
    }

    #btnIngresar:disabled {
        opacity: 0.65;
        cursor: default;
    }


/* =========================================================
   TABLETS
   ========================================================= */

@media (max-width: 768px) {

    .login-page {
        padding: 18px;
    }

    .login-card {
        max-width: 480px;
        padding: 44px 40px 48px 40px;
    }

    .logo {
        width: 190px;
    }
}


/* =========================================================
   CELULARES
   ========================================================= */

@media (max-width: 480px) {

    .login-page {
        padding: 14px;
        align-items: center;
    }

    .login-card {
        width: 100%;
        max-width: 380px;
        padding: 38px 24px 42px 24px;
        border-radius: 20px;
        /* Sube la tarjeta ligeramente en la pantalla */
        transform: translateY(-10vh);
    }


    /* Logo */

    .logo-container {
        margin-bottom: 38px;
    }

    .logo {
        width: 155px;
        max-width: 65%;
    }


    /* Campos */

    .campo {
        margin-bottom: 27px;
    }

        .campo label {
            margin-bottom: 10px;
            font-size: 16px;
        }

        .campo input {
            padding-bottom: 10px;
            font-size: 16px;
        }


    /* Mensaje de error */

    .mensaje-error.visible {
        min-height: 54px;
        padding: 12px 12px 12px 47px;
        margin-top: -4px;
        margin-bottom: 18px;
        font-size: 14px;
        line-height: 19px;
    }

        .mensaje-error.visible::before {
            left: 13px;
            width: 25px;
            height: 25px;
            font-size: 17px;
        }


    /* Botón */

    #btnIngresar {
        height: 52px;
        font-size: 16px;
    }
}


/* =========================================================
   CELULARES PEQUEÑOS
   ========================================================= */

@media (max-width: 340px) {

    .login-page {
        padding: 10px;
    }

    .login-card {
        padding: 30px 18px 34px 18px;
        border-radius: 16px;
    }

    .logo {
        width: 135px;
    }

    .mensaje-error.visible {
        padding-left: 44px;
        font-size: 13px;
    }

        .mensaje-error.visible::before {
            left: 12px;
            width: 23px;
            height: 23px;
            font-size: 16px;
        }
}
