/* 1688 跨境登录页面样式 */

/* 重置和基础样式 */
.cb-login-page-wrapper {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* 背景图会通过 wp_head 中注入的动态样式覆盖 */
}

.cb-login-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 480px;
    min-width: 300px;
    padding: 40px;
    border: 2px solid #ff5722;
    /* 自適应容器的最小宽度 */
    box-sizing: border-box;
}

/* Logo 和标题 */
.cb-login-header {
    text-align: center;
    margin-bottom: 30px;
}

.cb-login-logo {
    margin-bottom: 15px;
}

.cb-login-logo img {
    height: auto;
    max-height: 80px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.cb-login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #333333;
    margin: 0;
    letter-spacing: 0.5px;
}

.cb-login-description {
    font-size: 14px;
    color: #999999;
    margin-top: 10px;
    margin-bottom: 0;
    line-height: 1.5;
}

/* 选项卡 */
.cb-login-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #eeeeee;
}

.cb-login-tab {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #999999;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    top: 2px;
}

.cb-login-tab:hover {
    color: #ff5722;
}

.cb-login-tab.active {
    color: #ff5722;
    border-bottom-color: #ff5722;
}

/* 表单 */
.cb-login-form {
    width: 100%;
}

.cb-login-panel {
    display: none;
}

.cb-login-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* 表单组 */
.cb-form-group {
    margin-bottom: 15px;
}

.cb-form-input {
    width: 100%;
    height: 44px;
    padding: 0 15px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333333;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.cb-form-input:focus {
    outline: none;
    border-color: #ff5722;
    box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1);
}

.cb-form-input::placeholder {
    color: #cccccc;
}

/* 密码输入框 */
.cb-password-input-wrapper {
    position: relative;
}

.cb-password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999999;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cb-password-toggle:hover {
    color: #ff5722;
}

/* 图文验证 */
.cb-captcha-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.cb-captcha-input {
    grid-column: 1;
}

.cb-captcha-img {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.cb-captcha-img img {
    width: 100px;
    height: 44px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    cursor: pointer;
    background: #f9f9f9;
    object-fit: cover;
}

.cb-captcha-refresh {
    padding: 4px 10px;
    font-size: 12px;
    border: none;
    background: none;
    color: #ff5722;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cb-captcha-refresh:hover {
    text-decoration: underline;
}

/* 短信验证码组 */
.cb-sms-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.cb-sms-input {
    grid-column: 1;
}

.cb-sms-send-btn {
    grid-column: 2;
    height: 44px;
    padding: 0 15px;
    background: #ffffff;
    border: 1px solid #ff5722;
    color: #ff5722;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cb-sms-send-btn:hover {
    background: #ff5722;
    color: #ffffff;
}

.cb-sms-send-btn:disabled {
    border-color: #cccccc;
    color: #999999;
    cursor: not-allowed;
    background: #f5f5f5;
}

/* 帮助链接 */
.cb-login-help-links {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    font-size: 12px;
}

.cb-help-link {
    color: #999999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cb-help-link:hover {
    color: #ff5722;
    text-decoration: underline;
}

/* 登录按钮 */
.cb-login-submit-btn {
    width: 100%;
    height: 48px;
    background: #ff5722;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 0;
}

.cb-login-submit-btn:hover {
    background: #e64a19;
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.3);
}

.cb-login-submit-btn:active {
    transform: translateY(1px);
}

.cb-login-submit-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* 加载状态 */
.cb-login-loading {
    text-align: center;
    padding: 20px;
}

.cb-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff5722;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cb-login-loading p {
    font-size: 14px;
    color: #666666;
    margin: 0;
}

/* 错误提示 */
.cb-login-error {
    background: #ffebee;
    color: #c62828;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 15px;
    border-left: 3px solid #c62828;
}

/* 底部提示 */
.cb-login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eeeeee;
    font-size: 12px;
    color: #999999;
}

.cb-login-footer p {
    margin: 5px 0;
}

.cb-login-disclaimer {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .cb-login-container {
        padding: 30px 20px;
        border-radius: 0;
    }

    .cb-login-header h1 {
        font-size: 20px;
    }

    .cb-login-logo img {
        height: 50px;
    }

    .cb-form-input {
        height: 40px;
        font-size: 16px; /* 防止 iOS 自动缩放 */
    }

    .cb-login-submit-btn {
        height: 44px;
        font-size: 15px;
    }

    .cb-login-help-links {
        flex-wrap: wrap;
        gap: 10px;
    }

    .cb-captcha-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cb-captcha-img {
        grid-column: 1;
        flex-direction: row;
        justify-content: space-between;
    }

    .cb-captcha-img img {
        flex: 1;
    }
}

/* 禁用状态 */
.cb-form-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #999999;
}

/* 聚焦状态增强 */
input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible {
    outline: none;
}

/* 记住我复选框样式 */
.cb-remember-me-group {
    margin: 0 0 20px 0;
    padding: 0;
}

.cb-remember-me-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #666;
}

.cb-remember-me-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #ff4d4f;
}

.cb-remember-me-label:hover span {
    color: #333;
}

.cb-remember-me-label input[type="checkbox"]:checked + span {
    color: #333;
    font-weight: 500;
}
