/* ========================================
   AJAX Login / Register Popup
   ======================================== */

   .login-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.login-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.login-popup {
    position: fixed;
    z-index: 10000000;
    top: 50%;
    left: 50%;
    width: 820px;
    max-width: 94vw;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
    padding: 0;
}

.login-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.login-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
    z-index: 2;
}

.login-popup-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* === 双栏布局 === */
.login-popup-layout {
    display: flex;
    min-height: 400px;
}

.login-popup-left {
    width: 54%;
    flex-shrink: 0;
    padding: 50px 70px;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border-radius: 16px 0 0 16px;
}

.login-popup-right {
    flex: 1;
    padding: 44px 36px 32px;
}

/* 品牌 */
.login-popup-brand {
    font-size: 22px;
    font-weight: 800;
    color: #ff6a00;
    margin-bottom: 28px;
    letter-spacing: 0.5px;
}

/* 左栏文案 */
.login-popup-promo {
    font-size: 12px;
    color: #666;
    line-height: 1.7;
    margin-bottom: 20px;
    margin-top: auto;
}

.login-popup-switch-text {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
}

.login-popup-switch-text a {
    color: #ff6a00;
    font-weight: 600;
    text-decoration: none;
}

.login-popup-switch-text a:hover {
    text-decoration: underline;
}

/* 右栏表单 */
.login-popup-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-popup .login-popup-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #f8f8f8;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.login-popup-input:focus {
    border-color: #ff6a00;
    background: #fff;
}

.login-popup-input::placeholder {
    color: #aaa;
}

.login-popup-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 50px;
    background: #ff6a00;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 4px;
}

.login-popup-submit:hover { background: #e55d00; }
.login-popup-submit:active { transform: scale(0.98); }
.login-popup-submit:disabled { background: #ccc; cursor: not-allowed; }

/* 分隔线 */
.login-popup-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #aaa;
    font-size: 13px;
}

.login-popup-divider::before,
.login-popup-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e5e5;
}

/* 社交登录 */
.login-popup-social {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
}

.login-popup .login-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f8f8;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.login-popup .login-social-btn:hover {
    background: #f9f9f9;
    border-color: #ccc;
}

.login-social-btn img {
    width: 18px;
    height: 18px;
}

.login-social-or {
    color: #aaa;
    font-size: 13px;
}

/* 法律文案 */
.login-popup-legal {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #aaa;
    line-height: 1.5;
    font-weight: 400;
}

.login-popup-legal a {
    color: #888;
    text-decoration: underline;
}

/* 消息 */
.login-popup-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
    margin-bottom: 10px;
}

.login-popup-msg.error {
    display: block;
    background: #fff5f5;
    color: #d63031;
    border: 1px solid #ffdddd;
}

.login-popup-msg.success {
    display: block;
    background: #f0fff4;
    color: #27ae60;
    border: 1px solid #c3e6cb;
}

/* 视图切换 */
.login-popup-view { display: none; }
.login-popup-view.active { display: block; }

/* 已登录 */
.login-popup-logged-in {
    text-align: center;
    padding: 40px 36px;
}

.login-popup-logged-in p {
    font-size: 15px;
    color: #333;
    margin-bottom: 16px;
}

.login-popup-logged-in a {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.login-popup-account-btn {
    background: #ff6a00;
    color: #fff !important;
    margin: 4px;
}

.login-popup-account-btn:hover { background: #e55d00; }

.login-popup-logout-btn {
    background: #f0f0f0;
    color: #555 !important;
}

.login-popup-logout-btn:hover { background: #e5e5e5; }

/* 验证码行 */
.login-code-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.login-code-row .login-code-input {
    flex: 1;
    min-width: 0;
}

.login-send-code-btn {
    flex-shrink: 0;
    padding: 0 20px;
    border: none;
    border-radius: 8px;
    background: #1a1a1a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
    min-width: 100px;
}

.login-send-code-btn:hover { background: #333; }
.login-send-code-btn:active { transform: scale(0.97); }
.login-send-code-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* 触发按钮 */
.login-trigger-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.15s;
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 50px;
    overflow: hidden;
}

.login-trigger-btn:hover { opacity: 0.7; }

.login-trigger-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50%;
    object-fit: contain;
    vertical-align: middle;
}

/* 移动端：单栏 */
@media (max-width: 680px) {
    .login-popup {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        top: auto;
        bottom: 0;
        left: 0;
        transform: translateY(100%);
        max-height: 92vh;
    }
    .login-popup.active {
        transform: translateY(0);
    }
    .login-popup-layout {
        flex-direction: column;
    }
    .login-popup-left {
        width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 28px 24px 20px;
    }
    .login-popup-right {
        padding: 20px 24px 28px;
    }
    .login-popup-promo {
        margin-bottom: 12px;
    }
    .login-popup-switch-text {
        margin-top: 0;
    }
}
