/* MAPTERRA S.R.L. - Cuantificación de Cultivos
   Login V24
   - Recupera el fondo a pantalla completa con background-size: cover.
   - Sin imagen duplicada, sin blur lateral y sin marco visual de fondo.
   - Conserva el formulario compacto y los iconos corregidos de V23.
*/

html,
body.login-page {
    width: 100%;
    min-width: 100%;
    min-height: 100%;
}

body.login-page {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow: hidden;

    /* Fondo como en el concepto anterior: llena toda la ventana.
       Se conserva la proporción original; puede recortar una pequeña
       zona superior/inferior según la relación de aspecto del monitor. */
    background-color: #073f2b;
    background-image: url('../img/fondo_login.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;

    isolation: isolate;
}

/* Ya no se usan pseudo-elementos con una segunda copia desenfocada. */
body.login-page::before,
body.login-page::after {
    content: none !important;
    display: none !important;
}

/* Capa muy suave para integrar el formulario con el fondo sin apagar la imagen. */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            rgba(0, 65, 37, .13) 0%,
            rgba(0, 46, 31, .05) 42%,
            rgba(0, 35, 25, .10) 100%
        );
}

.login-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 2.2vh, 24px) 16px;
}

.login-card-new {
    width: min(470px, calc(100vw - 32px));
    padding: 22px 26px 24px;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 18px;
    background: rgba(255, 255, 255, .93);
    box-shadow: 0 18px 52px rgba(0, 0, 0, .25);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.login-brand-new {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.login-brand-new img {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    object-fit: contain;
}

.login-brand-new strong {
    display: block;
    color: var(--green);
    font-size: 22px;
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: .55px;
}

.login-brand-new span {
    display: block;
    margin-top: 3px;
    color: var(--orange);
    font-size: 13px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: 1.35px;
}

.login-copy {
    padding: 15px 0 3px;
}

.login-copy h1 {
    margin: 0 0 5px;
    font-size: 23px;
    line-height: 1.2;
}

.login-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.login-form-new label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 850;
    line-height: 1.2;
}

.login-page .field-icon {
    position: relative;
    display: block;
}

.login-page .field-icon .login-field-icon {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #152536;
    pointer-events: none;
}

.login-page .field-icon .login-field-icon svg {
    width: 21px;
    height: 21px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-page .field-icon input {
    width: 100%;
    height: 46px;
    min-height: 46px;
    margin: 0;
    padding: 0 14px 0 48px;
    border: 1px solid #cbd8e1;
    border-radius: 10px;
    background: rgba(255, 255, 255, .98);
    color: var(--ink);
    outline: none;
}

.login-page .field-icon.password-field input {
    padding-right: 104px;
}

.login-page .field-icon input:focus {
    border-color: var(--green2);
    box-shadow: 0 0 0 4px rgba(10, 166, 76, .10);
}

.login-page .field-icon button {
    position: absolute;
    right: 6px;
    top: 50%;
    z-index: 3;
    height: 34px;
    min-height: 34px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    padding: 0 11px;
    background: var(--green3);
    color: var(--green);
    font-size: 13px;
    line-height: 1;
    font-weight: 850;
}

.btn-main {
    width: 100%;
    margin-top: 17px;
    padding: 12px 18px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--green), #0bb654);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    box-shadow: 0 9px 22px rgba(0, 138, 63, .22);
}

.login-foot {
    margin-top: 10px;
    color: #fff;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 750;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0, 0, 0, .85);
}

/* En pantallas muy anchas se mantiene cover; se desplaza levemente el fondo
   hacia arriba para conservar mejor el bloque agrícola central. */
@media (min-aspect-ratio: 2/1) {
    body.login-page {
        background-position: center 46%;
    }
}

/* Portátiles / ventanas de poca altura. */
@media (max-height: 760px) and (min-width: 561px) {
    .login-card-new {
        width: min(450px, calc(100vw - 28px));
        padding: 17px 22px 19px;
        border-radius: 16px;
    }

    .login-brand-new {
        gap: 10px;
        padding-bottom: 11px;
    }

    .login-brand-new img {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .login-brand-new strong { font-size: 20px; }
    .login-brand-new span { font-size: 11.5px; }
    .login-copy { padding: 11px 0 1px; }
    .login-copy h1 { font-size: 21px; }
    .login-copy p { font-size: 12px; }
    .login-form-new label { margin-top: 9px; }
    .login-page .field-icon input { height: 42px; min-height: 42px; }
    .login-page .field-icon button { height: 31px; min-height: 31px; }
    .btn-main { margin-top: 13px; padding: 10px 16px; }
    .login-foot { margin-top: 7px; }
}

@media (max-width: 560px) {
    body.login-page {
        overflow-y: auto;
        background-attachment: scroll;
        /* En móvil se prioriza la zona izquierda/central de los cultivos. */
        background-position: 42% center;
    }

    .login-wrap {
        min-height: 100svh;
        justify-content: center;
        padding: 14px;
    }

    .login-card-new {
        width: 100%;
        max-width: 430px;
        padding: 19px 18px 21px;
        border-radius: 16px;
    }

    .login-brand-new img {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .login-brand-new strong { font-size: 19px; }
    .login-brand-new span { font-size: 10.5px; letter-spacing: 1px; }
    .login-copy h1 { font-size: 21px; }
    .login-copy p { font-size: 12px; }
}
