/* CSS Document - 手机/微信/实名三卡登录统一样式 */
/* 文件名：/static/css/login/mobilephone_login.css */
/* 版本：v2.0 - 整合三卡登录样式 */
/* 最后更新：2026-02-05 */

/* ==================== 基础变量与重置 ==================== */
:root {
    --primary-color: #6e6edf;
    --primary-hover: #5a5ac1;
    --wechat-green: #07C160;
    --wechat-green-hover: #06ad56;
    --success-color: #52c41a;
    --error-color: #ff4d4f;
    --info-color: #007bff;
    --warning-color: #faad14;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

/* ==================== 修复宽度问题的关键样式 ==================== */

/* 确保body是flex容器 */
body {
    background-color: var(--bg-light);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.5;
    margin: 0;  /* 确保没有默认边距 */
}

/* 给JS渲染的容器设置宽度约束 */
#login-app {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 修复登录容器宽度 */
.login-container {
    background-color: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;           /* ✅ 必须添加 */
    max-width: 420px;      /* 限制最大宽度 */
    padding: 40px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin: 0 auto;        /* 备用居中 */
}

/* 移动端适配优化 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    #login-app {
        width: 100%;
    }
    
    .login-container {
        padding: 30px 20px;
        max-width: 100%;    /* 移动端允许全宽 */
        margin: 0;
    }
}

}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}


/* ==================== 头部区域 ==================== */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.4;
}

/* ==================== 登录类型切换 ==================== */
.login-type-switch {
    text-align: right;
    margin-bottom: 24px;
    font-size: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.login-type-switch a {
    display: inline-block;
    text-decoration: none;
    color: var(--info-color);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.login-type-switch a:hover {
    background-color: rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.login-type-switch a.current {
    font-weight: 600;
    color: var(--text-color);
    background-color: var(--bg-light);
    cursor: default;
}

.login-type-switch a.current:hover {
    transform: none;
    background-color: var(--bg-light);
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group label strong {
    font-weight: 600;
}

.form-group label font[color="red"] {
    color: var(--error-color);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-wrapper input[type="text"],
.input-wrapper input[type="tel"],
.input-wrapper input[type="password"],
.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: var(--bg-white);
}

.input-wrapper input:focus,
.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(110, 110, 223, 0.1);
}

.input-wrapper input.error,
.form-group input.error {
    border-color: var(--error-color);
}

/* ==================== 验证码相关 ==================== */
.get-code-btn {
    position: absolute;
    right: 8px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

.get-code-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.get-code-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 验证码容器 */
.captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-wrapper input[type="text"] {
    flex: 1;
    min-width: 120px;
}

.captcha-wrapper img {
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.captcha-wrapper img:hover {
    opacity: 0.8;
}

/* ==================== 提交按钮 ==================== */
.submit-btn,
.wechat-login-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: block;
    margin-top: 10px;
}

.submit-btn {
    background-color: var(--primary-color);
    color: white;
}

.submit-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(110, 110, 223, 0.2);
}

.wechat-login-btn {
    background-color: var(--wechat-green);
    color: white;
    margin-bottom: 20px;
}

.wechat-login-btn:hover {
    background-color: var(--wechat-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.2);
}

.submit-btn:disabled,
.wechat-login-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==================== 加载状态 ==================== */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 错误消息 ==================== */
.error-message {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
    display: none;
    line-height: 1.4;
}

/* ==================== 分隔线 ==================== */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #999;
    font-size: 14px;
    text-align: center;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.divider::before {
    margin-right: 16px;
}

.divider::after {
    margin-left: 16px;
}

/* ==================== 微信二维码区域 ==================== */
.wechat-login {
    text-align: center;
    margin-top: 20px;
}

.wechat-login p {
    margin-bottom: 16px;
    color: var(--text-light);
    font-size: 14px;
}

.wechat-qrcode {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    background-color: var(--bg-white);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 10px;
    transition: transform 0.3s ease;
}

.wechat-qrcode:hover {
    transform: scale(1.02);
}

.wechat-qrcode img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
}

/* ==================== 实名认证相关样式 ==================== */
.auth-redirect-modal {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.auth-redirect-modal h3 {
    color: #0066cc;
    margin-bottom: 10px;
    font-size: 18px;
}

.auth-redirect-modal p {
    color: var(--text-color);
    margin-bottom: 15px;
    line-height: 1.5;
}

.auth-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.progress-step {
    display: flex;
    align-items: center;
    color: #666;
    margin: 5px;
}

.progress-step.active {
    color: var(--info-color);
    font-weight: 600;
}

.progress-step .step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ddd;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 12px;
    font-weight: 600;
}

.progress-step.active .step-number {
    background: var(--info-color);
}

.progress-arrow {
    margin: 0 10px;
    color: #999;
    font-size: 14px;
}

.countdown {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-light);
    font-style: italic;
}

/* ==================== AJAX加载容器 ==================== */
#ajaxRelevancyContainer {
    display: none;
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    background: var(--bg-light);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-content {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--info-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto 20px;
}

/* ==================== 调试信息 ==================== */
.debug-info {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 4px;
    border-left: 3px solid var(--info-color);
    display: none;
}

.debug-info p {
    margin: 5px 0;
}

.debug-info strong {
    color: var(--text-color);
}

/* ==================== 自定义弹窗样式 ==================== */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: var(--bg-white);
    width: 100%;
    max-width: 320px;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
    line-height: 1.4;
}

