/* style.css - 统一身份认证登录样式 v2.2 */
/* ===== 触发按钮 ===== */
.login-trigger-btn {
    padding: 10px 28px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    font-family: inherit;
    letter-spacing: 0.3px;
}

.login-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #4338ca, #6d28d9);
}

/* 已登录用户欢迎 */
.user-welcome {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px 6px 6px;
    background: #f8fafc;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
}

.user-welcome .user-avatar img {
    border-radius: 50%;
    vertical-align: middle;
}

.user-welcome .user-name {
    font-weight: 500;
    color: #1e293b;
    font-size: 14px;
}

.user-welcome .logout-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}

.user-welcome .logout-link:hover {
    background: #f1f5f9;
    color: #ef4444;
}

/* ===== 弹窗遮罩 ===== */
.login-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.login-modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== 弹窗主体 ===== */
.login-modal {
    position: relative;
    width: 90%;
    max-width: 880px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #0f172a;
    transform: rotate(90deg);
}

.modal-container {
    display: flex;
    min-height: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

/* ===== 左侧品牌区 ===== */
.brand-panel {
    flex: 0 0 42%;
    background: linear-gradient(145deg, #f8fafc, #f1f5f9);
    padding: 45px 30px;
    display: flex;
    align-items: center;
    border-right: 1px solid #e2e8f0;
}

.brand-content {
    width: 100%;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.brand-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
}

.brand-logo-text {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.brand-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-slogan {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 28px 0;
    padding-left: 14px;
    border-left: 3px solid #4f46e5;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #334155;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #e0e7ff;
    border-radius: 50%;
    color: #4f46e5;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ===== 右侧表单区 ===== */
.form-panel {
    flex: 1;
    padding: 40px 32px;
    display: flex;
    align-items: center;
    background: #ffffff;
}

.form-wrapper {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

/* 模式切换标签 */
.mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.tab-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.tab-btn:hover {
    background: rgba(79, 70, 229, 0.05);
}

.tab-btn.active {
    background: #4f46e5;
    color: #fff;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3);
}

/* 表单切换 */
.form-content {
    display: none;
}

.form-content.active {
    display: block;
    animation: slideUp 0.3s ease;
}

/* 表单元素 */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 4px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fafbfc;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group input:focus {
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

/* ===== 密码强度指示器 ===== */
.password-strength {
    margin-top: 6px;
    padding: 4px 0;
}

.strength-bar {
    display: block;
    height: 4px;
    width: 0%;
    border-radius: 4px;
    background: #e2e8f0;
    transition: all 0.3s ease;
}

.strength-text {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.strength-text #strength-label {
    font-weight: 500;
}

/* 密码强度颜色 */
.strength-0 .strength-bar {
    width: 0%;
    background: #e2e8f0;
}
.strength-0 #strength-label {
    color: #64748b;
}

.strength-1 .strength-bar {
    width: 25%;
    background: #ef4444;
}
.strength-1 #strength-label {
    color: #ef4444;
}

.strength-2 .strength-bar {
    width: 50%;
    background: #f59e0b;
}
.strength-2 #strength-label {
    color: #f59e0b;
}

.strength-3 .strength-bar {
    width: 75%;
    background: #3b82f6;
}
.strength-3 #strength-label {
    color: #3b82f6;
}

.strength-4 .strength-bar {
    width: 100%;
    background: #22c55e;
}
.strength-4 #strength-label {
    color: #22c55e;
}

/* ===== 验证码 ===== */
.captcha-group {
    margin-bottom: 16px;
}

.captcha-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 4px;
}

.captcha-row {
    width: 100%;
}

.captcha-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.captcha-wrapper input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fafbfc;
    transition: all 0.2s;
    outline: none;
    font-family: inherit;
}

.captcha-wrapper input:focus {
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.captcha-image {
    flex: 0 0 80px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 10px;
    font-family: "Courier New", monospace;
    font-size: 22px;
    font-weight: 700;
    color: #a5b4fc;
    letter-spacing: 6px;
    user-select: none;
    cursor: pointer;
    transition: all 0.2s;
}

.captcha-image:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.options {
    margin: 14px 0 18px 0;
    font-size: 13px;
}

.options label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    cursor: pointer;
}

.options label input[type="checkbox"] {
    accent-color: #4f46e5;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
    display: block;
    text-align: center;
    box-shadow: 0 2px 12px rgba(79, 70, 229, 0.25);
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.35);
    background: linear-gradient(135deg, #4338ca, #6d28d9);
}

.submit-btn:active {
    transform: translateY(0);
}

/* 消息提示 */
.message {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

.message.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.message.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .modal-container {
        flex-direction: column;
        min-height: auto;
        max-height: 90vh;
    }
    
    .brand-panel {
        flex: none;
        padding: 24px 20px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        min-height: 120px;
    }
    
    .brand-header {
        margin-bottom: 8px;
    }
    
    .brand-title {
        font-size: 17px;
    }
    
    .brand-logo-img,
    .brand-logo-text {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .brand-slogan {
        font-size: 13px;
        margin-bottom: 16px;
        padding-left: 12px;
    }
    
    .brand-features {
        flex-direction: row;
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .feature {
        font-size: 13px;
    }
    
    .form-panel {
        padding: 24px 20px;
    }
    
    .form-wrapper {
        max-width: 100%;
    }
    
    .login-modal {
        width: 95%;
        max-height: 95vh;
    }
}

@media (max-width: 480px) {
    .login-modal {
        width: 100%;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .modal-container {
        max-height: 100vh;
    }
    
    .brand-panel {
        padding: 16px 14px;
        min-height: 90px;
    }
    
    .brand-title {
        font-size: 15px;
    }
    
    .brand-logo-img,
    .brand-logo-text {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .brand-slogan {
        font-size: 12px;
        margin-bottom: 10px;
        padding-left: 10px;
    }
    
    .brand-features {
        gap: 8px;
    }
    
    .feature {
        font-size: 12px;
        gap: 6px;
    }
    
    .feature-icon {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
    
    .form-panel {
        padding: 16px 14px;
    }
    
    .mode-tabs .tab-btn {
        font-size: 13px;
        padding: 8px 0;
    }
    
    .captcha-image {
        flex: 0 0 65px;
        height: 38px;
        font-size: 18px;
        letter-spacing: 4px;
    }
}