:root {
    color-scheme: dark;
    --nx-bg-0: #050b14;
    --nx-bg-1: #091321;
    --nx-card: rgba(10, 17, 29, 0.94);
    --nx-border: rgba(133, 160, 201, 0.18);
    --nx-text: #eef4ff;
    --nx-text-soft: #a8bbd7;
    --nx-text-muted: #7f95b4;
    --nx-brand: #2f74ff;
    --nx-brand-rgb: 47, 116, 255;
    --nx-accent-rgb: 31, 208, 137;
    --nx-shadow-lg: 0 34px 90px rgba(2, 8, 23, 0.56);
    --nx-focus: 0 0 0 .24rem rgba(47, 116, 255, 0.24);
    --nx-radius-xl: 30px;
    --nx-radius-md: 16px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body.nx-login-page {
    margin: 0;
    font-family: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    color: var(--nx-text);
    background:
        radial-gradient(880px 540px at 10% 12%, rgba(47, 116, 255, 0.24), transparent 68%),
        radial-gradient(900px 560px at 90% 10%, rgba(61, 196, 255, 0.12), transparent 64%),
        radial-gradient(680px 380px at 70% 88%, rgba(31, 208, 137, 0.08), transparent 70%),
        linear-gradient(135deg, #050c16 0%, #09121f 28%, #0a1525 62%, #050b14 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body.nx-login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(125, 146, 180, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 146, 180, 0.05) 1px, transparent 1px);
    background-size: 52px 52px;
    opacity: .18;
    pointer-events: none;
}

.nx-login-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 1.2vw, 20px) clamp(12px, 1.8vw, 24px);
    position: relative;
    z-index: 1;
}

.nx-login-shell {
    width: min(1400px, 100%);
    min-height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(348px, 390px);
    grid-template-areas: "visual panel";
    gap: clamp(12px, 1.2vw, 20px);
    align-items: center;
}

.nx-login-panel, .nx-login-visual { min-height: 0; }
.nx-login-panel {
    grid-area: panel;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nx-login-visual {
    grid-area: visual;
    min-width: 0;
    display: flex;
    align-items: center;
}

.nx-login-card {
    width: 100%;
    padding: 18px 18px 16px;
    border-radius: var(--nx-radius-xl);
    background:
        linear-gradient(180deg, rgba(16, 27, 45, 0.98), rgba(9, 15, 27, 0.98)),
        radial-gradient(420px 260px at 0% 0%, rgba(47, 116, 255, 0.12), transparent 74%);
    border: 1px solid rgba(148, 163, 184, 0.10);
    box-shadow: var(--nx-shadow-lg);
    position: relative;
    overflow: hidden;
}

.nx-login-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 180px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), transparent);
    pointer-events: none;
}

.nx-login-card-head, .nx-login-head, .nx-form, .nx-footer { position: relative; z-index: 1; }

.nx-login-card-head {
    padding: 0 0 8px;
    margin-bottom: 4px;
}

.nx-brand-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nx-brand-sub {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #94a8c7;
    text-align: center;
}

.nx-brand-lockup-pair, .nx-brand-lockup {
    width: min(100%, 150px);
    max-width: 150px;
    display: block;
    flex: 0 0 auto;
}

.nx-brand-lockup-pair { position: relative; aspect-ratio: 892 / 407; }
.nx-brand-lockup-pair .theme-logo-variant {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}
.nx-brand-lockup-pair .theme-logo-variant.dark { display: block; }
.nx-brand-lockup { height: auto; object-fit: contain; }

.nx-login-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.nx-title { margin: 0; font-size: clamp(26px, 2.1vw, 34px); line-height: 1.02; font-weight: 900; letter-spacing: -.03em; color: #f4f8ff; }
.nx-hint { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--nx-text-soft); font-weight: 700; }

.nx-secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(47, 116, 255, 0.18), rgba(31, 208, 137, 0.12));
    border: 1px solid rgba(47, 116, 255, 0.24);
    color: #e7f1ff;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.nx-secure-badge i {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(47, 116, 255, 0.98);
    box-shadow: 0 0 0 4px rgba(47, 116, 255, 0.18);
    display: inline-block;
}

