/* FMIT NEXUS — guest / auth shell (đồng bộ nexus-app.css) */

html.nexus-auth-html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body.nexus-auth-guest {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--fmit-bg, #f3f4f6);
    padding-bottom: 0;
    overflow-x: hidden;
    max-width: 100%;
    overscroll-behavior-x: none;
}

body.nexus-auth-sca {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    overscroll-behavior-x: none;
    touch-action: pan-y;
}

body.nexus-auth-guest .nexus-auth-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px 0 28px;
    overflow-x: clip;
    max-width: 100%;
}

/* SCA chat — không padding xám dưới topbar (flush A) */
body.nexus-auth-sca.nexus-sca-mode-chat:not(:has(.nexus-sca-page--marketing)) .nexus-auth-main {
    padding: 0 !important;
    margin: 0;
}
body.nexus-auth-sca.nexus-sca-mode-chat:not(:has(.nexus-sca-page--marketing)) {
    background: #fff;
}

/* Khớp shell Dashboard v2 (--nx-shell-max: 1120px); SCA vẫn override 1320px bên dưới */
.nexus-auth-topbar .container,
.nexus-auth-footer .container {
    max-width: 1120px;
}

/* ── Topbar ── */
/* Cùng stack Bootstrap guest — Dashboard / SCA topbar khớp menu ngoài đăng nhập */
.nexus-auth-topbar {
    background: #fff;
    border-bottom: 1px solid var(--fmit-border, #e5e7eb);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.nexus-auth-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--nexus-header-h, 64px);
    padding: 8px 0;
}

.nexus-auth-brand .nexus-brand-text small {
    color: var(--fmit-muted, #64748b);
}

.nexus-auth-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px 12px;
}

.nexus-auth-nav > a {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--fmit-muted, #64748b);
    text-decoration: none;
    padding: 6px 4px;
    white-space: nowrap;
}

.nexus-auth-nav > a:hover,
.nexus-auth-nav > a:focus {
    color: var(--fmit-red, #960000);
    text-decoration: none;
}

.nexus-auth-nav > a.is-active {
    color: var(--fmit-red, #960000);
}

.nexus-auth-nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px !important;
    border-radius: 8px;
    border: 1px solid var(--fmit-border, #e5e7eb);
    background: #fff;
    color: var(--fmit-text, #2d2d2d) !important;
}

.nexus-auth-nav-btn:hover,
.nexus-auth-nav-btn:focus {
    border-color: var(--fmit-red-line, #e8d4d4);
    background: var(--fmit-red-soft, #f9f5f5);
    color: var(--fmit-red, #960000) !important;
}

.nexus-auth-nav-btn--primary {
    background: var(--fmit-red, #960000) !important;
    border-color: var(--fmit-red, #960000) !important;
    color: #fff !important;
}

.nexus-auth-nav-btn--primary:hover,
.nexus-auth-nav-btn--primary:focus {
    background: var(--fmit-red-dark, #7a0000) !important;
    border-color: var(--fmit-red-dark, #7a0000) !important;
    color: #fff !important;
}

/* Menu tài khoản SCA — giống dashboard v2 (avatar navy + dropdown) */
.nexus-auth-nav-user {
    position: relative;
    margin-left: 4px;
}
.nexus-auth-user-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    max-width: none;
    border-radius: 0;
    cursor: pointer;
    line-height: 0;
}
.nexus-auth-user-avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
    background: #1a365d;
    transition: box-shadow .15s, transform .1s;
}
.nexus-auth-user-toggle:hover .nexus-auth-user-avatar,
.nexus-auth-user-toggle:focus .nexus-auth-user-avatar,
.nexus-auth-user-toggle[aria-expanded="true"] .nexus-auth-user-avatar {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a365d;
}
.nexus-auth-nav .nexus-user-menu {
    min-width: 220px;
    z-index: 1200;
}
.nexus-auth-nav .nexus-user-menu a.nexus-onboarding-help-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* ── Page + card ── */
.nexus-auth-page {
    width: 100%;
}

.nexus-auth-page > .container {
    max-width: 440px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
}

.nexus-auth-page--landing > .container {
    max-width: 680px;
}

.nexus-auth-page--wide > .container {
    max-width: 640px;
}

/* AI FMIT SCA — full-width desktop shell (không dùng 440px auth) */
body.nexus-auth-sca .nexus-auth-main {
    justify-content: flex-start;
}
body.nexus-auth-sca .nexus-auth-topbar .container,
body.nexus-auth-sca .nexus-auth-footer .container,
.nexus-auth-page--sca > .container,
body.nexus-auth-sca .nexus-auth-page > .container {
    max-width: 1320px;
    width: 100%;
}

/* Member chat desktop — full bleed, không giới hạn 1320px / padding container */
body.nexus-auth-sca.nexus-sca-mode-chat:not(:has(.nexus-sca-page--marketing)) .nexus-auth-page > .container,
body.nexus-auth-sca.nexus-sca-mode-chat:not(:has(.nexus-sca-page--marketing)) .nexus-auth-page--sca > .container {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.nexus-auth-card {
    background: #fff;
    border: 1px solid var(--fmit-border, #e5e7eb);
    border-radius: var(--fmit-radius, 12px);
    box-shadow: var(--fmit-card-shadow, 0 1px 3px rgba(15, 23, 42, .06));
    overflow: hidden;
}

.nexus-auth-card--wide {
    max-width: 640px;
    margin: 0 auto;
}

.nexus-auth-card__head {
    padding: 22px 24px 0;
    text-align: center;
}

.nexus-auth-card__head--landing {
    padding: 24px 24px 0;
    border-bottom: 1px solid var(--fmit-border, #e5e7eb);
    background: linear-gradient(180deg, #fff 0%, var(--fmit-red-soft, #f9f5f5) 100%);
}

.nexus-auth-card__head--landing h1 {
    font-size: clamp(22px, 4.5vw, 28px);
    letter-spacing: .02em;
}

.nexus-auth-card__head--landing .nexus-auth-card__lead {
    margin-bottom: 18px;
}

.nexus-auth-card__head h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--fmit-red, #960000);
}

.nexus-auth-card__lead {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--fmit-muted, #64748b);
    text-align: center;
}

.nexus-auth-card__body {
    padding: 20px 24px 24px;
}

.nexus-auth-card__head + .nexus-auth-card__body {
    padding-top: 16px;
}

/* ── Forms ── */
.nexus-auth-form .form-group {
    margin-bottom: 14px;
    text-align: left;
}

.nexus-auth-form .form-control {
    height: 44px;
    border-radius: 8px;
    border-color: var(--fmit-border, #e5e7eb);
    box-shadow: none;
    font-size: 15px;
}

.nexus-auth-form .form-control:focus {
    border-color: var(--fmit-red, #960000);
    box-shadow: 0 0 0 3px rgba(150, 0, 0, .1);
}

.nexus-auth-form .input-group-addon {
    background: #fafafa;
    border-color: var(--fmit-border, #e5e7eb);
    color: var(--fmit-muted, #64748b);
    border-radius: 8px 0 0 8px;
}

.nexus-auth-form .input-group .form-control {
    border-radius: 0 8px 8px 0;
}

.nexus-auth-form .input-group .form-control:first-child {
    border-radius: 8px 0 0 8px;
}

.nexus-auth-form .nexus-password-field .nexus-pw-toggle {
    height: 44px;
    border-radius: 0 8px 8px 0;
    border-color: var(--fmit-border, #e5e7eb);
}

.nexus-auth-form .help-block {
    margin: 6px 0 0;
    font-size: 13px;
    text-align: left;
    color: #c62828;
}

.nexus-auth-form .form-group.error .help-block a {
    color: #960000;
    font-weight: 600;
    text-decoration: underline;
}

.nexus-auth-error-list {
    margin: 8px 0 0;
    padding-left: 18px;
}

.nexus-auth-error-list li {
    margin: 0 0 4px;
    line-height: 1.45;
}

.nexus-auth-error-list a {
    color: #960000;
    font-weight: 600;
}

.nexus-auth-form .form-group.error .form-control,
.nexus-auth-form .form-group.error .input-group-addon {
    border-color: #c62828;
}

.nexus-auth-btn,
.nexus-auth-form .btn-submit {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 44px;
    margin: 4px 0 0;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: var(--fmit-red, #960000);
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    transition: background .2s ease;
}

.nexus-auth-btn:hover,
.nexus-auth-btn:focus,
.nexus-auth-form .btn-submit:hover,
.nexus-auth-form .btn-submit:focus {
    background: var(--fmit-red-dark, #7a0000);
    color: #fff !important;
}

.nexus-auth-form .btn-submit.is-loading,
.nexus-auth-form .btn-submit:disabled {
    cursor: wait;
    opacity: 0.88;
}

.nexus-auth-btn--ghost {
    background: #fff;
    border: 1px solid var(--fmit-border, #e5e7eb);
    color: var(--fmit-text, #2d2d2d) !important;
}

.nexus-auth-btn--ghost:hover,
.nexus-auth-btn--ghost:focus {
    background: var(--fmit-red-soft, #f9f5f5);
    border-color: var(--fmit-red-line, #e8d4d4);
    color: var(--fmit-red, #960000) !important;
}

/* ── Links ── */
.nexus-auth-link-row {
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    color: var(--fmit-muted, #64748b);
}

.nexus-auth-link-row a {
    color: var(--fmit-red, #960000);
    font-weight: 600;
    white-space: nowrap;
}

.nexus-auth-link-row .sep {
    margin: 0 6px;
    color: #cbd5e1;
}

.nexus-auth-tagline {
    font-size: 14px;
    line-height: 1.55;
    color: var(--fmit-muted, #64748b);
    margin: 0 0 16px;
    text-align: left;
}

.nexus-auth-tagline a {
    color: var(--fmit-red, #960000);
    font-weight: 600;
}

.nexus-auth-steps {
    font-size: 12px;
    color: #94a3b8;
    margin: 10px 0 0;
    line-height: 1.45;
}

/* Register pending — check email */
.nexus-auth-page--pending .nexus-auth-card__head + .nexus-auth-card__body {
    padding-top: 12px;
}

.nexus-auth-pending-sent {
    margin: 0 0 14px;
    text-align: center;
}

.nexus-auth-pending-sent-label {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.45;
    color: #475569;
}

.nexus-auth-pending-email {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
    word-break: break-all;
}

.nexus-auth-pending-guide {
    margin: 0 0 14px;
    padding: 8px 14px;
    text-align: left;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.nexus-auth-pending-steps {
    margin: 0;
    padding-left: 18px;
    color: #0f172a;
    font-size: 13.5px;
    line-height: 1.5;
}

.nexus-auth-pending-steps li {
    margin: 0 0 8px;
}

.nexus-auth-pending-steps li:last-child {
    margin-bottom: 0;
}

.nexus-auth-pending-steps strong {
    color: #7a0000;
    font-weight: 700;
}

.nexus-auth-pending-meta {
    margin: 8px 0 0 !important;
    font-size: 12.5px !important;
    color: #64748b !important;
    line-height: 1.4 !important;
    font-weight: 400;
}

.nexus-auth-pending-meta strong {
    color: #475569;
    font-weight: 700;
}

.nexus-auth-pending-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.nexus-auth-pending-primary {
    text-decoration: none;
}

.nexus-auth-pending-primary:hover,
.nexus-auth-pending-primary:focus {
    text-decoration: none;
}

.nexus-auth-pending-resend {
    margin: 0;
}

.nexus-auth-pending-resend .nexus-auth-btn {
    margin-top: 0;
}

.nexus-auth-pending-resend .nexus-auth-btn--ghost {
    border-color: #cbd5e1;
    color: #1e293b !important;
    font-weight: 600;
}

.nexus-auth-pending-resend .nexus-auth-btn--ghost:hover,
.nexus-auth-pending-resend .nexus-auth-btn--ghost:focus {
    border-color: #b91c1c;
    color: #960000 !important;
    background: #fdf2f2;
}

.nexus-auth-pending-resend .nexus-auth-btn:disabled {
    cursor: not-allowed;
    opacity: 1;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    box-shadow: none;
}

.nexus-auth-pending-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    text-align: center;
}

.nexus-auth-pending-links > a {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--fmit-red, #960000);
    text-decoration: none;
    line-height: 1.4;
}

.nexus-auth-pending-links > a:hover,
.nexus-auth-pending-links > a:focus {
    text-decoration: underline;
}

.nexus-auth-pending-links-help {
    margin: 6px 0 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: #64748b;
}

.nexus-auth-pending-links-help a {
    color: #64748b;
    font-weight: 500;
    text-decoration: none;
}

.nexus-auth-pending-links-help a:hover,
.nexus-auth-pending-links-help a:focus {
    color: #960000;
    text-decoration: underline;
}

.nexus-auth-pending-links-help .sep {
    margin: 0 4px;
    color: #94a3b8;
}

/* Kéo footer site gần card hơn trên trang kiểm tra email */
body.nexus-auth-guest:not(.nexus-auth-sca):has(.nexus-auth-page--pending) .nexus-auth-main {
    justify-content: flex-start;
    padding: 20px 0 12px;
}

@media (min-width: 768px) and (min-height: 640px) {
    body.nexus-auth-guest:not(.nexus-auth-sca):has(.nexus-auth-page--pending) .nexus-auth-main {
        justify-content: flex-start;
        padding: 24px 0 14px;
    }
}

@media (max-width: 767px) {
    body.nexus-auth-guest:not(.nexus-auth-sca):has(.nexus-auth-page--pending) .nexus-auth-main {
        padding: 14px 0 10px;
    }
}

/* ── Alerts / notices ── */
.nexus-auth-alert {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

.nexus-auth-alert--info {
    background: #f0f7ff;
    border: 1px solid #cfe3fc;
    color: #1e3a5f;
}

.nexus-auth-alert--success {
    background: #f1f8f2;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

.nexus-auth-alert--warning {
    background: #fff8e6;
    border: 1px solid #ffe0a3;
    color: #8a6d00;
}

.nexus-auth-alert p {
    margin: 0 0 8px;
}

.nexus-auth-alert p:last-child {
    margin-bottom: 0;
}

.nexus-auth-flash-wrap.is-fading-out {
    opacity: 0;
    transition: opacity 0.35s ease;
}

/* ── Email typo hint (đăng ký) ── */
.nexus-email-typo-hint {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff8e6;
    border: 1px solid #f0d78c;
    text-align: left;
}

.nexus-email-typo-hint__text {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #7a5b00;
}

.nexus-email-typo-hint__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.nexus-email-typo-keep {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--fmit-muted, #64748b);
    cursor: pointer;
}

.nexus-email-typo-keep input {
    margin: 0 6px 0 0;
    vertical-align: middle;
}

/* ── About / content ── */
.nexus-auth-card__body p {
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 10px;
    color: var(--fmit-text, #2d2d2d);
}

.nexus-auth-bullets,
.nexus-auth-card__body ul:not(.nexus-auth-landing-features) {
    padding-left: 20px;
    margin: 0 0 12px;
}

.nexus-auth-bullets li,
.nexus-auth-card__body ul:not(.nexus-auth-landing-features) li {
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.5;
}

.nexus-auth-cta {
    margin-top: 18px;
    text-align: center;
}

/* ── Landing ── */
.nexus-auth-landing-intro {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--fmit-text, #2d2d2d);
    text-align: center;
}

.nexus-auth-landing-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin: 0 0 22px;
    padding: 0 !important;
    list-style: none;
}

.nexus-auth-landing-features li {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 14px 12px;
    list-style: none;
    background: var(--fmit-red-soft, #f9f5f5);
    border: 1px solid var(--fmit-red-line, #e8d4d4);
    border-radius: 10px;
    text-align: center;
}

.nexus-auth-landing-features li::before {
    content: "✓";
    display: block;
    width: 26px;
    height: 26px;
    margin: 0 auto 6px;
    border-radius: 50%;
    background: var(--fmit-red, #960000);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
}

.nexus-auth-landing-features li span {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--fmit-red, #960000);
}

.nexus-auth-landing-features li small {
    display: block;
    font-size: 12px;
    line-height: 1.45;
    color: var(--fmit-muted, #64748b);
}

.nexus-auth-landing-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nexus-auth-landing-actions .nexus-auth-link-row {
    margin-top: 2px;
}

/* ── Stacked form fields (register) ── */
.nexus-auth-field > label {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fmit-text, #2d2d2d);
}

.nexus-auth-optional {
    font-weight: 400;
    color: var(--fmit-muted, #64748b);
    font-size: 12px;
}

.nexus-captcha-box {
    padding: 12px 14px;
    background: #fafafa;
    border: 1px solid var(--fmit-border, #e5e7eb);
    border-radius: 10px;
}

.nexus-captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.nexus-captcha-refresh {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    flex-shrink: 0;
}

.nexus-captcha-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nexus-captcha-option {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.nexus-captcha-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nexus-captcha-option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--fmit-border, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    color: var(--fmit-text, #2d2d2d);
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.nexus-captcha-option input:checked + span {
    border-color: var(--fmit-red, #960000);
    background: var(--fmit-red-soft, #f9f5f5);
    color: var(--fmit-red, #960000);
}

.nexus-captcha-option:hover span {
    border-color: var(--fmit-red-line, #e8d4d4);
}

/* ── Register form (legacy horizontal cleanup) ── */
.nexus-register-form .form-group {
    margin-bottom: 14px;
}

.nexus-term-row {
    font-size: 13px;
    line-height: 1.55;
    text-align: left;
}

.nexus-term-label {
    font-weight: normal;
    display: inline;
    margin: 0;
}

.nexus-term-label input {
    margin-right: 6px;
    vertical-align: top;
    margin-top: 3px;
}

.nexus-terms-open {
    display: inline;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--fmit-red, #960000);
    text-decoration: underline;
    font-size: 13px;
    cursor: pointer;
}

.nexus-terms-open:hover,
.nexus-terms-open:focus {
    color: var(--fmit-red-dark, #7a0000);
    outline: none;
}

.captcha-row img,
.nexus-captcha-img {
    width: 140px;
    height: 30px !important;
    border: 1px solid var(--fmit-border, #e5e7eb);
    border-radius: 4px;
    vertical-align: middle;
}

#captcha-options label {
    display: inline-block;
    margin: 0 14px 0 0;
    font-weight: normal;
    font-size: 14px;
}

/* ── FAQ accordion ── */
.nexus-faq-accordion {
    margin: 0;
}

.nexus-faq-accordion .panel {
    border-color: var(--fmit-border, #e5e7eb);
    border-radius: 8px !important;
    box-shadow: none;
    overflow: hidden;
}

.nexus-faq-accordion .panel + .panel {
    margin-top: 8px;
}

.nexus-faq-accordion .panel-heading {
    padding: 0;
    background: #fafafa;
    border-radius: 0;
}

.nexus-faq-accordion .panel-title {
    font-size: 14px;
    font-weight: 600;
}

.nexus-faq-accordion .panel-title a {
    display: block;
    padding: 12px 14px;
    color: var(--fmit-text, #2d2d2d);
    text-decoration: none;
}

.nexus-faq-accordion .panel-title a:hover,
.nexus-faq-accordion .panel-title a:focus {
    color: var(--fmit-red, #960000);
}

.nexus-faq-accordion .panel-body {
    font-size: 14px;
    line-height: 1.55;
    color: var(--fmit-muted, #64748b);
    border-top: 0;
    padding: 0 14px 12px;
}

.nexus-faq-accordion .panel-body a {
    color: var(--fmit-red, #960000);
}

/* ── Bootstrap modal trên auth/SCA ──
   Backdrop được nâng 1050 (khớp .modal mặc định) nên nếu không nâng .modal
   thì lớp mờ đè lên hộp thoại — thấy modal nhưng không bấm Đóng/nội dung. */
body.nexus-auth-guest.modal-open .modal-backdrop.in {
    z-index: 1050;
    opacity: .5;
}

body.nexus-auth-guest.modal-open .modal.in,
body.nexus-auth-guest .nexus-terms-modal.modal.in,
body.nexus-auth-guest #nexus-pwa-install-modal.modal.in {
    z-index: 1060;
}

/* Terms modal phải nổi trên popup đăng nhập OAuth (SCA chat: auth modal z-index 13000) */
html.nexus-auth-modal-open body.nexus-auth-guest.modal-open .modal-backdrop.in {
    z-index: 13990;
}

html.nexus-auth-modal-open body.nexus-auth-guest .nexus-terms-modal.modal.in {
    z-index: 14000;
}

.nexus-terms-modal .modal-dialog {
    margin: 24px auto;
    max-width: 720px;
    width: calc(100% - 24px);
}

.nexus-terms-modal .modal-content {
    border-radius: var(--fmit-radius, 12px);
    border: 1px solid var(--fmit-border, #e5e7eb);
    box-shadow: 0 12px 40px rgba(15, 23, 42, .15);
}

.nexus-terms-modal .modal-title {
    color: var(--fmit-red, #960000);
    font-weight: 700;
}

.nexus-terms-modal .nexus-terms-body {
    max-height: 65vh;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.65;
    color: var(--fmit-text, #2d2d2d);
}

.nexus-terms-document h3 {
    color: var(--fmit-red, #960000);
    font-size: 15px;
    font-weight: 700;
    margin: 18px 0 8px;
}

.nexus-terms-document h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 12px 0 6px;
}

/* ── Footer ── */
.nexus-auth-footer {
    flex-shrink: 0;
    padding: 20px 0 calc(20px + env(safe-area-inset-bottom, 0));
    background: #fff;
    border-top: 1px solid var(--fmit-border, #e5e7eb);
    text-align: center;
}

.nexus-auth-footer-copy,
.nexus-auth-footer-contact {
    margin: 0 0 6px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--fmit-muted, #64748b);
}

.nexus-auth-footer-contact a {
    color: var(--fmit-red, #960000);
}

.nexus-auth-footer-dmca {
    margin: 10px 0 0;
}

/* ── Responsive ── */
@media (min-width: 640px) {
    .nexus-auth-landing-features {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (min-height: 640px) {
    /* Không center SCA guest chat — tránh khoảng trắng dưới CTA */
    body.nexus-auth-guest:not(.nexus-auth-sca) .nexus-auth-main {
        justify-content: center;
        padding: 28px 0 36px;
    }
}

@media (max-width: 767px) {
    body.nexus-auth-guest .nexus-auth-main {
        padding: 14px 0 24px;
    }

    .nexus-auth-topbar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-bottom: 10px;
    }

    .nexus-auth-brand {
        flex: 0 0 auto;
        min-width: 0;
        justify-content: center;
    }

    .nexus-auth-brand .nexus-brand-text small {
        display: none;
    }

    .nexus-auth-nav {
        flex: 0 0 auto;
        width: 100%;
        justify-content: center;
        gap: 6px 10px;
        padding-bottom: 0;
    }

    .nexus-auth-nav-btn {
        padding: 6px 12px !important;
        font-size: 12px;
    }

    .nexus-auth-card__head,
    .nexus-auth-card__body {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* ── Auth marketing UX polish ── */
body.nexus-auth-guest:not(.nexus-sca-mode-chat) #back2top {
    display: none;
}

#lien-he,
#sca-faq {
    scroll-margin-top: 72px;
}

.nexus-faq-accordion .panel {
    border-radius: var(--fmit-radius, 12px);
    overflow: hidden;
    transition: box-shadow var(--nexus-duration-fast) ease, border-color var(--nexus-duration-fast) ease;
}

.nexus-faq-accordion .panel:has(.collapse.in) {
    border-color: var(--fmit-red-line, #e8d4d4);
    box-shadow: 0 2px 12px rgba(150, 0, 0, .06);
}

.nexus-faq-accordion .panel-title a {
    position: relative;
    padding-right: 36px;
    transition: color var(--nexus-duration-fast) ease;
}

.nexus-faq-accordion .panel-title a::after {
    content: "\f107";
    font-family: FontAwesome;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fmit-muted, #64748b);
    transition: transform var(--nexus-duration-med) var(--nexus-ease-out);
}

.nexus-faq-accordion .panel-title a:not(.collapsed)::after {
    transform: translateY(-50%) rotate(180deg);
    color: var(--fmit-red, #960000);
}

.nexus-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity var(--nexus-duration-slow) var(--nexus-ease-out),
        transform var(--nexus-duration-slow) var(--nexus-ease-out);
    /* Tránh lớp opacity:0 vẫn bắt click đè lên khối chat */
    pointer-events: none;
}

.nexus-reveal.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

/* ── Google OAuth + auth modal ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nexus-oauth-panel {
    width: 100%;
}

.nexus-oauth-panel--register-top {
    margin-bottom: 14px;
}

.nexus-oauth-divider--register {
    margin-top: 14px;
    margin-bottom: 18px;
}

.nexus-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease;
    box-sizing: border-box;
}

.nexus-oauth-btn:active {
    transform: scale(0.985);
}

.nexus-oauth-btn--google {
    background: #fff;
    border: 1px solid var(--fmit-border, #e5e7eb);
    color: var(--fmit-text, #2d2d2d) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.nexus-oauth-btn--google:hover,
.nexus-oauth-btn--google:focus {
    background: #fafafa;
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
    color: var(--fmit-text, #2d2d2d) !important;
}

.nexus-oauth-btn--landing {
    margin-bottom: 0;
}

.nexus-oauth-btn--primary {
    border: none;
    background: var(--fmit-red, #960000);
    color: #fff !important;
    margin-top: 4px;
    font-weight: 700;
}

.nexus-oauth-btn--primary:hover,
.nexus-oauth-btn--primary:focus {
    background: var(--fmit-red-dark, #7a0000);
    color: #fff !important;
}

.nexus-oauth-btn--ghost {
    margin-top: 8px;
    background: #fff;
    border: 1px solid var(--fmit-border, #e5e7eb);
    color: var(--fmit-muted, #64748b) !important;
}

.nexus-oauth-btn--ghost:hover,
.nexus-oauth-btn--ghost:focus {
    background: var(--fmit-red-soft, #f9f5f5);
    border-color: var(--fmit-red-line, #e8d4d4);
    color: var(--fmit-red, #960000) !important;
}

.nexus-oauth-btn.is-loading {
    opacity: .78;
    cursor: wait;
}

.nexus-oauth-btn__icon {
    display: inline-flex;
    flex-shrink: 0;
}

.nexus-oauth-terms {
    margin: 10px 0 0;
    font-size: 11px;
    line-height: 1.45;
    color: var(--fmit-muted, #64748b);
    text-align: center;
}

.nexus-oauth-terms .nexus-terms-open {
    display: inline;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--fmit-red, #960000);
    text-decoration: underline;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
}

.nexus-oauth-terms .nexus-terms-open:hover,
.nexus-oauth-terms .nexus-terms-open:focus {
    color: var(--fmit-red-dark, #7a0000);
    outline: none;
}

.nexus-oauth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 16px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nexus-oauth-divider::before,
.nexus-oauth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--fmit-border, #e5e7eb);
}

.nexus-oauth-input {
    height: 46px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    border-color: var(--fmit-border, #e5e7eb) !important;
}

.nexus-oauth-input:focus {
    border-color: var(--fmit-red, #960000) !important;
    box-shadow: 0 0 0 3px rgba(150, 0, 0, .08) !important;
}

.nexus-oauth-field {
    margin-bottom: 10px;
}

.nexus-oauth-error {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #c62828;
}

.nexus-oauth-email-display {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--fmit-red-soft, #f9f5f5);
    border: 1px solid var(--fmit-red-line, #e8d4d4);
    font-size: 14px;
    font-weight: 600;
    color: var(--fmit-text, #2d2d2d);
    word-break: break-all;
}

.nexus-oauth-password-wrap {
    position: relative;
}

.nexus-oauth-password-wrap .nexus-oauth-input {
    padding-right: 44px;
}

.nexus-oauth-pw-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--fmit-muted, #64748b);
    cursor: pointer;
}

.nexus-oauth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fmit-muted, #64748b);
    cursor: pointer;
}

.nexus-oauth-forget-row {
    margin-top: 12px !important;
}

.nexus-oauth-step[hidden] {
    display: none !important;
}

/* Auth modal (SCA + global guest) */
html.nexus-auth-modal-open,
html.nexus-auth-modal-open body {
    overflow: hidden;
}

.nexus-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.nexus-auth-modal[hidden] {
    display: none !important;
}

.nexus-auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
    animation: nexusAuthFadeIn .22s ease;
}

.nexus-auth-modal__sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: min(92vh, 720px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--fmit-border, #e5e7eb);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 40px rgba(150, 0, 0, .12);
    padding: 20px 22px calc(22px + env(safe-area-inset-bottom, 0));
    animation: nexusAuthSlideUp .28s cubic-bezier(.22, 1, .36, 1);
}

.nexus-auth-modal__close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--fmit-red-soft, #f9f5f5);
    color: var(--fmit-muted, #64748b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.nexus-auth-modal__close:hover,
.nexus-auth-modal__close:focus {
    background: var(--fmit-red-line, #e8d4d4);
    color: var(--fmit-red, #960000);
}

.nexus-auth-modal__head {
    padding: 8px 36px 16px;
    text-align: center;
    border-bottom: 1px solid var(--fmit-border, #e5e7eb);
    margin: 0 -22px 16px;
    padding-left: 58px;
    padding-right: 58px;
    background: linear-gradient(180deg, #fff 0%, var(--fmit-red-soft, #f9f5f5) 100%);
}

.nexus-auth-modal__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--fmit-red, #960000);
}

.nexus-auth-modal__lead {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--fmit-muted, #64748b);
}

@keyframes nexusAuthFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes nexusAuthSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

@media (min-width: 640px) {
    .nexus-auth-modal {
        align-items: center;
        padding: 24px;
    }

    .nexus-auth-modal__sheet {
        border-radius: 16px;
        animation-name: nexusAuthPopIn;
    }
}

@keyframes nexusAuthPopIn {
    from { opacity: 0; transform: scale(.96) translateY(8px); }
    to { opacity: 1; transform: none; }
}

body.nexus-auth-sca .nexus-auth-modal {
    z-index: 13000;
}
