/* Trang đăng nhập không nạp `custom.css`, nên phần đè bộ chữ của Metronic
   phải lặp lại ở đây. Khai `@font-face` nằm trong `fonts.css`. */
body,
html {
    font-family: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

:root {
    --w4-text: #14142b;
    --w4-muted: #6e7191;
    --w4-subtle: #a0a3bd;
    --w4-line: #e6e6f0;
    --w4-field: #f5f5fb;
    --w4-surface: #ffffff;
    --w4-primary: #5d5cf0;
    --w4-primary-2: #7b4dff;
    --w4-primary-ring: rgba(93, 92, 240, .16);
    --w4-danger: #e5484d;
    --w4-radius: 14px;
}

html, body {
    overflow-x: hidden;
}

.w4-auth-body {
    margin: 0;
    color: var(--w4-text);
    background: #f4f3ff;
    -webkit-font-smoothing: antialiased;
}

/* ================= Khung trang ================= */
.w4-auth {
    position: relative;
    display: grid;
    grid-template-columns: minmax(440px, 660px) minmax(0, 1fr);
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
    /* Cột form giữ nền sáng tới hết mép panel (~34%), rồi mới chuyển dần sang tím;
       vài quầng sáng (tím nhạt, hồng tím, chàm) cho nền có chiều sâu thay vì một dải gradient phẳng */
    background:
        radial-gradient(900px 700px at 0% 0%, #ffffff 0%, rgba(255, 255, 255, 0) 65%),
        radial-gradient(620px 480px at 12% 100%, rgba(186, 172, 255, .45) 0%, rgba(186, 172, 255, 0) 70%),
        radial-gradient(720px 560px at 96% 4%, rgba(201, 188, 255, .75) 0%, rgba(201, 188, 255, 0) 70%),
        radial-gradient(560px 460px at 52% 88%, rgba(214, 120, 255, .28) 0%, rgba(214, 120, 255, 0) 70%),
        radial-gradient(900px 780px at 82% 108%, rgba(60, 46, 205, .9) 0%, rgba(60, 46, 205, 0) 70%),
        linear-gradient(100deg, #f8f7ff 0%, #f0edff 27%, #c2b6ff 38%, #8d7cf8 52%, #6552ee 72%, #4f3cdd 100%);
}

/* Vòng cung trang trí phía sau */
.w4-auth__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
.w4-auth__ring {
    position: absolute;
    top: 50%;
    left: 72%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .28);
    transform: translate(-50%, -50%);
}
.w4-auth__ring--1 { width: 620px; height: 620px; }
.w4-auth__ring--2 { width: 980px; height: 980px; border-color: rgba(255, 255, 255, .18); }
.w4-auth__ring--3 { width: 1400px; height: 1400px; border-color: rgba(255, 255, 255, .1); }

/* ================= Cột form ================= */
.w4-auth__main {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Lề trái lớn hơn lề phải để form không dính sát mép màn hình */
    padding: 48px 40px 64px clamp(40px, 6vw, 120px);
}

.w4-auth__panel {
    width: 100%;
    max-width: 480px;
    padding: 44px 44px 40px;
    border-radius: 28px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .8) inset,
        0 2px 6px rgba(43, 36, 120, .04),
        0 30px 70px -20px rgba(64, 52, 190, .28);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    animation: w4-rise .6s cubic-bezier(.2, .8, .2, 1) both;
}

/* Linh vật voi: ló đầu qua mép trên bên phải thẻ, cằm tựa vào mép; bong bóng bay ra ngoài thẻ */
.w4-auth__panel {
    position: relative;
}
.w4-auth__mascot {
    position: absolute;
    /* SVG chừa lề 40 đơn vị quanh đầu (viewBox -40 -40 976 571) để lúc hover nghiêng đầu / vểnh tai không bị cắt */
    top: -132px;
    right: -18px;
    width: 277px;
    height: auto;
    aspect-ratio: 976 / 571;
    /* Nhận chuột để SVG bên trong bắt được :hover (voi nghiêng đầu, vểnh tai) */
    user-select: none;
    filter: drop-shadow(0 8px 14px rgba(64, 52, 190, .22));
    transform-origin: 50% 100%;
    animation: w4-mascot-peek .7s .35s cubic-bezier(.2, .9, .3, 1.25) both;
}
@keyframes w4-mascot-peek {
    from { opacity: 0; transform: translateY(26px) scale(.9); }
    to   { opacity: 1; transform: none; }
}

.w4-auth__logo {
    margin-bottom: 26px;
    text-align: center;
}
.w4-auth__logo img {
    width: 168px;
    height: auto;
}

.w4-auth__head {
    margin-bottom: 28px;
    text-align: center;
}
.w4-auth__title {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--w4-text);
}
.w4-auth__desc {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--w4-muted);
}
.w4-auth__desc strong {
    color: var(--w4-text);
    font-weight: 600;
}