.alert {
    display: none;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 10px;
    padding: 11px 12px;
    border-radius: 15px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    font-size: 12.5px;
    line-height: 1.45;
    font-weight: 800;
}
.alert.show { display: flex; }
.alert.danger { background: rgba(239, 68, 68, 0.12); color: #fecaca; border-color: rgba(239, 68, 68, 0.24); }
.alert.success { background: rgba(34, 197, 94, 0.12); color: #bbf7d0; border-color: rgba(34, 197, 94, 0.24); }

.nx-form { display: grid; gap: 10px; }
.nx-field { display: grid; gap: 6px; }
.nx-field-head, .row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nx-label { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #7f95b4; }
.assist, .remember, .safe, .footer { color: var(--nx-text-soft); }
.assist { font-size: 10px; font-weight: 800; }

.link {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(47, 116, 255, 0.10);
    border: 1px solid rgba(47, 116, 255, 0.18);
    color: #cfe0ff;
    font-size: 10px;
    font-weight: 900;
    text-decoration: none;
}
.link:hover { background: rgba(47, 116, 255, 0.15); border-color: rgba(47, 116, 255, 0.24); }

.control { position: relative; }

.input {
    width: 100%;
    height: 46px;
    padding: 0 84px 0 16px;
    border-radius: var(--nx-radius-md);
    border: 1px solid rgba(96, 126, 170, 0.24);
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)), #0f1a2c;
    color: var(--nx-text);
    font-size: 12.5px;
    font-weight: 800;
    outline: none;
    transition: box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.input::placeholder { color: rgba(168, 187, 215, 0.62); }
.input:focus { border-color: rgba(47, 116, 255, 0.54); background: #122038; box-shadow: var(--nx-focus); }

.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--nx-text);
    caret-color: var(--nx-text);
    box-shadow: 0 0 0 1000px #122038 inset;
    transition: background-color 9999s ease-in-out 0s;
}

.nx-captcha-field {
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(47, 116, 255, 0.08), rgba(11, 22, 39, 0.36));
    border: 1px solid rgba(96, 126, 170, 0.18);
}

.nx-captcha-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 138px;
    gap: 10px;
    align-items: center;
}

.nx-captcha-input {
    letter-spacing: .16em;
    text-transform: uppercase;
}

