/* =========================================================
   LOGIN
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: #f1f3f6;

    font-family: Arial, Helvetica, sans-serif;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px;
}


/* =========================================================
   CONTENEDOR PRINCIPAL
   ========================================================= */

.login-container {
    width: 100%;
    max-width: 1335px;
    height: 915px;

    background: #ffffff;

    border-radius: 20px;

    overflow: hidden;

    display: flex;

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   PARTE IZQUIERDA
   ========================================================= */

.login-image {
    position: relative;

    width: 50%;
    height: 100%;

    background-image: url("/images/login.png");

    background-size: cover;
    background-position: center;

    color: white;
}


/* Oscurecemos la imagen */

.image-overlay {
    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.00),
            rgba(0, 0, 0, 0.03) 60%,
            rgba(0, 0, 0, 0.20)
        );
}


/* =========================================================
   LOGO
   ========================================================= */

.brand {
    position: absolute;

    top: 38px;
    left: 48px;

    display: flex;
    align-items: center;

    z-index: 2;
}

.brand-logo {
    width: 42px;
    height: 54px;

    margin-right: 14px;

    color: #16a34a;

    font-size: 62px;
    font-weight: 900;
    line-height: 42px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    color: #16a34a;

    font-size: 29px;
    font-weight: 700;

    line-height: 29px;
}

.brand-subtitle {
    color: white;

    font-size: 15px;
    font-weight: 600;

    margin-top: 3px;
}


/* =========================================================
   TEXTO DE LA IMAGEN
   ========================================================= */

.image-content {
    position: absolute;

    left: 48px;
    bottom: 75px;

    z-index: 2;

    display: flex;
    align-items: flex-start;
}

.content-line {
    width: 3px;
    height: 69px;

    background: #16a34a;

    margin-right: 25px;
    margin-top: 4px;
}

.image-content h2 {
    font-size: 32px;
    line-height: 1.2;

    font-weight: 700;
}

.image-content h2 span {
    color: #16a34a;
}

.image-content p {
    margin-top: 28px;

    font-size: 16px;
    line-height: 1.8;

    color: rgba(255, 255, 255, 0.85);
}


/* =========================================================
   PARTE DERECHA
   ========================================================= */

.login-form-container {
    width: 50%;
    height: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.login-form {
    width: 100%;
    max-width: 470px;
}


/* =========================================================
   BIENVENIDA
   ========================================================= */

.welcome {
    margin-bottom: 42px;
}

.welcome h1 {
    color: #111827;

    font-size: 36px;
    line-height: 1.2;

    font-weight: 700;
}

.welcome h1 span {
    color: #159447;
}

.welcome p {
    margin-top: 14px;

    color: #7b8190;

    font-size: 17px;
}


/* =========================================================
   CAMPOS
   ========================================================= */

.form-group {
    margin-bottom: 27px;
}

.form-group label {
    display: block;

    margin-bottom: 11px;

    color: #171b24;

    font-size: 15px;
    font-weight: 700;
}

.input-container {
    position: relative;

    width: 100%;
}

.input-container input {
    width: 100%;
    height: 58px;

    border: 1px solid #dfe2e7;
    border-radius: 12px;

    background: white;

    padding: 0 48px 0 66px;

    color: #20242c;

    font-size: 16px;

    outline: none;

    transition: all 0.2s ease;
}

.input-container input::placeholder {
    color: #9ca1aa;
}

.input-container input:focus {
    border-color: #16a34a;

    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.10);
}


/* =========================================================
   ICONOS
   ========================================================= */

.input-icon {
    position: absolute;

    left: 20px;
    top: 50%;

    transform: translateY(-50%);

    width: 21px;
    height: 21px;

    color: #159447;

    z-index: 1;
}


/* =========================================================
   MOSTRAR CONTRASEÑA
   ========================================================= */

.password-toggle {
    position: absolute;

    right: 18px;
    top: 50%;

    transform: translateY(-50%);

    width: 22px;
    height: 22px;

    padding: 0;

    border: none;
    background: transparent;

    color: #737985;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle svg {
    width: 20px;
    height: 20px;

    display: block;
}


/* =========================================================
   OPCIONES
   ========================================================= */

.form-options {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-top: 5px;
    margin-bottom: 34px;
}

.remember {
    display: flex;

    align-items: center;
    gap: 10px;

    color: #343942;

    font-size: 14px;

    cursor: pointer;
}

.remember input {
    width: 18px;
    height: 18px;

    accent-color: #159447;

    cursor: pointer;
}