.w4-auth__copyright {
    position: absolute;
    bottom: 22px;
    /* Cùng lề với .w4-auth__main để thẳng tâm form */
    left: clamp(40px, 6vw, 120px);
    right: 40px;
    display: flex;
    justify-content: center;
}
/* Nằm trên vùng nền chuyển trắng → tím nên chữ xám nhạt bị chìm: bọc pill kính mờ cho đủ tương phản */
.w4-auth__copyright-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 14px;
    border-radius: 999px;
    background: linear-gradient(100deg, rgba(255, 255, 255, .85) 0%, rgba(240, 237, 255, .7) 100%);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 8px 22px -12px rgba(76, 64, 230, .45);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: #4a4880;
}
/* Cùng gradient với nút đăng nhập để chân trang ăn tông với form */
.w4-auth__version {
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(100deg, var(--w4-primary) 0%, var(--w4-primary-2) 100%);
    box-shadow: 0 4px 10px -4px rgba(93, 92, 240, .55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    font-variant-numeric: tabular-nums;
}

.w4-auth__alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff8eb;
    border: 1px solid #fde4b0;
    color: #93520a;
    font-size: 13px;
    line-height: 1.5;
}

/* ---------- Icon Iconsax (sprite trong layout/account.tpl) ---------- */
/* Thẻ <i> bọc ngoài giữ vai trò cũ (cỡ chữ, màu, nền); svg ăn theo 1em + currentColor */
.isax {
    display: block;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

/* ---------- Trường nhập ---------- */
.w4-field {
    margin-bottom: 16px;
}
.w4-field__label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #4e4b66;
}

.w4-field__control.input-group {
    position: relative;
}
.w4-auth .w4-field__control .form-control {
    height: 52px;
    padding: 0 16px 0 48px;
    border: 1.5px solid transparent;
    /* Bootstrap bỏ bo góc của phần tử không đứng đầu/cuối trong .input-group */
    border-radius: var(--w4-radius) !important;
    background: var(--w4-field);
    color: var(--w4-text);
    font-size: 15px;
    font-weight: 500;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.w4-auth .w4-field__control .form-control::placeholder {
    color: var(--w4-subtle);
    font-weight: 400;
}
.w4-auth .w4-field__control .form-control:hover {
    background: #efeff9;
}
.w4-auth .w4-field__control .form-control:focus {
    background: #fff;
    border-color: var(--w4-primary);
    box-shadow: 0 0 0 4px var(--w4-primary-ring);
}
.w4-auth .w4-field__control .form-control:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 40px var(--w4-field) inset;
    -webkit-text-fill-color: var(--w4-text);
}
.w4-auth .w4-field__control .form-control.is-invalid,
.w4-auth .w4-field__control .form-control.error {
    border-color: var(--w4-danger);
    background: #fff;
}
.w4-auth .w4-field__control .form-control.is-invalid:focus,
.w4-auth .w4-field__control .form-control.error:focus {
    box-shadow: 0 0 0 4px rgba(229, 72, 77, .14);
}
.w4-field__control:has(.w4-field__toggle) .form-control,
.w4-field__control:has(.nh-pw-toggle) .form-control {
    padding-right: 50px;
}

/* Icon canh theo chiều cao ô nhập (52px) chứ không theo 50%, vì thông báo lỗi
   được chèn vào trong .input-group sẽ làm khối cao lên */
.w4-field__icon {
    position: absolute;
    top: 26px;
    left: 16px;
    transform: translateY(-50%);
    z-index: 4;
    font-size: 20px;
    color: var(--w4-subtle);
    pointer-events: none;
    transition: color .15s ease;
}
.w4-field__control:focus-within .w4-field__icon {
    color: var(--w4-primary);
}

