/* =========================================================
   AUTH PAGE VIEWPORT / NO-SCROLL FIX
   Dùng chung cho Login, Register, OTP, Forgot Password...

   Cách dùng ở root page:
   <div class="auth-shell auth-shell--fixed"> ... </div>
   ========================================================= */

/* Khóa trang theo đúng chiều cao viewport, không phát sinh scroll body. */
.auth-shell.auth-shell--fixed {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box;
}

/* Chrome, Edge, Safari và Firefox mới: khóa luôn scroll ở document. */
html:has(.auth-shell--fixed),
body:has(.auth-shell--fixed),
body:has(.auth-shell--fixed) #app {
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: none;
}

/* Hai cột luôn nằm gọn bên trong viewport. */
.auth-shell--fixed > .auth-showcase,
.auth-shell--fixed > .auth-content {
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.auth-shell--fixed > .auth-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: clamp(12px, 2.2vh, 28px);
    padding-bottom: clamp(12px, 2.2vh, 28px);
}

/* Card co giãn theo chiều cao màn hình, tránh vượt quá viewport. */
.auth-shell--fixed .auth-card {
    width: min(100%, 570px);
    max-height: calc(100dvh - clamp(24px, 4.4vh, 56px));
    margin: 0 auto;
    overflow: hidden;
    box-sizing: border-box;
}

/* Laptop có chiều cao thấp: thu gọn khoảng cách nhưng giữ nguyên UI. */
@media (min-width: 992px) and (max-height: 850px) {
    .auth-shell--fixed .auth-card {
        padding-top: 24px !important;
        padding-bottom: 22px !important;
    }

    .auth-shell--fixed .auth-brand__logo {
        max-height: 70px;
    }

    .auth-shell--fixed .auth-brand__contact {
        margin-top: 4px;
    }

    .auth-shell--fixed .auth-heading {
        margin-top: 24px !important;
        margin-bottom: 22px !important;
    }

    .auth-shell--fixed .auth-heading h1 {
        margin-bottom: 8px;
        font-size: clamp(25px, 2vw, 32px);
    }

    .auth-shell--fixed .auth-form {
        gap: 16px !important;
    }

    .auth-shell--fixed .auth-field {
        min-height: 60px;
    }

    .auth-shell--fixed .auth-submit {
        min-height: 56px;
    }

    .auth-shell--fixed .auth-footer {
        margin-top: 34px !important;
    }
}

/* Màn hình rất thấp: tiếp tục thu gọn để không xuất hiện scrollbar. */
@media (min-width: 992px) and (max-height: 720px) {
    .auth-shell--fixed .auth-card {
        padding-top: 16px !important;
        padding-bottom: 16px !important;
    }

    .auth-shell--fixed .auth-brand__logo {
        max-height: 58px;
    }

    .auth-shell--fixed .auth-heading {
        margin-top: 14px !important;
        margin-bottom: 14px !important;
    }

    .auth-shell--fixed .auth-heading p {
        margin-top: 4px;
    }

    .auth-shell--fixed .auth-form {
        gap: 12px !important;
    }

    .auth-shell--fixed .auth-field {
        min-height: 54px;
    }

    .auth-shell--fixed .auth-submit {
        min-height: 52px;
    }

    .auth-shell--fixed .auth-footer {
        margin-top: 20px !important;
        gap: 8px !important;
    }
}

/* Tablet/mobile: ẩn panel minh họa, form chiếm toàn bộ viewport. */
@media (max-width: 991.98px) {
    .auth-shell--fixed {
        display: block !important;
    }

    .auth-shell--fixed > .auth-showcase {
        display: none !important;
    }

    .auth-shell--fixed > .auth-content {
        width: 100%;
        padding: 14px;
        overflow: hidden;
    }

    .auth-shell--fixed .auth-card {
        width: min(100%, 570px);
        max-height: calc(100dvh - 28px);
    }
}
