* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.nm-login-page {
    margin: 0;
    min-height: 100vh;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    letter-spacing: 0;
    background:
        linear-gradient(135deg, rgba(245, 248, 252, .94) 0%, rgba(233, 241, 251, .92) 46%, rgba(247, 249, 252, .96) 100%),
        url("../admin/images/loginbg.png") center center / cover no-repeat;
}

.nm-login-shell {
    width: min(456px, calc(100% - 64px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 44px 0;
    display: grid;
    grid-template-columns: minmax(0, 456px);
    justify-content: center;
    align-items: center;
}

.nm-login-card {
    border: 1px solid rgba(17, 24, 39, .08);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
}

.nm-login-card {
    padding: 34px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(18px);
}

.nm-card-head {
    margin-bottom: 28px;
}

.nm-card-eyebrow {
    margin: 0 0 10px;
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.nm-card-title {
    margin: 0;
    color: #111827;
    font-size: 28px;
    line-height: 1.25;
    font-weight: 700;
}

.nm-card-subtitle {
    margin: 10px 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.7;
}

.nm-login-form {
    margin: 0;
}

.nm-field {
    margin-bottom: 18px;
}

.nm-field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.nm-input-wrap {
    position: relative;
}

.nm-input {
    width: 100%;
    height: 46px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #d7dde7;
    border-radius: 8px;
    outline: none;
    color: #111827;
    background: #ffffff;
    font-size: 14px;
    line-height: 46px;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.nm-input:hover {
    border-color: #b8c3d6;
}

.nm-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .13);
}

.nm-input::placeholder {
    color: #9aa4b2;
}

.nm-password-input {
    padding-right: 58px;
}

.nm-password-toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: #2563eb;
    background: #eef5ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.nm-eye-icon {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nm-eye-hide {
    display: none;
}

.nm-password-toggle.is-visible .nm-eye-show {
    display: none;
}

.nm-password-toggle.is-visible .nm-eye-hide {
    display: block;
}

.nm-password-toggle:hover,
.nm-password-toggle:focus {
    color: #1d4ed8;
    background: #dbeafe;
    outline: none;
}

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

.nm-captcha-img {
    width: 126px;
    height: 46px;
    display: block;
    border: 1px solid #d7dde7;
    border-radius: 8px;
    background: #f8fafc;
    object-fit: cover;
    cursor: pointer;
}

.nm-captcha-refresh {
    width: 42px;
    height: 42px;
    border: 1px solid #d7dde7;
    border-radius: 8px;
    color: #4b5563;
    background: #ffffff;
    font-size: 18px;
    line-height: 40px;
    cursor: pointer;
}

.nm-captcha-refresh:hover,
.nm-captcha-refresh:focus {
    border-color: #2563eb;
    color: #2563eb;
    outline: none;
}

.nm-form-options {
    margin: 6px 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.nm-remember {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4b5563;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.nm-remember input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #2563eb;
}

.nm-forgot-link {
    color: #2563eb;
    font-size: 13px;
    text-decoration: none;
}

.nm-forgot-link:hover,
.nm-forgot-link:focus {
    color: #1d4ed8;
    text-decoration: underline;
    outline: none;
}

.nm-login-button {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #0f9f8d);
    box-shadow: 0 14px 26px rgba(37, 99, 235, .26);
    font-size: 15px;
    font-weight: 700;
    line-height: 46px;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.nm-login-button:hover,
.nm-login-button:focus {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, .32);
    outline: none;
}

.nm-login-button:disabled {
    cursor: default;
    opacity: .72;
    transform: none;
}

.nm-login-help {
    margin: 16px 0 0;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

input:-webkit-autofill {
    -webkit-text-fill-color: #111827;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
}

@media (max-width: 980px) {
    .nm-login-shell {
        width: min(520px, calc(100% - 32px));
        min-height: 100vh;
        grid-template-columns: 1fr;
        padding: 24px 0;
    }
}

@media (max-width: 520px) {
    body.nm-login-page {
        background: #f5f7fb;
    }

    .nm-login-shell {
        width: 100%;
        min-height: auto;
        padding: 0;
    }

    .nm-login-card {
        min-height: 100vh;
        padding: 28px 20px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .nm-card-title {
        font-size: 24px;
    }

    .nm-captcha-row {
        grid-template-columns: minmax(0, 1fr) 96px 38px;
        gap: 8px;
    }

    .nm-captcha-img {
        width: 96px;
        height: 44px;
    }

    .nm-captcha-refresh {
        grid-column: auto;
        width: 38px;
        height: 38px;
        line-height: 36px;
    }

    .nm-form-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

}

@media (prefers-color-scheme: dark) {
    body.nm-login-page {
        color: #e5e7eb;
        background:
            linear-gradient(135deg, rgba(9, 17, 29, .96) 0%, rgba(13, 29, 43, .95) 54%, rgba(16, 24, 39, .96) 100%),
            url("../admin/images/loginbg.png") center center / cover no-repeat;
    }

    .nm-login-card {
        border-color: rgba(148, 163, 184, .18);
        background: rgba(15, 23, 42, .92);
        box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
    }

    .nm-card-title,
    .nm-input {
        color: #f8fafc;
    }

    .nm-card-subtitle,
    .nm-login-help,
    .nm-remember {
        color: #94a3b8;
    }

    .nm-field-label {
        color: #cbd5e1;
    }

    .nm-input,
    .nm-password-toggle,
    .nm-captcha-refresh {
        border-color: rgba(148, 163, 184, .26);
        background: rgba(15, 23, 42, .82);
    }

    .nm-input:hover,
    .nm-password-toggle:hover,
    .nm-captcha-refresh:hover {
        border-color: rgba(96, 165, 250, .62);
    }

    .nm-captcha-img {
        border-color: rgba(148, 163, 184, .26);
        background: #0f172a;
    }

    input:-webkit-autofill {
        -webkit-text-fill-color: #f8fafc;
        -webkit-box-shadow: 0 0 0 1000px #0f172a inset;
    }
}
