/* ============================================================================
   MAN HINH DANG NHAP (CLIENT/Pages/Login.razor)
   ----------------------------------------------------------------------------
   Dung theo ban thiet ke trong docs/ui-login (README.md + "BBOS Login.dc.html"),
   dung chung bo mau va typography voi man hinh chinh (custom.css muc "TRANG CHU").

   Bo cuc: mot the 1120 x 620 canh giua man hinh, chia 2 cot -
     trai la panel thuong hieu nen xanh, phai la form dang nhap.

   Cac lop ".lg-*" CHI dung o trang dang nhap.
   ============================================================================ */

.lg-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #e9edf2;
    color: #3a4149;
    font-family: 'Lexend Deca', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Hai vong tron trang tri o nen. Khong nhan su kien chuot de khong chan thao tac. */
.lg-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.lg-blob-top {
    top: -160px;
    left: -120px;
    width: 620px;
    height: 620px;
    background: #dfe7f1;
}

.lg-blob-bottom {
    bottom: -220px;
    right: -140px;
    width: 720px;
    height: 720px;
    background: #e2eaf4;
}

.lg-card {
    position: relative;
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    width: min(1120px, calc(100vw - 48px));
    height: min(620px, calc(100vh - 120px));
    background: #fff;
    border: 1px solid #e4e9ef;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(16,24,40,.16);
    overflow: hidden;
}

/* --- Panel trai: thuong hieu --- */
.lg-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 48px 52px;
    background: #4679cc;
    overflow: hidden;
}

.lg-brand-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.lg-brand-blob-top {
    top: -90px;
    right: -70px;
    width: 280px;
    height: 280px;
    background: rgba(255,255,255,.07);
}

.lg-brand-blob-bottom {
    bottom: -130px;
    left: -60px;
    width: 320px;
    height: 320px;
    background: rgba(255,255,255,.06);
}

/* align-self va object-fit BAT BUOC: de flex keo gian thi logo bi bop ngang.
   Chieu cao TANG GAP 3 so voi ban dau (44px -> 132px, yeu cau ngay 14/08/2026).
   File anh la 656x301 nen o 132px logo rong ~288px, con thua nhieu trong long panel trai
   (rong ~477px sau khi tru padding 52px moi ben) - khong so tran ngang.
   Dung clamp thay vi so cung: panel trai cao toi da 620px nhung co the thap hon tren man hinh
   nho (.lg-card dung height: min(620px, 100vh - 120px)), ma .lg-brand co overflow: hidden -
   logo cao co dinh se an mat phan chu ben duoi thay vi tu thu lai. flex: none de flex column
   khong bop chieu cao logo khi cho hep. */
.lg-brand-logo {
    position: relative;
    display: block;
    height: clamp(72px, 13vh, 132px);
    width: auto;
    flex: none;
    align-self: flex-start;
    object-fit: contain;
}

.lg-brand-content {
    position: relative;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lg-brand-title {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    letter-spacing: -0.3px;
}

.lg-brand-rule {
    width: 56px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,.55);
}

.lg-brand-desc {
    margin: 0;
    max-width: 440px;
    font-size: 14px;
    line-height: 1.75;
    color: rgba(255,255,255,.86);
}

.lg-brand-cta {
    display: flex;
    align-items: center;
    gap: 9px;
    align-self: flex-start;
    height: 40px;
    margin-top: 12px;
    padding: 0 20px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .6px;
    color: #fff;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

    .lg-brand-cta i {
        font-size: 11px;
    }

    .lg-brand-cta:hover {
        background: #fff;
        border-color: #fff;
        color: #4679cc;
    }

.lg-brand-status {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 34px;
    font-size: 11px;
    color: rgba(255,255,255,.6);
}

.lg-dot {
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: #95f15f;
}

/* --- Panel phai: form dang nhap --- */
.lg-form-panel {
    display: flex;
    flex-direction: column;
    padding: 48px 56px;
    overflow-y: auto;
}

.lg-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.lg-form-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    color: #222a31;
    letter-spacing: -0.2px;
}

.lg-form-sub {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: #8a949e;
}

/* Nut chon ngon ngu + danh sach xo xuong. */
.lg-lang {
    position: relative;
    flex: none;
}

.lg-lang-button {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #f7f9fb;
    font-size: 11.5px;
    font-weight: 500;
    color: #4a5460;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, color .15s;
}

    .lg-lang-button .fa-globe {
        font-size: 11px;
        color: #4679cc;
    }

    .lg-lang-button .fa-caret-down {
        font-size: 11px;
        color: #98a2ad;
    }

    .lg-lang-button:hover {
        border-color: #4679cc;
        color: #4679cc;
    }

.lg-lang-menu {
    position: absolute;
    top: 38px;
    right: 0;
    z-index: 5;
    min-width: 140px;
    padding: 4px;
    background: #fff;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16,24,40,.12);
}

.lg-lang-item {
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: #4a5460;
    cursor: pointer;
    transition: background .15s;
}

    .lg-lang-item:hover {
        background: #f4f6f9;
    }

    .lg-lang-item.selected {
        background: #eef4fd;
        color: #4679cc;
        font-weight: 600;
    }

/* --- Nhom o nhap --- */
.lg-fields {
    margin-top: 34px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lg-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
}

.lg-field-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #8a949e;
}

.lg-field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lg-link {
    font-size: 11.5px;
    color: #4679cc;
    cursor: pointer;
}

    .lg-link:hover {
        color: #0c7ed5;
    }

