/* FMIT NEXUS — guest / auth shell (đồng bộ nexus-app.css) */

body.nexus-auth-guest {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--fmit-bg, #f3f4f6);
    padding-bottom: 0;
}

body.nexus-auth-guest .nexus-auth-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px 0 28px;
}

.nexus-auth-topbar .container,
.nexus-auth-footer .container {
    max-width: 960px;
}

/* ── Topbar ── */
.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;
}

.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-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;
}

/* ── 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;
}

.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;
}

.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-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;
}

/* ── 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;
}

/* ── 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);
}

/* ── Terms modal ── */
body.nexus-auth-guest.modal-open .modal-backdrop.in {
    z-index: 1050;
    opacity: .5;
}

body.nexus-auth-guest .nexus-terms-modal.modal.in {
    z-index: 1060;
}

.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) {
    body.nexus-auth-guest .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;
    }
}
