/**
 * 自定义登录页面样式
 */

html {
    box-sizing: border-box;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body.login {
    background: #f5f5f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* 隐藏默认 WordPress 登录 Logo */
body.login #login h1,
body.login #login h1 a {
    display: none;
}

/* 隐藏默认导航和返回链接 */
body.login #backtoblog,
body.login #nav,
body.login .language-switcher,
body.login .privacy-policy-page-link {
    display: none;
}

/* 隐藏错误消息中的忘记密码链接 */
body.login #login_error a[href*="lostpassword"],
body.login .login-error-message a[href*="lostpassword"] {
    display: none !important;
}

body.login #login {
    width: 100%;
    max-width: 420px;
    padding: 40px 20px;
}

.custom-login-wrapper {
    background: #fff;
    padding: 40px 30px;
    width: 100%;
    max-width: 380px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    margin-top: 50px;
}

.login form {
    border: 0px solid #c3c4c7;
    padding: 0px;
}

/* 登录标题 */
.login-title {
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 32px;
    margin-top: 0;
    letter-spacing: 1px;
}

.login-tabs {
    display: flex;
    gap: 24px;
    margin-bottom: 28px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 12px;
}

.login-tabs .tab {
    background: transparent;
    border: none;
    color: #999;
    font-size: 15px;
    padding: 8px 0;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.login-tabs .tab:hover {
    color: #666;
}

.login-tabs .tab.active {
    color: #1a1a1a;
    font-weight: 500;
}

.login-tabs .tab.active::after {
    content: '';
    position: absolute;
    bottom: -13px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #3b82f6;
}

/* 表单容器 - 固定高度防止切换抖动 */
.login-forms-container {
    min-height: 280px;
    position: relative;
}

.login-form {
    display: none;
    min-height: 240px;
}

.login-form.active {
    display: block;
}

.input-group {
    margin-bottom: 16px;
    position: relative;
}

/* 通用输入框样式 */
.login-form input[type="text"],
.login-form input[type="tel"],
.login-form input[type="password"],
.login-form input[type="email"] {
    width: 100%;
    height: 48px;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 0 16px;
    color: #1a1a1a;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    margin: 0;
    /* 覆盖 WordPress 默认的 margin-bottom: 16px */
}

.login-form input::placeholder {
    color: #999;
}

.login-form input:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 确保输入框可用 */
.login-form input:not([type="hidden"]) {
    pointer-events: auto !important;
}

/* 手机号输入 - 带国家码 */
.phone-input {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.phone-input .country-code {
    color: #1a1a1a;
    font-size: 14px;
    padding: 0 12px 0 16px;
    border-right: 1px solid #e5e5e5;
    height: 48px;
    line-height: 48px;
    flex-shrink: 0;
    background: #f0f0f0;
}

.phone-input input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding-left: 12px !important;
}

/* 验证码输入 */
.code-input {
    display: flex;
    gap: 12px;
}

.code-input input {
    flex: 1;
}

.get-code-btn {
    flex-shrink: 0;
    height: 48px;
    padding: 0 16px;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    color: #3b82f6;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.get-code-btn:hover:not(:disabled) {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.get-code-btn:disabled {
    color: #999;
    cursor: not-allowed;
}

.agreement {
    color: #999;
    font-size: 12px;
    margin: 20px 0;
    line-height: 1.6;
}

.agreement a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.agreement a:hover {
    color: #2563eb;
}

.login-error-container {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.login-error-message {
    color: #dc2626;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.submit-btn {
    width: 100%;
    height: 48px;
    background: #3b82f6;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #2563eb;
}

.submit-btn:active {
    transform: scale(0.98);
}

body.login #loginform {
    display: none !important;
}

/* 错误/消息提示样式覆盖 */
body.login .notice,
body.login #login_error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

body.login .message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

/* 隐藏大写锁定警告图标和所有 dashicons */
.wp-pwd .pw-weak,
.wp-pwd .button.wp-hide-pw,
.login .dashicons-warning,
.login .message.notice-warning,
body.login .dashicons,
body.login .dashicons-arrow-up-alt,
body.login .wp-pwd .dashicons,
body.login #login .dashicons,
body.login .user-pass-wrap .dashicons,
body.login .wp-core-ui .dashicons,
body.login [class*="dashicons"] {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    font-size: 0 !important;
}

/* 隐藏密码强度指示和其他辅助元素 */
#pass-strength-result,
body.login .indicator-hint,
body.login .pw-hint,
body.login .wp-pwd-notice {
    display: none !important;
}

/* 隐藏大写锁定警告容器 */
#caps-warning,
.caps-warning,
.caps-icon,
.caps-warning-text {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}


body.login #login,
body.login #login form,
body.login .custom-login-wrapper,
body.login #loginform {
    animation: none !important;
    -webkit-animation: none !important;
    -moz-animation: none !important;
    transform: none !important;
    -webkit-transform: none !important;
}

/* 覆盖 WordPress shake 关键帧 */
@keyframes shake {

    0%,
    100% {
        transform: none;
    }
}

/* 注册链接样式 */
.register-link {
    text-align: center;
    margin-top: 16px;
    margin-bottom: 0;
    color: #999;
    font-size: 14px;
}

.register-link a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: #2563eb;
}

/* 注册表单样式 */
.register-form {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 注册成功提示 */
.register-success {
    text-align: center;
    padding: 20px 0;
}

.register-success .success-icon {
    width: 60px;
    height: 60px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.register-success .success-icon::before {
    content: '✓';
    color: #fff;
    font-size: 28px;
    font-weight: bold;
}

.register-success h3 {
    color: #1a1a1a;
    font-size: 18px;
    margin: 0 0 8px;
}

.register-success p {
    color: #666;
    font-size: 14px;
    margin: 0 0 20px;
}

@media screen and (max-width: 480px) {
    body.login #login {
        padding: 20px 16px;
    }

    .custom-login-wrapper {
        padding: 30px 20px;
        width: 100%;
    }

    .login-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .login-tabs {
        gap: 16px;
    }

    .code-input {
        flex-direction: column;
        gap: 12px;
    }

    .get-code-btn {
        width: 100%;
    }
}