.forgot-password {
    color: #159447;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}


/* =========================================================
   BOTÓN LOGIN
   ========================================================= */

.login-button {
    width: 100%;
    height: 55px;

    border: none;
    border-radius: 11px;

    background: #159b4d;

    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;

    cursor: pointer;

    font-size: 16px;
    font-weight: 700;

    transition: background 0.2s ease,
                transform 0.1s ease;
}

.login-button:hover {
    background: #128a43;
}

.login-button:active {
    transform: scale(0.99);
}

.button-arrow {
    position: absolute;

    right: 22px;

    font-size: 25px;

    font-weight: 400;
}




/* =========================================================
   REGISTRO
   ========================================================= */

.register {
    margin-top: 58px;

    text-align: center;

    font-size: 14px;

    color: #777d87;
}

.register a {
    color: #159447;

    margin-left: 5px;

    font-weight: 600;

    text-decoration: none;
}

.register a:hover {
    text-decoration: underline;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */


@media (max-width: 1000px) {

    body {
        padding: 20px;
    }

    .login-container {
        height: auto;
        min-height: 700px;
        flex-direction: column;
    }

    .login-image {
        display: block;
        width: 100%;
         height: 350px;
        flex-shrink: 0;
        background-position: center top;
        background-size: cover;
    }

    .login-form-container {
        width: 100%;
        height: auto;
        padding: 45px 30px;
    }

}


@media (max-width: 550px) {

    body {
        padding: 0;

        background: white;
    }

    .login-container {
        width: 100%;
        height: auto;
        min-height: 100vh;
        overflow: visible;
        border-radius: 0;
        box-shadow: none;
        display: flex;
        flex-direction: column;
    }

 .login-image {
     display: block;
     position: relative;
     width: 100%;
     height: 420px;
     min-height: 0;
     aspect-ratio: auto;
     flex: 0 0 420px;
     padding: 0;

     background-image: url("/images/login.png");
     background-size: cover;
     background-repeat: no-repeat;
     background-position: center 60%;
     background-color: #f5eee2;
 }


    .welcome h1 {
        font-size: 30px;
    }

    .form-options {
        flex-direction: column;

        align-items: flex-start;

        gap: 18px;
    }

    .social-login {
        flex-direction: column;
    }

    .social-button {
        width: 100%;
    }

    .register {
        margin-top: 40px;
    }

}

/* =========================================================
   RECUPERAR CONTRASEÑA
   ========================================================= */

.forgot-password {
    border: none;
    background: none;

    padding: 0;

    color: #159447;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}

.forgot-password:hover {
    text-decoration: underline;
}


/* Caja */

.forgot-password-box {
    display: none;

    width: 100%;

    margin-top: -10px;
    margin-bottom: 30px;

    padding: 24px;

    background: #f8faf9;

    border: 1px solid #dfe8e2;
    border-radius: 12px;
}

.forgot-password-box.active {
    display: block;
}


/* Contenido */

.forgot-password-content h3 {
    color: #171b24;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px !important;
}

.forgot-password-content p {
    color: #777d87;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 22px !important;
}


/* Campo email */

.forgot-password-input {
    position: relative;

    width: 100%;
}

.forgot-password-input input {
    width: 100%;
    height: 52px;

    border: 1px solid #dfe2e7;
    border-radius: 10px;

    background: white;

    padding: 0 18px 0 58px;

    color: #20242c;

    font-family: inherit;
    font-size: 15px;

    text-align: left;

    outline: none;

    transition: all 0.2s ease;
}

.forgot-password-input input::placeholder {
    color: #9ca1aa;
}

.forgot-password-input input:focus {
    border-color: #16a34a;

    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.10);
}


/* Icono */

.forgot-password-input .input-icon {
    position: absolute;

    left: 18px;
    top: 50%;

    transform: translateY(-50%);

    width: 20px !important;
    height: 20px !important;

    color: #159447;

    z-index: 2;
}


/* Botón */

.recovery-button {
    width: 100%;
    height: 48px;

    margin-top: 14px;

    border: none;
    border-radius: 10px;

    background: #159b4d;

    color: white;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition: background 0.2s ease,
                transform 0.1s ease;
}

.recovery-button:hover {
    background: #128a43;
}

.recovery-button:active {
    transform: scale(0.99);
}

.login-form-container > .mensaje {
    position: static;
    width: 100%;
    max-width: 470px;
    margin-bottom: 30px;
}

#forgotPasswordBox h3 {
    margin: 0 0 12px;
}

#forgotPasswordBox p {
    margin: 0 0 22px;
}

/* RECOMENDACIÓN CUMPLIDA */

.password-recommendations li.correcto {
    color: #16a34a;
}



/* =========================================
   LOGIN - MODO OSCURO AUTOMÁTICO
========================================= */

@media (prefers-color-scheme: dark) {

    /* Fondo general */
    body {
        background: #111827;
        color: #f1f5f9;
    }

    /* Contenedor principal */
    .login-container {
        background: #1f2937;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.30);
    }

    /* Panel derecho */
    .login-form-container {
        background: #1f2937;
        color: #f1f5f9;
    }

    /* Bienvenida */
    .welcome h1 {
        color: #f8fafc;
    }

    .welcome p {
        color: #94a3b8;
    }

    /* Etiquetas */
    .form-group label {
        color: #e2e8f0;
    }

    /* Campos */
    .input-container input,
    .forgot-password-input input {
        background: #273449;
        border-color: #475569;
        color: #f8fafc;
    }

    .input-container input::placeholder,
    .forgot-password-input input::placeholder {
        color: #94a3b8;
    }

    .input-container input:focus,
    .forgot-password-input input:focus {
        border-color: #16a34a;
    }

    /* Iconos */
    .password-toggle {
        color: #cbd5e1;
    }

    /* Recordarme */
    .remember {
        color: #e2e8f0;
    }

    /* Recuperar contraseña */
    .forgot-password-box {
        background: #273449;
        border-color: #475569;
    }

    .forgot-password-content h3 {
        color: #f8fafc;
    }

    .forgot-password-content p {
        color: #cbd5e1;
    }

    /* Registro y ayuda */
    .register {
        color: #cbd5e1;
    }

    /* Mantener verde corporativo */
    .welcome h1 span,
    .forgot-password,
    .register a {
        color: #4ade80;
    }
}
