/**
 * 登录/注册系统样式
 */

/* 独立页面样式 */
body.auth-page {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #ffffff 0%, #e8f2ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.auth-page-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 认证容器 */
.auth-container {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.auth-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    padding: 40px;
    border: 1px solid #e1e5e9;
    position: relative;
    overflow: hidden;
}

.auth-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #44aefd 0%, #1480c1 100%);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-icon-wrapper {
    margin-bottom: 20px;
}

.auth-icon {
    font-size: 48px;
    color: #1480c1;
    background: linear-gradient(135deg, #44aefd 0%, #1480c1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.auth-header h2 {
    font-size: 28px;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.auth-header p {
    color: #666;
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

/* 表单样式 */
.auth-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group label i {
    color: #1480c1;
    font-size: 14px;
}

.form-group .required {
    color: #e74c3c;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #1480c1;
    box-shadow: 0 0 0 3px rgba(20, 128, 193, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #999;
    opacity: 0.7;
}

/* 密码输入框包装器 */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
    font-size: 16px;
    z-index: 10;
    pointer-events: auto;
    min-width: 32px;
    min-height: 32px;
}

.password-toggle:hover {
    color: #1480c1;
}

.password-toggle:focus {
    outline: 2px solid rgba(20, 128, 193, 0.3);
    outline-offset: 2px;
    border-radius: 3px;
}

/* 密码强度指示器 */
.password-strength {
    margin-top: 10px;
}

.password-strength-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    background: #e74c3c;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.password-strength-fill.weak {
    width: 33%;
    background: #e74c3c;
}

.password-strength-fill.medium {
    width: 66%;
    background: #f39c12;
}

.password-strength-fill.strong {
    width: 100%;
    background: #27ae60;
}

.form-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    font-size: 12px;
    color: #999;
}

.form-hint i {
    font-size: 12px;
}

.password-match-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #27ae60;
    font-weight: 500;
}

.password-match-hint i {
    font-size: 14px;
}

/* 邮箱验证码样式 */
.email-code-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.email-code-wrapper input {
    flex: 1;
    text-align: center;
    font-size: 18px;
    letter-spacing: 8px;
    font-weight: 600;
}

.send-code-btn {
    flex-shrink: 0;
    padding: 12px 20px;
    background: #1480c1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
}

.send-code-btn:hover:not(:disabled) {
    background: #0f6ba0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 128, 193, 0.3);
}

.send-code-btn:active:not(:disabled) {
    transform: translateY(0);
}

.send-code-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.send-code-btn .btn-text,
.send-code-btn .btn-countdown {
    display: inline-block;
}

.email-code-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.email-code-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.email-code-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-group-checkbox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.form-group-checkbox label {
    display: flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
}

.form-group-checkbox input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* 记住密码 - 唯一类，避免样式冲突 */
.auth-remember-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    width: 100%;
}

.auth-remember-label {
    display: flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-remember-checkbox {
    width: auto !important;
    height: auto !important;
    margin: 0 8px 0 0 !important;
    padding: 0 !important;
    border: 2px solid #ddd !important;
    border-radius: 3px !important;
    background: white !important;
    cursor: pointer !important;
    appearance: checkbox;
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.auth-remember-checkbox:focus {
    outline: 2px solid rgba(20, 128, 193, 0.3) !important;
    outline-offset: 2px !important;
    border-color: #1480c1 !important;
    box-shadow: none !important;
}

.auth-remember-checkbox:checked {
    background-color: #1480c1 !important;
    border-color: #1480c1 !important;
}

.auth-remember-text {
    font-size: 14px;
    color: #333;
    user-select: none;
}

.forgot-password-link {
    color: #1480c1;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.forgot-password-link:hover {
    color: #0f6ba0;
    text-decoration: underline;
}

/* 按钮样式 */
.auth-button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-button-primary {
    background: linear-gradient(135deg, #44aefd 0%, #1480c1 100%);
    color: #fff;
    gap: 8px;
}

.auth-button-primary:hover {
    background: linear-gradient(135deg, #1480c1 0%, #0f6ba0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 128, 193, 0.3);
}

.auth-button-primary .button-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-button-primary .button-text i {
    font-size: 14px;
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-loader {
    margin-left: 10px;
}

/* 验证码容器 */
.captcha-container {
    margin-bottom: 0;
}

.custom-captcha {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.custom-captcha-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-sizing: border-box;
    height: 50px;
}

.custom-captcha-image-wrapper {
    flex-shrink: 0;
    width: 150px;
    height: 50px;
    padding: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.custom-captcha-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.05) 100%);
    pointer-events: none;
    z-index: 1;
}

.custom-captcha-image-wrapper:hover {
    border-color: #1480c1;
    box-shadow: 0 0 0 2px rgba(20, 128, 193, 0.1);
}

.custom-captcha-image-wrapper:active {
    transform: scale(0.98);
}

.custom-captcha-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 0;
}

.custom-captcha-input:focus {
    outline: none;
    border-color: #1480c1;
    box-shadow: 0 0 0 2px rgba(20, 128, 193, 0.1);
}

/* Cloudflare Turnstile */
.cf-turnstile {
    margin-bottom: 20px;
}

/* 消息提示 */
.auth-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-message i {
    font-size: 18px;
}

.auth-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 页脚链接 */
.auth-footer {
    margin-top: 25px;
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
}

.auth-footer p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.auth-footer a {
    color: #1480c1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.auth-footer a:hover {
    color: #0f6ba0;
    text-decoration: underline;
}

/* 联系方式信息 */
.auth-contact-info {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.auth-contact-info p {
    margin: 8px 0;
    color: #666;
    font-size: 13px;
}

.auth-contact-info p:first-child {
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.auth-contact-info a {
    color: #1480c1;
    text-decoration: none;
    transition: color 0.3s;
}

.auth-contact-info a:hover {
    color: #0f6ba0;
    text-decoration: underline;
}

.auth-contact-info i {
    margin-right: 5px;
    color: #1480c1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .auth-container {
        padding: 0 15px;
    }
    
    .auth-box {
        padding: 30px 20px;
    }
    
    .auth-header h2 {
        font-size: 24px;
    }
    
    .auth-icon {
        font-size: 40px;
    }
    
    .form-group-checkbox {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .auth-remember-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .forgot-password-link {
        margin-top: 10px;
    }
    
    .custom-captcha {
        flex-direction: row;
        gap: 8px;
    }
    
    .custom-captcha-input {
        min-width: 150px;
        height: 45px;
        font-size: 14px;
    }
    
    .custom-captcha-image-wrapper {
        width: 150px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .auth-page-wrapper {
        padding: 10px;
    }
    
    .auth-box {
        padding: 25px 15px;
    }
    
    .auth-header h2 {
        font-size: 22px;
    }
    
    .auth-icon {
        font-size: 36px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .password-toggle {
        right: 10px;
        font-size: 14px;
    }
    
    .custom-captcha {
        flex-direction: column;
        gap: 10px;
    }
    
    .custom-captcha-input {
        width: 100%;
    }
    
    .custom-captcha-image-wrapper {
        width: 100%;
        height: 45px;
    }
}