.w4-field__toggle,
.w4-field__control .nh-pw-toggle {
    position: absolute;
    top: 26px;
    right: 8px;
    transform: translateY(-50%);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--w4-subtle);
    font-size: 20px;
    cursor: pointer;
}
.w4-field__toggle:hover,
.w4-field__toggle.is-active,
.w4-field__control .nh-pw-toggle:hover,
.w4-field__control .nh-pw-toggle.is-active {
    color: var(--w4-primary);
    background: rgba(93, 92, 240, .08);
}
.w4-field__toggle:focus-visible,
.w4-field__control .nh-pw-toggle:focus-visible {
    outline: 2px solid var(--w4-primary);
    outline-offset: 1px;
}

/* Nút hiện / ẩn mật khẩu dùng chung (element/form/password_toggle.tpl): đổi icon theo trạng thái */
.nh-pw-toggle svg { width: 1em; height: 1em; }
.nh-pw-toggle .nh-pw-toggle__eye-off,
.nh-pw-toggle.is-active .nh-pw-toggle__eye { display: none; }
.nh-pw-toggle.is-active .nh-pw-toggle__eye-off { display: inline-block; }

/* ---------- Hàng checkbox + quên mật khẩu ---------- */
.w4-auth__extra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 4px 0 6px;
}
.w4-auth__link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--w4-primary);
}
.w4-auth__link:hover {
    color: var(--w4-primary-2);
    text-decoration: none;
}

.w4-auth .w4-auth__captcha.kt-checkbox {
    margin: 0;
    padding-left: 30px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: #4e4b66;
    cursor: pointer;
}
.w4-auth .w4-auth__captcha.kt-checkbox > span {
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid #c9c9dc;
    background: #fff;
    transition: background .15s ease, border-color .15s ease;
}
.w4-auth .w4-auth__captcha.kt-checkbox > span:after {
    border-color: #fff;
    margin-left: -2px;
    margin-top: -6px;
}
.w4-auth .w4-auth__captcha.kt-checkbox > input:checked ~ span {
    background: var(--w4-primary);
    border-color: var(--w4-primary);
}
.w4-auth .w4-auth__captcha.kt-checkbox > input:focus-visible ~ span {
    box-shadow: 0 0 0 4px var(--w4-primary-ring);
}

/* ---------- Nút ---------- */
.w4-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 54px;
    margin-top: 18px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--w4-radius);
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease, color .15s ease, background .15s ease;
}
.w4-btn i {
    font-size: 17px;
    transition: transform .2s ease;
}
.w4-btn--primary {
    background: linear-gradient(100deg, var(--w4-primary) 0%, var(--w4-primary-2) 100%);
    color: #fff;
    box-shadow: 0 12px 24px -10px rgba(93, 92, 240, .7);
}
/* Vệt sáng lướt qua khi hover */
.w4-btn--primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
    transform: skewX(-20deg);
    transition: left .6s ease;
}
.w4-btn--primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 16px 30px -10px rgba(93, 92, 240, .8);
}
.w4-btn--primary:hover::after {
    left: 120%;
}
.w4-btn--primary:hover i:last-child {
    transform: translateX(3px);
}
.w4-btn--primary:active {
    transform: translateY(0);
}
.w4-btn--ghost {
    margin-top: 8px;
    background: transparent;
    color: var(--w4-muted);
}
.w4-btn--ghost:hover {
    color: var(--w4-text);
    background: var(--w4-field);
}
.w4-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--w4-primary-ring);
}
.w4-btn.disable,
.w4-btn[disabled] {
    opacity: .6;
    pointer-events: none;
}

.w4-auth__resend {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--w4-primary);
}
.w4-auth__resend.disable {
    color: var(--w4-muted);
    cursor: not-allowed;
    pointer-events: none;
}

/* ---------- Thông báo lỗi ---------- */
#kt_login .invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 6px;
    text-align: left;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--w4-danger);
}
#kt_login .error.invalid-feedback {
    display: block !important;
}
#kt_login .w4-auth__captcha .invalid-feedback {
    margin-top: 4px;
}
/* jQuery Validate để lại khung lỗi RỖNG khi ô hợp lệ (vd. vừa bấm nút hiện mật khẩu làm ô mất focus):
   khung rỗng không được chiếm margin, nếu không thẻ đăng nhập cao thêm 6px mỗi ô và nhảy dòng */
#kt_login .invalid-feedback:empty {
    margin-top: 0;
}

.text-error {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--w4-danger);
    font-weight: 500;
    text-align: center;
}
.text-error:empty {
    display: none;
}