.modal-message {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 24px;
    line-height: 1.5;
    word-break: break-word;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 80px;
}

.modal-btn-confirm {
    background: var(--info-color);
    color: white;
}

.modal-btn-confirm:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.modal-btn-confirm:active {
    transform: translateY(0);
}

.modal-btn-cancel {
    background: #f8f9fa;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.modal-btn-cancel:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.modal-btn-cancel:active {
    transform: translateY(0);
}

/* 单按钮居中样式 */
.modal-single-btn .modal-buttons {
    justify-content: center;
}

.modal-single-btn .modal-btn {
    max-width: 120px;
}

/* 模态框状态颜色 */
.modal-success .modal-title {
    color: var(--success-color);
}

.modal-success .modal-btn-confirm {
    background: var(--success-color);
}

.modal-error .modal-title {
    color: var(--error-color);
}

.modal-error .modal-btn-confirm {
    background: var(--error-color);
}

.modal-info .modal-title {
    color: var(--info-color);
}

.modal-info .modal-btn-confirm {
    background: var(--info-color);
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 480px) {
    .login-header h1 {
        font-size: 20px;
    }

    .login-type-switch {
        text-align: right;  /* 添加这行 */
        font-size: 14px;
    }

    .login-type-switch a {
        margin: 0 4px;
        padding: 4px 8px;
    }

    .input-wrapper input,
    .form-group input[type="text"],
    .form-group input[type="password"] {
        padding: 10px 14px;
        font-size: 16px; /* 防止iOS缩放 */
    }

    .get-code-btn {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 70px;
    }

    .wechat-qrcode {
        width: 150px;
        height: 150px;
    }

    .captcha-wrapper img {
        height: 36px;
    }

    .modal-content {
        padding: 20px 16px;
        max-width: 280px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .modal-btn {
        width: 100%;
    }

    .submit-btn,
    .wechat-login-btn {
        padding: 12px;
        font-size: 15px;
    }

    .auth-progress {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-arrow {
        transform: rotate(90deg);
        margin: 5px 0;
    }
}

/* ==================== 辅助类 ==================== */
.text-center {
    text-align: center;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ==================== 打印样式 ==================== */
@media print {
    .login-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .get-code-btn,
    .submit-btn,
    .wechat-login-btn,
    .login-type-switch,
    .wechat-login {
        display: none;
    }
}