html,
body {
    width: 100%;
    min-width: 320px;
    min-height: 100%;
    margin: 0;
}

body {
    background: #f2f6f9;
    color: #24364b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
    font: inherit;
}

button,
input {
    outline: none;
}

button {
    -webkit-tap-highlight-color: transparent;
}

button:focus {
    outline: 2px solid rgba(44, 125, 165, 0.55);
    outline-offset: 2px;
}

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

::-webkit-input-placeholder {
    color: #9ca8b4;
}

:-moz-placeholder {
    color: #9ca8b4;
}

::-moz-placeholder {
    color: #9ca8b4;
}

:-ms-input-placeholder {
    color: #9ca8b4;
}

.login-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
    padding: 34px 24px 58px;
    overflow: hidden;
}

.login-page:before,
.login-page:after {
    position: fixed;
    z-index: 0;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.login-page:before {
    top: -230px;
    right: -150px;
    background: rgba(11, 92, 134, 0.09);
}

.login-page:after {
    bottom: -270px;
    left: -170px;
    background: rgba(243, 152, 0, 0.12);
}

.login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 57% 43%;
    width: 840px;
    min-height: 520px;
    overflow: hidden;
    border: 1px solid rgba(21, 71, 101, 0.08);
    border-radius: 24px;
    background-color: #ffffff;
    box-shadow: 0 28px 70px rgba(35, 64, 85, 0.18);
}

.login-shell::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    background-image: url(../images/login_bg.png);
    background-repeat: no-repeat;
    background-position: right center;
    background-size: auto 100%;
    pointer-events: none;
}

.brand-panel {
    grid-column: 2;
    grid-row: 1;
    min-height: 520px;
    background: transparent;
}

.auth-panel {
    position: relative;
    z-index: 1;
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-width: 0;
    padding: 30px 76px 28px 48px;
    background: transparent;
}

#loginForm {
    width: 100%;
    max-width: 370px;
    min-height: 404px;
    margin: auto;
}

.auth-header {
    margin-bottom: 20px;
}

.auth-header h1 {
    margin: 0 0 8px;
    color: #153e58;
    font-size: 26px;
    font-weight: 650;
    letter-spacing: 0.01em;
}

#errorMessageContainer {
    display: none;
    align-items: flex-start;
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid #f3c3c3;
    border-radius: 10px;
    background: #fff3f3;
    color: #bb3d3d;
    font-size: 12px;
    line-height: 20px;
}

#errorMessageContainer .message-content {
    flex: 1;
    min-width: 0;
}

#errorMessageContainer .message-hide {
    flex: 0 0 auto;
    width: 24px;
    height: 20px;
    margin: 0 0 0 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #c96363;
    cursor: pointer;
}

.login-mode-switch {
    display: flex;
    width: 100%;
    max-width: 370px;
    margin-bottom: 19px;
    padding: 4px;
    box-sizing: border-box;
    border-radius: 12px;
    background: #eef3f6;
}

.login-mode-switch button {
    flex: 1;
    height: 38px;
    padding: 0 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #6f7f8d;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.login-mode-switch button.active {
    background: #ffffff;
    color: #0b5c86;
    box-shadow: 0 3px 10px rgba(36, 72, 94, 0.12);
}

.field-label {
    display: block;
    margin: 0 0 7px;
    color: #405365;
    font-size: 12px;
    font-weight: 600;
}

.input-box {
    position: relative;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    height: 46px;
    margin: 0 0 15px;
    border: 1px solid #d9e2e8;
    border-radius: 11px;
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input-box:focus-within {
    border-color: #2c7da5;
    box-shadow: 0 0 0 3px rgba(44, 125, 165, 0.11);
}

.input-box > i {
    flex: 0 0 42px;
    color: #7f95a4;
    text-align: center;
    font-size: 15px;
}

.input-box input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 12px 0 0;
    border: 0;
    background: transparent;
    color: #24364b;
    font-size: 14px;
    line-height: 42px;
}

.input-box.verify-code {
    padding-right: 4px;
    margin-bottom: 17px;
}

#verifyCode {
    width: auto;
}

#sendLoginCodeButton {
    flex: 0 0 auto;
    min-width: 104px;
    height: 36px;
    padding: 0 12px;
    border: 0;
    border-left: 1px solid #e2e8ec;
    background: transparent;
    color: #0b5c86;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

#sendLoginCodeButton:disabled {
    color: #aab4bc;
    cursor: default;
}

#loginButton,
#submitButton {
    display: block;
    width: 100%;
    height: 46px;
    margin: 7px 0 13px;
    padding: 0 18px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, #f5a000, #f47b20);
    box-shadow: 0 10px 22px rgba(243, 139, 18, 0.25);
    color: #ffffff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: 0.06em;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#loginButton:hover,