.lg-input {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #fff;
    transition: border-color .15s;
}

    .lg-input:focus-within {
        border-color: #4679cc;
    }

    .lg-input > i {
        font-size: 13px;
        color: #98a2ad;
    }

    .lg-input .lg-input-action {
        cursor: pointer;
    }

        .lg-input .lg-input-action:hover {
            color: #4679cc;
        }

    /* Input cua Blazor (InputText) nam trong khung tren, tu no khong ve vien. */
    .lg-input input {
        flex: 1;
        min-width: 0;
        height: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        outline: 0;
        box-shadow: none;
        background: transparent;
        font-family: inherit;
        font-size: 13.5px;
        color: #2b3238;
    }

        .lg-input input::placeholder {
            color: #98a2ad;
        }

        /* Materialize dat border-bottom + box-shadow cho moi the input, ke ca khi focus va them mot
           duong mau rieng khi Blazor gan class "valid"/"invalid" vao o nhap. Chan chinh o day; con lop
           "browser-default" + thuoc tinh type tren the InputText (xem Login.razor) moi la thu chan tu
           goc - giu ca hai cho chac, vi materialize con vai rule khong loc theo .browser-default. */
        .lg-input input:focus,
        .lg-input input.valid,
        .lg-input input.valid:focus,
        .lg-input input.invalid,
        .lg-input input.invalid:focus {
            border: 0 !important;
            box-shadow: none !important;
        }

        /* Trinh duyet tu dien tai khoan da luu (autofill) thi Chrome/Edge to nen o nhap mot mau xam-xanh
           rieng cua no, de len background:transparent ben tren - nhin nhu co mot mang xam phu len o nhap.
           Khong sua duoc bang "background" (trinh duyet chan), cach duy nhat la day mot box-shadow inset
           mau trang phu kin o nhap, va dat lai mau chu bang -webkit-text-fill-color.
           transition 100000s la meo pho bien de mau nen mac dinh cua trinh duyet khong kip hien ra. */
        .lg-input input:-webkit-autofill,
        .lg-input input:-webkit-autofill:hover,
        .lg-input input:-webkit-autofill:focus,
        .lg-input input:-webkit-autofill:active {
            -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
            box-shadow: 0 0 0 1000px #fff inset !important;
            -webkit-text-fill-color: #2b3238 !important;
            caret-color: #2b3238;
            transition: background-color 100000s ease-in-out 0s;
        }

/* Thong bao validate cua Blazor (ValidationMessage). */
.lg-field .validation-message {
    font-size: 11.5px;
    color: #c0022e;
}

/* Bang bao loi xac thuc tra ve tu server. */
.lg-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #f8c6d1;
    border-radius: 8px;
    background: #fef0f3;
    font-size: 12px;
    color: #c0022e;
}

    .lg-error i {
        font-size: 12px;
        flex: none;
    }

/* Goi y khi bam "Quen mat khau?" - he thong chua co luong tu dat lai mat khau. */
.lg-hint {
    padding: 9px 12px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #f7f9fb;
    font-size: 11.5px;
    color: #5a646f;
}

/* --- O tich "duy tri dang nhap" --- */
.lg-check {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 12.5px;
    color: #4a5460;
    cursor: pointer;
    user-select: none;
}

.lg-check-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex: none;
    border: 1px solid #dbe2ea;
    border-radius: 4px;
    background: #fff;
    transition: background .15s, border-color .15s;
}

    .lg-check-box.checked {
        border-color: #4679cc;
        background: #4679cc;
    }

    .lg-check-box i {
        font-size: 9px;
        color: #fff;
    }

/* --- Nut dang nhap --- */
.lg-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 48px;
    margin-top: 6px;
    border: 0;
    border-radius: 8px;
    background: #4679cc;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .8px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(70,121,204,.34);
    transition: background .15s;
}

    .lg-submit:hover {
        background: #0c7ed5;
    }

    .lg-submit:disabled {
        background: #9ab6e4;
        cursor: default;
        box-shadow: none;
    }

/* --- Chan form: thong tin ho tro --- */
.lg-support {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lg-support-divider {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .lg-support-divider span {
        font-size: 10.5px;
        letter-spacing: .5px;
        text-transform: uppercase;
        color: #a2acb6;
    }

.lg-support-line {
    flex: 1;
    height: 1px;
    background: #eef1f5;
}

.lg-support-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 11.5px;
    color: #8a949e;
}

    .lg-support-row span,
    .lg-support-row a {
        display: flex;
        align-items: center;
        gap: 7px;
        white-space: nowrap;
    }

    .lg-support-row i {
        font-size: 11px;
        color: #4679cc;
    }

    .lg-support-row a {
        color: #4679cc;
    }

        .lg-support-row a:hover {
            color: #0c7ed5;
        }

.lg-copyright {
    position: absolute;
    bottom: 34px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11.5px;
    color: #98a2ad;
}

/* --- Man hinh hep: xep doc, panel thuong hieu rut gon --- */
@media (max-width: 1024px) {
    .lg-card {
        grid-template-columns: 1fr;
        height: auto;
        max-height: calc(100vh - 48px);
        overflow-y: auto;
    }

    .lg-brand {
        padding: 32px 24px;
        gap: 16px;
    }

    .lg-brand-content {
        margin-top: 16px;
        gap: 12px;
    }

    /* Doan gioi thieu dai va dong trang thai bo bot de con cho cho form. */
    .lg-brand-desc,
    .lg-brand-status {
        display: none;
    }

    .lg-form-panel {
        padding: 32px 24px;
    }

    .lg-fields {
        margin-top: 20px;
    }

    .lg-copyright {
        display: none;
    }
}

@media (max-width: 640px) {
    .lg-support-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
