/* =============================================================================
 * jpt-auth.css — KHUÔN CHUNG TRANG CHƯA ĐĂNG NHẬP CỦA JUPITER GROUPS ECOSYSTEM (12/11/2026)
 * Trucking: dùng bởi resources/views/backend/pages/login.blade.php.
 * BẢN CHÉP của packages/jpt-ui/resources/assets/auth/jpt-auth.css (repo JPT.Upgrade — HR · Accounting · Handling dùng
 * bản gốc). Sửa hình thức thì chép lại cả file để các trang đăng nhập còn giống nhau.
 *   Trái (≥ 992px): panel navy + vòng phân hệ xoay quanh tâm "Jupiter Ecosystem" (view auth/hub).
 *     Vòng xoay bằng CSS; RÊ CHUỘT vào vòng (hoặc Tab tới một phân hệ) = DỪNG, mỗi phân hệ là một link bấm được.
 *   Phải: thẻ form trên nền sáng.
 *   < 992px: dải navy trên + thẻ form + danh sách phân hệ dạng ô bấm bên dưới.
 * Nạp SAU app.min.css + izy-brand.css của app.
 * ============================================================================= */

:root {
    --je-navy-0: #0a1d37;
    --je-navy-1: #10295a;
    --je-navy-2: #224080;
    --je-blue: #5a8bed;
    --je-orange: #ea996a;
    --je-brand: #0a0aa8;          /* xanh chữ "Jupiter" */
    --je-brand-soft: #7f8db8;     /* xám xanh vành logo */
    --je-main-bg: #f3f6fb;
    --je-card-bg: #ffffff;
    --je-card-border: rgba(34, 64, 128, 0.10);
}
[data-bs-theme=dark] {
    --je-main-bg: var(--vz-body-bg, #1a1d21);
    --je-card-bg: var(--vz-secondary-bg, #212529);
    --je-card-border: rgba(255, 255, 255, 0.08);
}

/* min-height (không phải height: 100%): trên điện thoại nội dung dài hơn màn hình, thân trang phải dài theo. */
html { min-height: 100%; }
body.je-auth-body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--je-main-bg); }

.je-auth {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    background: var(--je-main-bg);
}

/* ---------- Panel trái ---------- */
.je-auth__aside {
    position: relative;
    flex: 0 0 62%;
    max-width: 62%;
    display: flex;
    flex-direction: column;
    padding: 2rem 2.5rem 1.5rem;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(ellipse 70% 55% at 50% 44%, rgba(90, 139, 237, 0.24), transparent 70%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(234, 153, 106, 0.10), transparent 70%),
        linear-gradient(160deg, var(--je-navy-0) 0%, var(--je-navy-1) 55%, var(--je-navy-2) 100%);
}
.je-auth__aside::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 80%);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 80%);
    pointer-events: none;
}
.je-auth__aside > * { position: relative; }
.je-auth__aside-top { display: flex; align-items: center; gap: 0.6rem; min-height: 34px; }
.je-auth__app {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.35rem 0.8rem 0.35rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.82rem; font-weight: 600; color: #fff;
}
.je-auth__app i {
    width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--c, var(--je-blue)); color: #fff;
}
.je-auth__app svg { width: 14px; height: 14px; }
.je-auth__aside-mid {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0 1rem;
}
.je-auth__headline {
    font-size: clamp(1.4rem, 2.1vw, 2.1rem);
    line-height: 1.25;
    font-weight: 800;
    text-align: center;
    margin: 0.25rem 0 0.6rem;
    color: #fff;
    letter-spacing: -0.01em;
}
.je-auth__tagline {
    max-width: 30rem;
    margin: 0 auto;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.68);
}
.je-auth__hint {
    margin: 0.9rem auto 0;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}