/* ---------- OTP (trang đặt lại mật khẩu) ---------- */
.session-otp .input-opt {
    gap: 10px;
}
.session-otp .input-opt input {
    flex: 1 1 0;
    min-width: 0;
    max-width: 64px;
    height: 60px;
    padding: 0;
    border-radius: var(--w4-radius);
    border: 1.5px solid transparent;
    background: var(--w4-field);
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--w4-text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.session-otp .input-opt input:focus {
    background: #fff;
    border-color: var(--w4-primary);
    box-shadow: 0 0 0 4px var(--w4-primary-ring);
}

/* ================= Cột giới thiệu ================= */
/* Chữ ở trên, ảnh màn Tổng quan ở dưới, cả khối căn giữa; cột cao đúng một màn hình để ảnh không kéo dài trang */
.w4-auth__show {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 52px;
    min-width: 0;
    height: 100vh;
    min-height: 640px;
    padding: 48px 56px;
    overflow: hidden;
    color: #fff;
}

.w4-auth__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.w4-auth__eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7dffc4;
    box-shadow: 0 0 0 3px rgba(125, 255, 196, .3);
}

.w4-auth__copy {
    text-align: center;
}
/* Chữ tô gradient trắng → tím nhạt → xanh nhạt; bóng dùng drop-shadow vì text-shadow lộ qua chữ trong suốt */
.w4-auth__copy h2 {
    max-width: 760px;
    margin: 0 auto 14px;
    font-size: clamp(30px, 2.3vw, 42px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.025em;
    color: #fff;
    background: linear-gradient(100deg, #ffffff 0%, #ffffff 45%, #e2dcff 70%, #b9f0ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 18px rgba(40, 20, 140, .3));
    text-wrap: balance;
}

.w4-auth__lead {
    max-width: 560px;
    margin: 0 auto 26px;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .82);
    text-wrap: balance;
}

/* Chip ngắn nên xếp 1 hàng 4; cột hẹp thì về lưới 2×2 cột bằng nhau — không bao giờ rớt lẻ một chip */
.w4-auth__features {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}
.w4-auth__features li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 13px 5px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .24);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}
.w4-auth__features i {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    font-size: 16px;
}

/* ---------- Ảnh màn Tổng quan ---------- */
/* Vùng còn lại dưới khối chữ; là container để khung ảnh co theo cả rộng lẫn cao */
.w4-auth__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
    container-type: size;
    animation: w4-rise .8s .15s cubic-bezier(.2, .8, .2, 1) both;
}
/* Ảnh hiện trọn, không cắt: rộng theo chỗ trống nhưng không vượt chiều cao còn lại
   (ảnh 1397×981 ≈ 1.42). Chừa 2 bên cho thẻ nổi ló ra */
.w4-auth__frame {
    position: relative;
    width: min(100cqw - 120px, (100cqh - 24px) * 1.42, 940px);
}

/* assets/media/login/dashboard-3d.webp — ảnh đã có sẵn phối cảnh + viền khung, nền trong
   nên dùng drop-shadow theo đúng hình thay vì box-shadow */
.w4-hero {
    position: relative;
}
.w4-hero img {
    display: block;
    width: 100%;
    height: auto;
    filter:
        drop-shadow(0 40px 50px rgba(24, 12, 110, .45))
        drop-shadow(0 8px 14px rgba(24, 12, 110, .18));
}

/* ---------- Thẻ số liệu nổi trên ảnh ---------- */
.w4-float {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #ececf6;
    box-shadow:
        0 28px 56px -18px rgba(30, 16, 120, .5);
    color: var(--w4-text);
    white-space: nowrap;
    animation: w4-bob 6s ease-in-out infinite;
}
.w4-float__label {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8a8ca8;
}
.w4-float__text {
    margin-top: 2px;
    font-size: 13.5px;
    color: var(--w4-muted);
}
.w4-float__text b {
    margin-right: 2px;
    font-size: 20px;
    font-weight: 700;
    color: var(--w4-text);
}

.w4-float--revenue {
    top: 40%;
    left: -56px;
    display: block;
    width: 212px;
    animation-delay: -1s;
}
.w4-float__value {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 8px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.02em;
}
.w4-float__up {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e3f8ef;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    color: #13965f;
}
.w4-float__spark {
    display: block;
    width: 100%;
    height: 40px;
}