.nx-captcha-preview {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.nx-captcha-image {
    width: 92px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(96,126,170,.24);
    background: #0f1a2c;
    padding: 4px;
    box-sizing: border-box;
    object-fit: contain;
}

.nx-captcha-refresh {
    flex: 0 0 auto;
}

.nx-captcha-note {
    margin-top: 4px;
    color: #93acd1;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.is-invalid { border-color: rgba(239, 68, 68, 0.50) !important; box-shadow: none !important; }
.text-danger { color: #fca5a5; font-size: 12px; font-weight: 800; }

.right-icons {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-ico { width: 17px; height: 17px; opacity: .72; pointer-events: none; }

.eye-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(96, 126, 170, 0.24);
    background: rgba(255,255,255,0.06);
    color: var(--nx-text);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.eye-btn:hover { background: rgba(255,255,255,0.10); border-color: rgba(47, 116, 255, 0.28); box-shadow: 0 12px 26px rgba(2, 8, 23, 0.24); }
.eye-btn:active { transform: translateY(1px); }

.tip {
    position: absolute;
    right: 10px;
    top: calc(100% + 10px);
    display: none;
    max-width: 260px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(4, 9, 16, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f8fbff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    box-shadow: 0 18px 40px rgba(0,0,0,.38);
    z-index: 4;
}
.tip.show { display: block; }

.remember { display: inline-flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 800; }
.remember input { width: 16px; height: 16px; accent-color: #3b82f6; }

.btn {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: var(--nx-radius-md);
    background: linear-gradient(90deg, #1d4ed8 0%, #2f74ff 40%, #1fd089 100%);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.28);
}
.btn:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: .76; cursor: not-allowed; }

.spinner {
    width: 18px;
    height: 18px;
    display: none;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.42);
    border-top-color: #ffffff;
    animation: nx-spin .8s linear infinite;
}
.btn.busy .spinner { display: inline-block; }

.safe {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 800;
}
.lock { width: 14px; height: 14px; opacity: .72; }
.footer { margin-top: 12px; font-size: 10px; text-align: center; font-weight: 700; }

.nx-visual-frame {
    width: 100%;
    padding: clamp(8px, .8vw, 12px);
    border-radius: var(--nx-radius-xl);
    border: 1px solid rgba(96, 122, 162, 0.22);
    background:
        radial-gradient(620px 300px at 16% 18%, rgba(46, 106, 223, 0.18), transparent 70%),
        radial-gradient(520px 260px at 88% 15%, rgba(34, 197, 94, 0.10), transparent 70%),
        linear-gradient(180deg, rgba(9, 15, 28, 0.90), rgba(6, 12, 22, 0.72));
    box-shadow: 0 32px 72px rgba(2, 8, 23, 0.38);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.nx-visual-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 1520 / 930;
    min-height: 0;
    max-height: min(80vh, 860px);
    display: flex;
    padding: 0;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
        linear-gradient(180deg, rgba(7, 14, 26, 0.82), rgba(6, 11, 20, 0.58));
    border: 1px solid rgba(110, 136, 174, 0.16);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.nx-visual-stage-surface {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 24px;
}

.nx-visual-art {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center 50%;
    transform: none;
    display: block;
}

@keyframes nx-spin { to { transform: rotate(360deg); } }

@media (max-width: 1400px) {
    .nx-login-shell {
        grid-template-columns: minmax(0, 1fr) minmax(340px, 378px);
    }
}

@media (max-width: 1180px) {
    .nx-login-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "panel"
            "visual";
        min-height: auto;
        gap: 16px;
    }

    .nx-login-panel,
    .nx-login-visual {
        width: 100%;
    }

    .nx-login-card,
    .nx-visual-frame {
        max-width: 860px;
        margin: 0 auto;
    }

    .nx-visual-frame { padding: 8px; }
    .nx-visual-stage {
        max-height: none;
        aspect-ratio: 1520 / 930;
    }
}

@media (max-width: 920px) {
    .nx-login-screen {
        align-items: flex-start;
        padding: 16px 14px;
    }

    .nx-login-shell {
        gap: 14px;
        width: min(760px, 100%);
        margin: 0 auto;
    }

    .nx-login-card {
        padding: 20px 18px 18px;
    }

    .nx-login-head {
        gap: 10px;
    }

    .nx-title {
        font-size: clamp(28px, 5.4vw, 34px);
    }

    .nx-hint {
        font-size: 14px;
        max-width: 34rem;
    }

    .nx-visual-stage {
        aspect-ratio: 16 / 10;
    }
}

@media (max-width: 760px) {
    .nx-login-screen {
        padding: 12px;
    }

    .nx-login-shell {
        gap: 12px;
        width: 100%;
    }

    .nx-login-visual {
        display: none;
    }

    .nx-login-card,
    .nx-visual-frame {
        border-radius: 22px;
    }

    .nx-login-card {
        padding: 18px 14px 16px;
    }

    .nx-login-head {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 12px;
    }

    .nx-title-wrap {
        width: 100%;
    }

    .nx-title {
        font-size: clamp(30px, 7vw, 34px);
    }

    .nx-hint {
        margin-top: 6px;
        font-size: 13px;
    }

    .nx-secure-badge {
        align-self: flex-start;
        max-width: 100%;
        white-space: normal;
    }

    .nx-field-head,
    .row2 {
        flex-wrap: wrap;
        flex-direction: row;
        align-items: center;
        gap: 6px 10px;
    }

    .nx-field-head > * ,
    .row2 > * {
        max-width: 100%;
    }

    .nx-field-head .assist {
        width: 100%;
    }

    .link {
        min-height: 34px;
        padding-inline: 12px;
    }

    .input {
        height: 48px;
        padding-left: 14px;
    }

    .nx-captcha-grid {
        grid-template-columns: 1fr;
    }

    .nx-captcha-preview {
        justify-content: space-between;
        width: 100%;
    }

    .tip {
        left: 0;
        right: auto;
        max-width: min(260px, calc(100vw - 56px));
    }

    .remember {
        align-items: center;
        line-height: 1.45;
    }

    .safe {
        text-align: center;
        line-height: 1.45;
    }

    .footer {
        line-height: 1.5;
    }

    .nx-login-panel {
        width: min(100%, 440px);
        margin: 0 auto;
    }
}

@media (max-width: 560px) {
    .nx-login-screen {
        padding: 10px;
    }

    .nx-login-card {
        padding: 16px 12px 14px;
        min-height: calc(100dvh - 20px);
        justify-content: center;
    }

    .nx-brand-lockup-pair,
    .nx-brand-lockup {
        max-width: 132px;
    }

    .nx-brand-sub,
    .assist {
        font-size: 9px;
    }

    .nx-title {
        font-size: clamp(28px, 8vw, 32px);
    }

    .nx-hint {
        font-size: 12.5px;
        line-height: 1.55;
    }

    .nx-label {
        font-size: 9px;
    }

    .nx-secure-badge {
        width: 100%;
        justify-content: center;
        padding-inline: 14px;
    }

    .link {
        min-height: 32px;
        padding-inline: 10px;
    }

    .btn {
        min-height: 46px;
        font-size: 13px;
    }

    .nx-captcha-field {
        padding: 9px;
    }

    .nx-captcha-preview {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .nx-visual-stage {
        aspect-ratio: 4 / 3;
        max-height: 220px;
    }
}

@media (max-width: 440px) {
    .nx-login-screen {
        padding: 8px;
    }

    .nx-login-shell {
        gap: 10px;
    }

    .nx-login-card {
        padding: 14px 10px 12px;
        border-radius: 20px;
    }

    .nx-brand-band {
        gap: 6px;
    }

    .nx-brand-lockup-pair,
    .nx-brand-lockup {
        max-width: 120px;
    }

    .nx-login-head {
        margin-bottom: 10px;
    }

    .nx-title {
        font-size: clamp(25px, 9vw, 29px);
    }

    .nx-hint {
        font-size: 12px;
    }

    .input {
        height: 46px;
        padding-right: 72px;
    }

    .eye-btn {
        width: 32px;
        height: 32px;
        border-radius: 11px;
    }

    .btn {
        min-height: 44px;
    }

    .safe {
        font-size: 11px;
    }

    .footer {
        margin-top: 10px;
        font-size: 9px;
    }

    .nx-visual-frame {
        display: none;
    }
}