.je-auth__aside-foot { font-size: 0.78rem; color: rgba(255, 255, 255, 0.5); text-align: center; }
.je-auth__aside-foot a { color: rgba(255, 255, 255, 0.72); text-decoration: none; }
.je-auth__aside-foot a:hover { color: #fff; text-decoration: underline; }

/* ---------- Bên phải: form ---------- */
.je-auth__main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem 1.25rem;
}
.je-auth__main-inner {
    flex: 1;
    width: 100%;
    max-width: 348px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.je-auth__card {
    background: var(--je-card-bg);
    border: 1px solid var(--je-card-border);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(16, 41, 90, 0.04), 0 18px 40px -12px rgba(16, 41, 90, 0.18);
    padding: 1.5rem 1.5rem 1.35rem;
}
.je-auth__card .form-control,
.je-auth__card .form-select { min-height: 40px; border-radius: 10px; }
.je-auth__card .form-label { font-size: 0.82rem; margin-bottom: 0.3rem; }
.je-auth__card .btn { border-radius: 10px; }
.je-auth__card .btn:not(.btn-sm):not(.btn-link) { min-height: 42px; font-weight: 600; }
.je-auth__card .input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.je-auth__card .input-group > .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.je-auth__title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.2rem; color: var(--vz-heading-color, inherit); }
.je-auth__sub { color: var(--vz-secondary-color, #878a99); margin-bottom: 0; font-size: 0.82rem; }

/* Hệ đang đăng nhập: logo (ô màu + icon của phân hệ, hoặc ảnh logo) + tên phân hệ + tên phần mềm */
.je-sys {
    display: flex; align-items: center; gap: 0.75rem;
    padding-bottom: 1rem; margin-bottom: 1rem;
    border-bottom: 1px solid var(--je-card-border);
}
.je-sys__logo {
    flex: 0 0 48px; width: 48px; height: 48px;
    border-radius: 14px;
    display: grid; place-items: center;
    background: var(--c, var(--je-navy-2)); color: #fff;
    box-shadow: 0 10px 20px -10px var(--c, var(--je-navy-2));
}
.je-sys__logo svg { width: 25px; height: 25px; }
.je-sys__logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; background: #fff; }
.je-sys__text { min-width: 0; line-height: 1.2; }
.je-sys__tag {
    display: block;
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--vz-secondary-color, #878a99);
}
.je-sys__name { display: block; margin-top: 2px; font-size: 1.08rem; font-weight: 800; letter-spacing: -0.01em; color: var(--vz-heading-color, #212529); }
.je-sys__desc { display: block; margin-top: 1px; font-size: 0.74rem; color: var(--vz-secondary-color, #878a99); }

/* Dấu "được bảo vệ bởi 2FA" dưới nút đăng nhập + ô nhập mã 6 số ở bước 2FA */
.je-2fa {
    display: flex; align-items: center; gap: 0.55rem;
    margin-top: 0.9rem;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    background: rgba(42, 157, 111, 0.08);
    border: 1px solid rgba(42, 157, 111, 0.22);
    font-size: 0.74rem; line-height: 1.35;
    color: var(--vz-secondary-color, #878a99);
}
.je-2fa svg { flex: 0 0 18px; width: 18px; height: 18px; color: #1f8a5f; }
.je-2fa b { color: var(--vz-body-color, #212529); font-weight: 600; }
.je-otp {
    text-align: center;
    font-size: 1.35rem; font-weight: 700;
    letter-spacing: 0.45em; text-indent: 0.45em;
    font-variant-numeric: tabular-nums;
}
.je-otp::placeholder { letter-spacing: 0.3em; font-weight: 400; opacity: 0.45; }
.je-steps { margin: 0 0 1rem; padding: 0; list-style: none; counter-reset: je-step; font-size: 0.8rem; color: var(--vz-secondary-color, #878a99); }
.je-steps li { position: relative; padding: 0.15rem 0 0.15rem 1.75rem; counter-increment: je-step; }
.je-steps li::before {
    content: counter(je-step);
    position: absolute; left: 0; top: 0.15rem;
    width: 1.2rem; height: 1.2rem; border-radius: 50%;
    display: grid; place-items: center;
    font-size: 0.68rem; font-weight: 700;
    background: rgba(34, 64, 128, 0.1); color: var(--je-navy-2);
}
.je-back { display: inline-block; margin-top: 0.9rem; font-size: 0.8rem; }
.je-auth__foot { margin-top: 1.25rem; font-size: 0.78rem; color: var(--vz-secondary-color, #878a99); text-align: center; }
.je-pass { position: relative; }
.je-pass .form-control { padding-right: 2.75rem; }
.je-pass__toggle {
    position: absolute; top: 0; right: 0; height: 100%; width: 2.75rem;
    display: grid; place-items: center;
    border: 0; background: none; padding: 0;
    color: var(--vz-secondary-color, #878a99);
}
.je-pass__toggle:hover { color: var(--vz-body-color, #212529); }
.je-pass__toggle svg { width: 18px; height: 18px; }
.je-pass__toggle .je-eye-off, .je-pass__toggle.is-on .je-eye { display: none; }
.je-pass__toggle.is-on .je-eye-off { display: block; }

@media (min-width: 992px) and (max-width: 1199.98px) {
    .je-auth__aside { flex-basis: 56%; max-width: 56%; padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* ---------- Link tải app di động (backend/partials/_eco_apps.blade.php) ----------
 * Ẩn mặc định; chỉ mở khi <html data-je-os="ios|android"> (script đầu trang dò máy). Hiện đủ nút Android + iOS đã khai,
 * nút đúng nền tảng của máy đang dùng được tô đậm. */
.je-apps { display: none; }
html[data-je-os] .je-apps { display: block; margin-top: 1.25rem; }
.je-apps__title {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--vz-secondary-color, #878a99); margin: 0 0 0.5rem 0.15rem;
}
.je-apps__row {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.5rem 0.65rem;
    border-radius: 12px;
    background: var(--je-card-bg);
    border: 1px solid var(--je-card-border);
}
.je-apps__row + .je-apps__row { margin-top: 0.5rem; }
.je-apps__row > i {
    flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--c); color: #fff;
}
.je-apps__row > i svg { width: 16px; height: 16px; }
.je-apps__name { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 0.85rem; line-height: 1.2; color: var(--vz-body-color, #212529); }
.je-apps__name small { display: block; margin-top: 1px; font-size: 0.7rem; font-weight: 400; color: var(--vz-secondary-color, #878a99); }
.je-apps__links { display: flex; gap: 0.4rem; flex: 0 0 auto; }
.je-apps__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
    min-height: 36px; padding: 0.3rem 0.7rem;
    border-radius: 9px;
    border: 1px solid rgba(34, 64, 128, 0.25);
    background: transparent;
    color: var(--je-navy-2) !important;
    font-size: 0.8rem; font-weight: 600; white-space: nowrap;
    text-decoration: none !important;
}
.je-apps__btn svg { width: 15px; height: 15px; }
html[data-je-os=android] .je-apps__btn[data-je-store=android],
html[data-je-os=ios] .je-apps__btn[data-je-store=ios] {
    background: var(--je-navy-2); border-color: var(--je-navy-2); color: #fff !important;
}
/* Bản trong thẻ đăng nhập: app của chính hệ đang đăng nhập, đứng trước form */
html[data-je-os] .je-apps--card {
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem 0.75rem;
    border-radius: 12px;
    background: rgba(34, 64, 128, 0.05);
    border: 1px solid rgba(34, 64, 128, 0.12);
}
.je-apps--card .je-apps__title { text-transform: none; letter-spacing: 0; font-size: 0.8rem; font-weight: 600; color: var(--vz-body-color, #212529); margin-left: 0; }
.je-apps--card .je-apps__row { padding: 0; border: 0; background: none; }
.je-apps--card .je-apps__links { flex: 1 1 auto; }
.je-apps--card .je-apps__btn { flex: 1 1 0; min-height: 40px; background: var(--je-card-bg); }

/* ---------- Màn hẹp: dải navy trên + danh sách phân hệ dưới thẻ form ---------- */
.je-auth__band { display: none; }
.je-eco { display: none; }
@media (max-width: 991.98px) {
    .je-auth { flex-direction: column; }
    .je-auth__aside { display: none; }
    .je-auth__band {
        display: block;
        padding: 1.75rem 1.25rem 4.25rem;
        padding-top: max(1.75rem, env(safe-area-inset-top));
        text-align: center;
        color: #fff;
        background: linear-gradient(160deg, var(--je-navy-0) 0%, var(--je-navy-1) 55%, var(--je-navy-2) 100%);
    }
    .je-auth__band b { display: block; font-size: clamp(1.1rem, 5.6vw, 1.3rem); font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
    .je-auth__band p { margin: 0.35rem auto 0; max-width: 22rem; font-size: 0.85rem; color: rgba(255, 255, 255, 0.72); }
    .je-auth__main { padding: 0 1rem 1.25rem; }
    .je-auth__main-inner { justify-content: flex-start; margin-top: -3rem; max-width: 440px; }
    .je-auth__card { padding: 1.5rem 1.25rem 1.4rem; }
    /* Chữ ô nhập ≥ 16px: iPhone (Safari) tự phóng to cả trang khi chạm vào ô có chữ nhỏ hơn. */
    .je-auth__card .form-control, .je-auth__card .form-select { font-size: 16px; }
    .je-auth__card .je-otp { font-size: 1.35rem; }
    .je-sys__text { flex: 1 1 0; }
    .je-sys__name { text-wrap: balance; overflow-wrap: anywhere; }
    .je-sys__tag { letter-spacing: 0.06em; }

    .je-eco { display: block; margin-top: 1.25rem; }
    .je-eco__title {
        font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
        color: var(--vz-secondary-color, #878a99); margin: 0 0 0.5rem 0.15rem;
    }
    /* Luôn 2 cột; số phân hệ lẻ thì ô cuối trải hết hàng (không để một ô lẻ loi bên trái). */
    .je-eco__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
    .je-eco__item:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .je-eco__item {
        display: flex; align-items: center; gap: 0.55rem;
        min-height: 48px;
        padding: 0.5rem 0.65rem;
        border-radius: 12px;
        background: var(--je-card-bg);
        border: 1px solid var(--je-card-border);
        color: var(--vz-body-color, #212529) !important;
        text-decoration: none !important;
        font-weight: 600; font-size: 0.85rem;
    }
    .je-eco__item i {
        flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%;
        display: grid; place-items: center;
        background: var(--c); color: #fff;
    }
    .je-eco__item svg { width: 16px; height: 16px; }
    .je-eco__item span { min-width: 0; line-height: 1.2; }
    .je-eco__item small { display: block; margin-top: 1px; font-size: 0.7rem; font-weight: 400; color: var(--vz-secondary-color, #878a99); overflow-wrap: anywhere; }
    .je-eco__item.is-current { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 25%, transparent); }
}
@media (max-width: 339.98px) {
    .je-eco__grid { grid-template-columns: 1fr; }
    .je-auth__card { padding-left: 1rem; padding-right: 1rem; }
}

/* ---------- Vòng phân hệ (hub) ----------
 * .je-hub__orbit xoay cả cụm (nan + phân hệ); .je-hub__up xoay ngược cùng nhịp để icon + chữ luôn đứng thẳng.
 * Hover / focus trong .je-hub → animation-play-state: paused cho cả hai nên không lệch pha khi chạy lại. */
.je-hub {
    --je-dur: 60s;
    --je-node: clamp(58px, 5.6vw, 82px);
    container-type: inline-size;
    position: relative;
    width: min(84%, 620px, 58vh);
    aspect-ratio: 1;
    margin: 0 auto 2.75rem;
}
.je-hub__ring {
    position: absolute; inset: 12%;
    border-radius: 50%;
    border: 1.5px dashed rgba(255, 255, 255, 0.2);
    animation: je-spin 180s linear infinite reverse;
}
.je-hub__ring--in { inset: 29%; border: 1px solid rgba(255, 255, 255, 0.07); animation: none; }
.je-hub__orbit { position: absolute; inset: 0; z-index: 2; pointer-events: none; animation: je-spin var(--je-dur) linear infinite; }
.je-hub__spokes { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.je-hub__spokes line { stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-opacity: 0.4; }

.je-hub__node {
    position: absolute;
    left: var(--x); top: var(--y);
    width: var(--je-node); height: var(--je-node);
    margin: calc(var(--je-node) / -2) 0 0 calc(var(--je-node) / -2);
    color: #fff !important;
    text-decoration: none !important;
    pointer-events: auto;
    transition: opacity .2s;
}
.je-hub__node:focus { outline: none; }
.je-hub__up { position: absolute; inset: 0; animation: je-spin var(--je-dur) linear infinite reverse; }
.je-hub__dot {
    position: absolute; inset: 0;
    border-radius: 50%;
    display: grid; place-items: center;
    background: #14306a;
    background: color-mix(in srgb, var(--c) 20%, #0d2148);
    border: 1.5px solid var(--c);
    color: var(--c);
    box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.6);
    transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
.je-hub__dot svg { width: 44%; height: 44%; }
.je-hub__label {
    position: absolute; top: calc(100% + 6px); left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px 3px;
    border-radius: 9px;
    white-space: nowrap;
    text-align: center;
    font-size: clamp(0.9rem, 1.15vw, 1.05rem); font-weight: 700; line-height: 1.2;
    text-shadow: 0 1px 6px rgba(10, 29, 55, 0.9);
    transition: background .2s ease;
}
/* Dòng tên miền: chỉ hiện khi rê chuột / Tab tới (lúc vòng đã dừng) — cho biết bấm sẽ mở link nào. */
.je-hub__host { display: none; margin-top: 1px; font-size: 0.74rem; font-weight: 500; color: rgba(255, 255, 255, 0.8); }

/* Phân hệ đang đứng */
.je-hub__node.is-current .je-hub__dot {
    background: var(--c); color: #fff;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.12), 0 0 26px var(--c);
}

/* Rê chuột / Tab tới: dừng xoay, phân hệ đang trỏ nổi lên, hiện tên miền sẽ mở */
.je-hub:hover .je-hub__orbit, .je-hub:hover .je-hub__up, .je-hub:hover .je-hub__ring,
.je-hub:focus-within .je-hub__orbit, .je-hub:focus-within .je-hub__up, .je-hub:focus-within .je-hub__ring {
    animation-play-state: paused;
}
.je-hub:hover .je-hub__node:not(:hover) { opacity: 0.55; }
.je-hub__node:hover .je-hub__dot,
.je-hub__node:focus-visible .je-hub__dot {
    transform: scale(1.14);
    background: var(--c); color: #fff;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.14), 0 12px 30px -6px var(--c);
}
.je-hub__node:hover .je-hub__label, .je-hub__node:focus-visible .je-hub__label { background: rgba(8, 22, 46, 0.92); text-shadow: none; }
.je-hub__node:hover .je-hub__host, .je-hub__node:focus-visible .je-hub__host { display: block; }
.je-hub__node:hover, .je-hub__node:focus-visible { z-index: 3; }

/* Tâm */
.je-hub__core {
    position: absolute; left: 50%; top: 50%;
    width: 32%; aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    box-shadow: 0 0 0 9px rgba(255, 255, 255, 0.07), 0 0 60px rgba(90, 139, 237, 0.55);
    z-index: 1;
    text-decoration: none !important;
    transition: box-shadow .2s ease;
}
a.je-hub__core:hover, a.je-hub__core:focus-visible {
    outline: none;
    box-shadow: 0 0 0 9px rgba(255, 255, 255, 0.16), 0 0 70px rgba(90, 139, 237, 0.8);
}
.je-hub__halo {
    position: absolute; left: 50%; top: 50%;
    width: 58%; aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(90, 139, 237, 0.38), transparent 68%);
    animation: je-breathe 5s ease-in-out infinite;
    pointer-events: none;
}
.je-hub__core b {
    font-size: clamp(1.25rem, 2.35vw, 2rem);
    font-size: 6.6cqw;
    font-style: italic; font-weight: 800; line-height: 1;
    letter-spacing: -0.03em;
    color: var(--je-brand);
}
.je-hub__core span {
    margin-top: 0.35em;
    font-size: clamp(0.5rem, 0.72vw, 0.66rem);
    font-size: max(8px, 1.9cqw);
    font-weight: 700; letter-spacing: 0.3em; text-indent: 0.3em;
    text-transform: uppercase;
    color: var(--je-brand-soft);
}
.je-hub__core img { width: 76%; height: 76%; object-fit: contain; }

@keyframes je-spin { to { transform: rotate(360deg); } }
@keyframes je-breathe { 50% { transform: translate(-50%, -50%) scale(1.12); opacity: .7; } }
@media (prefers-reduced-motion: reduce) {
    .je-hub__orbit, .je-hub__up, .je-hub__ring, .je-hub__halo { animation: none; }
}
