/* ==========================================================================
   LOGIN - Layout dividido (branding + formulario), responsive
   ========================================================================== */

.lg-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: #eef2f7;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------------- Panel de branding (izquierda) ---------------- */
.lg-brand {
    position: relative;
    flex: 1 1 58%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem;
    overflow-x: hidden;
    overflow-y: auto;
    isolation: isolate;
}

.lg-brand__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: #0d3b66 url("/img/login-bg.svg") center/cover no-repeat;
}

.lg-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(120deg, rgba(10, 42, 77, .82) 0%, rgba(13, 59, 102, .45) 55%, rgba(29, 92, 150, .25) 100%);
}

.lg-brand__inner {
    max-width: 640px;
    color: #fff;
    width: 100%;
    /* margin:auto centra verticalmente y evita recorte cuando el contenido es alto */
    margin: auto;
}

.lg-brand__logo {
    height: 58px;
    width: auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, .95);
    object-fit: contain;
    padding: 5px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

.lg-brand__title {
    font-size: clamp(1.9rem, 3.2vw, 2.9rem);
    font-weight: 700;
    line-height: 1.12;
    margin: 1.4rem 0 .5rem;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .28);
}

.lg-brand__subtitle {
    font-size: clamp(.95rem, 1.3vw, 1.08rem);
    color: rgba(255, 255, 255, .88);
    max-width: 46ch;
    margin-bottom: 2rem;
}

/* Tarjetas de módulos */
.lg-modules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .6rem;
    margin-bottom: 1.4rem;
}

.lg-module {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: .7rem;
    padding: .6rem .7rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background-color .18s ease, transform .18s ease;
}

.lg-module:hover {
    background: rgba(255, 255, 255, .2);
    transform: translateY(-2px);
}

.lg-module__icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: .55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.lg-module__title {
    font-weight: 600;
    font-size: .82rem;
    line-height: 1.2;
}

.lg-module__text {
    font-size: .7rem;
    color: rgba(255, 255, 255, .72);
    line-height: 1.25;
}

.lg-brand__footer {
    font-size: .8rem;
    color: rgba(255, 255, 255, .65);
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

/* ---------------- Panel del formulario (derecha) ---------------- */
.lg-panel {
    flex: 0 0 480px;
    max-width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background: #fff;
    box-shadow: -14px 0 40px rgba(16, 24, 40, .07);
}

.lg-form {
    width: 100%;
    max-width: 380px;
}

.lg-form__head {
    margin-bottom: 1.8rem;
}

.lg-form__head h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #10233c;
    margin-bottom: .3rem;
}

.lg-form__head p {
    color: #64748b;
    font-size: .92rem;
    margin: 0;
}

.lg-label {
    font-weight: 600;
    font-size: .84rem;
    color: #334155;
    margin-bottom: .35rem;
}

.lg-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.lg-input-group .bi {
    position: absolute;
    left: .85rem;
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}

.lg-input {
    width: 100%;
    border: 1px solid #d7dee8;
    border-radius: .6rem;
    padding: .72rem .9rem .72rem 2.5rem;
    font-size: .95rem;
    color: #10233c;
    background: #fbfcfe;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.lg-input:focus {
    outline: none;
    border-color: #1d5c96;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(29, 92, 150, .13);
}

.lg-input::placeholder {
    color: #a3b0c2;
}

.lg-eye {
    position: absolute;
    right: .6rem;
    background: transparent;
    border: 0;
    color: #94a3b8;
    font-size: 1.05rem;
    padding: .25rem .35rem;
    border-radius: .4rem;
    line-height: 1;
}

.lg-eye:hover {
    color: #1d5c96;
    background: #eef4fb;
}

.lg-submit {
    width: 100%;
    border: 0;
    border-radius: .6rem;
    padding: .78rem 1rem;
    font-weight: 600;
    font-size: .98rem;
    color: #fff;
    background: linear-gradient(135deg, #0d3b66 0%, #1d5c96 100%);
    box-shadow: 0 6px 18px rgba(13, 59, 102, .28);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.lg-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(13, 59, 102, .34);
    filter: brightness(1.06);
}

.lg-submit:active {
    transform: translateY(0);
}

.lg-submit:disabled {
    opacity: .7;
    transform: none;
}

.lg-alert {
    border-radius: .6rem;
    font-size: .88rem;
    padding: .7rem .9rem;
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.lg-foot {
    text-align: center;
    font-size: .8rem;
    color: #94a3b8;
    margin-top: 1.6rem;
}

.lg-foot a {
    color: #1d5c96;
    font-weight: 600;
    text-decoration: none;
}

.lg-foot a:hover {
    text-decoration: underline;
}

.lg-brand__mobile {
    display: none;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1199.98px) {
    .lg-brand {
        flex-basis: 52%;
    }

    .lg-panel {
        flex-basis: 440px;
        max-width: 440px;
    }

    .lg-modules {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .lg-page {
        flex-direction: column;
        align-items: stretch;
    }

    .lg-brand {
        display: none;
    }

    .lg-panel {
        flex: 1 1 auto;
        max-width: none;
        padding: 2rem 1.25rem;
        box-shadow: none;
    }

    /* Versión compacta de la marca para el panel superior */
    .lg-compact {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .75rem;
        background: linear-gradient(135deg, #0d3b66 0%, #1d5c96 100%);
        padding: 1rem 1.25rem;
    }

    .lg-compact img {
        height: 40px;
        width: auto;
        border-radius: 9px;
        background: rgba(255, 255, 255, .95);
        padding: 3px;
    }

    .lg-compact span {
        color: #fff;
        font-weight: 700;
        font-size: 1.05rem;
    }
}

@media (min-width: 992px) {
    .lg-compact {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .lg-panel {
        padding: 1.5rem 1rem;
    }

    .lg-form__head h1 {
        font-size: 1.4rem;
    }

    .lg-modules {
        grid-template-columns: 1fr;
    }

    .lg-brand {
        padding: 1.5rem;
    }
}