.w4-float--online {
    top: 5%;
    left: 4%;
    animation-delay: -3s;
}
.w4-float__pulse {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1fc77e;
}
.w4-float__pulse::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #1fc77e;
    animation: w4-ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}

.w4-float--order {
    bottom: 4%;
    right: -36px;
    animation-delay: -4.5s;
}
.w4-float__icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--w4-primary), var(--w4-primary-2));
    font-size: 20px;
    color: #fff;
}

/* ---------- Hiệu ứng khối ảnh ---------- */
/* Ảnh đã nghiêng sẵn nên mặc định không xoay; login.js đổi --w4-rx/--w4-ry nhẹ theo chuột. Thẻ nổi đẩy lên lớp trước (translate Z)
   để khi nghiêng có chiều sâu — dùng thuộc tính `translate` riêng nên không đụng animation `transform` */
.w4-auth__stage {
    perspective: 1800px;
}
.w4-auth__frame {
    --w4-rx: 0deg;
    --w4-ry: 0deg;
    transform: rotateX(var(--w4-rx)) rotateY(var(--w4-ry));
    transform-style: preserve-3d;
    transition: transform .6s cubic-bezier(.2, .8, .2, 1);
    will-change: transform;
}
.w4-auth__frame.is-tracking {
    transition-duration: .12s;
}
.w4-auth__frame .w4-float {
    translate: 0 0 70px;
}

/* Quầng sáng gradient phía sau ảnh, "thở" chậm */
.w4-auth__glow {
    position: absolute;
    inset: 6% -4% -6%;
    z-index: -1;
    border-radius: 40px;
    background:
        radial-gradient(closest-side at 25% 40%, rgba(122, 231, 255, .75), transparent),
        radial-gradient(closest-side at 75% 60%, rgba(255, 128, 214, .6), transparent),
        radial-gradient(closest-side at 50% 50%, rgba(140, 120, 255, .9), transparent);
    filter: blur(48px);
    transform: translateZ(-80px);
    animation: w4-breathe 7s ease-in-out infinite;
    pointer-events: none;
}

.w4-hero img {
    animation: w4-zoom 1.4s .2s cubic-bezier(.2, .8, .2, 1) both;
}

/* Vệt sáng lướt chéo theo chu kỳ, cắt đúng theo hình ảnh (mask = chính ảnh, đặt qua --w4-hero-mask) */
.w4-hero__sheen {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    -webkit-mask: var(--w4-hero-mask) center / 100% 100% no-repeat;
    mask: var(--w4-hero-mask) center / 100% 100% no-repeat;
}
.w4-hero__sheen::before {
    content: '';
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: -40%;
    width: 30%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .55) 50%, transparent 100%);
    transform: skewX(-18deg) translateX(0);
    animation: w4-sheen 7s 1.6s ease-in-out infinite;
}

/* Thẻ nổi: kính mờ + bật lần lượt rồi mới bồng bềnh */
/* Nền gần đặc: backdrop-filter không chạy trong khối preserve-3d nên nền quá trong sẽ lộ chữ của ảnh */
.w4-float {
    background: rgba(255, 255, 255, .95);
    border-color: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    animation:
        w4-pop .7s cubic-bezier(.2, 1.4, .4, 1) both,
        w4-bob 6s ease-in-out infinite;
}
.w4-float--revenue { animation-delay: .7s, 1.4s; }
.w4-float--online  { animation-delay: .9s, 1.6s; }
.w4-float--order   { animation-delay: 1.1s, 1.8s; }

/* Sparkline tự vẽ, vùng tô hiện dần, chấm cuối nhấp nháy */
.w4-float__spark-line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: w4-draw 1.6s 1.1s cubic-bezier(.4, 0, .2, 1) forwards;
}
.w4-float__spark-fill {
    opacity: 0;
    animation: w4-fade .8s 2.1s ease forwards;
}
.w4-float__spark-dot {
    position: absolute;
    right: 14px;
    bottom: 46px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--w4-primary);
    box-shadow: 0 0 0 3px #fff;
    opacity: 0;
    animation: w4-fade .3s 2.6s ease forwards;
}
.w4-float__spark-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--w4-primary);
    animation: w4-ping 1.8s 2.8s cubic-bezier(0, 0, .2, 1) infinite;
}

/* Số "online" đổi: nảy nhẹ */
[nh-live].is-bump {
    display: inline-block;
    animation: w4-bump .45s ease;
}