#submitButton:hover {
    box-shadow: 0 12px 26px rgba(243, 139, 18, 0.32);
    transform: translateY(-1px);
}

#loginButton:active,
#submitButton:active {
    box-shadow: 0 6px 15px rgba(243, 139, 18, 0.22);
    transform: translateY(0);
}

.remember-option {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: #738391;
    cursor: pointer;
    font-size: 12px;
    user-select: none;
}

.remember-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.remember-option .checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    margin-right: 7px;
    box-sizing: border-box;
    border: 1px solid #c9d4db;
    border-radius: 5px;
    background: #ffffff;
    color: transparent;
    font-size: 10px;
}

.remember-option input:checked + .checkmark {
    border-color: #0b5c86;
    background: #0b5c86;
    color: #ffffff;
}

.remember-option input:focus + .checkmark {
    box-shadow: 0 0 0 3px rgba(44, 125, 165, 0.16);
}

.wechat-login-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 280px;
    padding: 18px 24px;
    border: 1px solid #e2e9ed;
    border-radius: 14px;
    background: #f8fbf9;
    text-align: center;
}

.wechat-login-panel.is-hidden {
    display: none;
}

.wechat-qr-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 170px;
    height: 170px;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid #e2e9ed;
    border-radius: 10px;
    background: #ffffff;
}

#weChatQrImage {
    width: 160px;
    height: 160px;
    object-fit: contain;
}

#weChatQrImage.expired {
    opacity: 0.18;
}

.wechat-qr-status {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.92);
    color: #7a8b96;
    font-size: 11px;
    line-height: 18px;
}

.wechat-qr-status i {
    color: #42a66a;
    font-size: 22px;
}

.wechat-login-panel p {
    margin: 10px 0 11px;
    color: #607583;
    font-size: 13px;
    line-height: 21px;
}

.weChatLoginButton {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    width: 190px;
    height: 34px;
    padding: 0 16px;
    overflow: hidden;
    border: 1px solid #dce5ea;
    border-radius: 9px;
    background: #ffffff;
    color: #607583;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.weChatLoginButton:hover {
    border-color: #81b89a;
    background: #f4fbf6;
    color: #368056;
}

.weChatLoginButton i {
    color: #42a66a;
    font-size: 15px;
}

.error {
    display: block;
    margin: -12px 0 10px;
    color: #c94f4f;
    font-size: 11px;
    line-height: 18px;
}

.modal-background {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    height: 100%;
    background: rgba(20, 37, 49, 0.45);
}

.no-selection {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.modal-view {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 9999;
    min-width: 200px;
    min-height: 200px;
    padding: 12px;
    border: 0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(20, 37, 49, 0.3);
    text-align: center;
    transform: translate(-50%, -50%);
}

.modal-view .title {
    height: 52px;
    color: #415669;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}

#weChatLoginWindow {
    width: 380px;
    height: 380px;
    box-sizing: border-box;
}

#weChatLoginWindow table {
    width: 100%;
}

.footer {
    position: fixed;
    z-index: 2;
    bottom: 14px;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0 16px;
    color: #7f8c95;
    font-size: 11px;
    text-align: center;
}

.footer a {
    color: #687984 !important;
    text-decoration: none;
}

/* Reset-password page keeps its existing JSP structure but follows the new card style. */
body > #loginForm {
    width: 360px;
    max-width: calc(100% - 32px);
    margin: 120px auto 0;
    padding: 28px 34px 34px;
    box-sizing: border-box;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(35, 64, 85, 0.18);
}

#resetPassPanel {
    width: 100%;
}

#resetPassPanel .input-box {
    padding-left: 12px;
}

#resetPassPanel .input-box input {
    padding-left: 0;
}

@media (max-width: 800px) {
    .login-page {
        align-items: flex-start;
        padding: 24px 16px 66px;
        overflow: auto;
    }

    .login-shell {
        display: block;
        width: 100%;
        max-width: 500px;
        min-height: 0;
        border-radius: 20px;
    }

    .login-shell::after {
        display: none;
    }

    .brand-panel {
        display: none;
    }

    .auth-panel {
        padding: 34px 36px 30px;
    }

    .login-mode-switch {
        width: 100%;
        max-width: none;
    }

}

@media (max-width: 440px) {
    .login-page {
        padding: 0 0 58px;
        background: #ffffff;
    }

    .login-page:before,
    .login-page:after {
        display: none;
    }

    .login-shell {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-panel {
        padding: 30px 24px 24px;
    }

    .auth-header h1 {
        font-size: 23px;
    }

    #sendLoginCodeButton {
        min-width: 92px;
        padding: 0 8px;
    }

    .weChatLoginButton {
        width: 190px;
    }

    #weChatLoginWindow {
        width: calc(100% - 32px);
        max-width: 380px;
    }

    .footer {
        font-size: 9px;
    }
}