/* Biểu tượng đơn hàng mới có chấm đỏ báo */
.w4-float__icon {
    position: relative;
}
.w4-float__icon::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #ff4d6d;
    box-shadow: 0 0 0 2px #fff;
    animation: w4-ring 4s 2.5s ease-in-out infinite;
}

/* ================= Hiệu ứng ================= */
@keyframes w4-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes w4-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes w4-breathe {
    0%, 100% { opacity: .75; transform: translateZ(-80px) scale(1); }
    50% { opacity: 1; transform: translateZ(-80px) scale(1.06); }
}
@keyframes w4-zoom {
    from { transform: scale(1.06); filter: blur(4px); }
    to { transform: scale(1); filter: blur(0); }
}
@keyframes w4-sheen {
    0% { transform: skewX(-18deg) translateX(0); }
    35%, 100% { transform: skewX(-18deg) translateX(560%); }
}
@keyframes w4-pop {
    from { opacity: 0; transform: translateY(18px) scale(.86); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes w4-draw {
    to { stroke-dashoffset: 0; }
}
@keyframes w4-fade {
    to { opacity: 1; }
}
@keyframes w4-bump {
    40% { transform: translateY(-3px) scale(1.15); color: #1fa971; }
}
@keyframes w4-ring {
    0%, 70%, 100% { transform: scale(1); }
    75% { transform: scale(1.35); }
    85% { transform: scale(.9); }
}
@keyframes w4-ping {
    75%, 100% { transform: scale(2.4); opacity: 0; }
}

/* ---------- Tiện ích cũ còn được tham chiếu ---------- */
.img-invert {
	filter: invert(1);
}
.color-white {
	color: #fff !important;
}
.color-gray {
    color: #74788d !important;
}
.mb-50 {
	margin-bottom: 50px !important;
}
.required {
    color: var(--red);
}

/* ================= Responsive ================= */
@media (max-width: 1440px) {
    .w4-auth__show {
        padding-left: 48px;
    }
    .w4-float--order {
        display: none;
    }
    /* Ảnh nhỏ lại theo chiều cao màn hình — thẻ nổi thu theo cho khỏi che */
    .w4-float {
        zoom: .78;
    }
}

/* Không đủ chỗ cho ảnh: chỉ giữ phần chữ giới thiệu, căn giữa */
@media (max-width: 1199px) {
    .w4-auth__show {
        justify-content: center;
        padding: 48px 40px;
    }
    .w4-auth__stage {
        display: none;
    }
    .w4-auth__ring {
        left: 70%;
    }
    .w4-auth__copy h2 {
        font-size: 38px;
    }
}

@media (max-width: 1360px) {
    .w4-auth__features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .w4-auth {
        grid-template-columns: minmax(0, 1fr);
        background:
            radial-gradient(500px 400px at 100% 0, rgba(141, 124, 248, .55), transparent 70%),
            radial-gradient(420px 340px at 100% 70%, rgba(214, 120, 255, .18), transparent 70%),
            radial-gradient(500px 400px at 0 100%, rgba(101, 82, 238, .35), transparent 70%),
            #f5f3ff;
    }
    .w4-auth__show,
    .w4-auth__bg {
        display: none;
    }
    .w4-auth__main {
        min-height: 100vh;
        padding: 40px 20px 64px;
    }
    .w4-auth__copyright {
        left: 20px;
        right: 20px;
    }
}

@media (max-width: 576px) {
    .w4-auth__panel {
        padding: 32px 22px 28px;
        border-radius: 22px;
    }
    .w4-auth__logo img {
        width: 140px;
    }
    .w4-auth__mascot {
        top: -92px;
        right: -12px;
        width: 193px;
    }
    .w4-auth__title {
        font-size: 22px;
    }
    .session-otp .input-opt input {
        height: 54px;
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .w4-auth__panel,
    .w4-auth__mascot,
    .w4-auth__stage,
    .w4-float,
    .w4-float__pulse::after,
    .w4-auth__glow,
    .w4-hero img,
    .w4-hero__sheen::before,
    .w4-float__spark-dot::after,
    .w4-float__icon::after {
        animation: none;
    }
    .w4-float__spark-line,
    .w4-float__spark-fill,
    .w4-float__spark-dot {
        animation: none;
        stroke-dashoffset: 0;
        opacity: 1;
    }
    .w4-auth__frame {
        transition: none;
    }
}
