/**
 * Custom Auth Forms - 统一样式
 */

.auth-form { width: 100%; max-width: 100%; margin: 30px auto; padding: 20px; box-sizing: border-box; }
.auth-form .caf-form-row { margin-bottom: 20px; }
.auth-form .caf-form-row label { display: block; margin-bottom: 8px; font-weight: 400; color: #0c0c0c; font-family: 'Work Sans', sans-serif; }
.auth-form input[type="text"], .auth-form input[type="email"], .auth-form input[type="tel"], .auth-form input[type="password"] { width: 100%; padding: 14px 28px; border: 0.5px solid #dddddd; border-radius: 4px; font-size: 15px; font-family: 'Work Sans', sans-serif; transition: all 0.3s; box-sizing: border-box; background-color: #fff !important; }
.auth-form input:focus { border-color: #ae99ca; outline: none; box-shadow: 0 0 0 2px rgba(174, 153, 202, 0.2); }

/* 覆盖浏览器 autofill 蓝色背景 */
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #0c0c0c !important;
    caret-color: #0c0c0c;
    background-color: #ffffff !important;
    background-clip: content-box !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

.auth-form .password-wrapper { position: relative; }
.auth-form .toggle-password { background: transparent !important; border: none !important; outline: none !important; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #ae99ca; padding: 0 !important; margin: 0 !important; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.auth-form .toggle-password:hover { color: #8667b0; }
.auth-form .toggle-password .eye-open, .auth-form .toggle-password .eye-closed { display: block; width: 20px; height: 20px; }
.auth-form .toggle-password .eye-closed { display: none; }
.auth-form .caf-remember-row { display: flex; align-items: center; }
.auth-form .caf-remember-row input { width: auto; margin-right: 8px; }
.auth-form .caf-remember-row label { margin: 0; font-weight: 400; }
.auth-form .caf-button { width: 100%; padding: 14px 28px; background: #ae99ca !important; color: #ffffff !important; border: 2px solid #ae99ca !important; border-radius: 10px; font-size: 15px; font-weight: 600; font-family: 'Work Sans', sans-serif; cursor: pointer; transition: all 0.3s; text-shadow: none !important; }
.auth-form .caf-button:hover { background: #8667b0 !important; border-color: #8667b0 !important; color: #ffffff !important; }
.auth-form .caf-form-footer { margin-top: 20px; padding-top: 15px; border-top: 1px solid #eeeeee; text-align: center; font-size: 14px; }
.auth-form .caf-form-footer a { color: #ae99ca; text-decoration: none; transition: color 0.3s; }
.auth-form .caf-form-footer a:hover { color: #8667b0; text-decoration: underline; }
.auth-form .caf-separator { color: #dddddd; margin: 0 10px; }
.auth-form .caf-message { padding: 10px; border-radius: 4px; margin-bottom: 20px; }
.auth-form .caf-message.caf-success { background: #dff0d8; border: 1px solid #d6e9c6; color: #3c763d; }
.auth-form .caf-message.caf-error { background: #f2dede; border: 1px solid #ebccd1; color: #a94442; }
.auth-form .caf-password-strength { margin-top: 10px; padding: 8px; border-radius: 4px; font-size: 14px; }
.auth-form .caf-password-strength.caf-weak { background: #f8d7da; color: #721c24; }
.auth-form .caf-password-strength.caf-medium { background: #fff3cd; color: #856404; }
.auth-form .caf-password-strength.caf-strong { background: #d4edda; color: #155724; }
.auth-form .caf-password-hint { margin-top: 8px; font-size: 13px; color: #666; }
.auth-form .caf-hint { font-weight: 400; color: #999; }
.auth-form .caf-form-row-inline { display: flex; gap: 20px; }
.auth-form .caf-form-row-inline .caf-form-group { flex: 1; }

/* 注册成功汇总卡片 */
.register-success-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 40px;
    text-align: center;
    max-width: none !important;
    width: 100% !important;
}

.success-header {
    margin-bottom: 30px;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.success-title {
    font-size: 24px;
    color: #0c0c0c;
    margin: 0 0 10px 0;
    font-family: 'Work Sans', sans-serif;
}

.success-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.success-summary {
    background: none !important;
    border-radius: 6px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: left;
}

.summary-title {
    font-size: 16px;
    color: #0c0c0c;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #ae99ca;
    font-family: 'Work Sans', sans-serif;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: #666;
    font-weight: 500;
}

.summary-value {
    color: #0c0c0c;
    font-weight: 600;
    text-align: right;
}

.summary-logged-in .summary-value {
    color: #28a745;
}

.status-logged-in {
    color: #28a745;
}

.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.success-actions .btn {
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    color: #ffffff !important;  /* 强制白色文字，覆盖全局链接样式 */
}

.success-actions .btn-primary {
    background: #ae99ca !important;
    color: #ffffff !important;
    border: 2px solid #ae99ca !important;
    text-shadow: none !important;
}

.success-actions .btn-primary:hover {
    background: #8667b0 !important;
    border-color: #8667b0 !important;
    color: #ffffff !important;
}

.success-actions .btn-secondary {
    background: #ffffff !important;
    color: #ae99ca !important;
    border: 2px solid #ae99ca !important;
    text-shadow: none !important;
}

.success-actions .btn-secondary:hover {
    background: #ae99ca !important;
    color: #ffffff !important;
    border-color: #ae99ca !important;
}

@media (max-width: 480px) {
    .success-actions {
        flex-direction: column;
    }
    
    .summary-item {
        flex-direction: column;
        gap: 5px;
    }
    
    .summary-value {
        text-align: left;
    }
}

/* 用户资料表单 */
.custom-profile-form {
    width: 100%;
    max-width: 100%;
    margin: 40px auto;
    box-sizing: border-box;
}

.profile-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ae99ca;
}

.profile-title {
    font-size: 20px;
    color: #0c0c0c;
    margin: 0;
    font-family: 'Work Sans', sans-serif;
}

.input-disabled {
    background-color: #f5f5f5 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.caf-select {
    width: 100%;
    padding: 14px 28px;
    border: 0.5px solid #dddddd;
    border-radius: 4px;
    font-size: 15px;
    font-family: 'Work Sans', sans-serif;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.caf-select:focus {
    border-color: #ae99ca;
    outline: none;
    box-shadow: 0 0 0 2px rgba(174, 153, 202, 0.2);
}

.profile-meta { margin-bottom: 30px !important;
    background: none !important;
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
    font-size: 13px;
}

.meta-label {
    color: #666;
    font-weight: 500;
    margin-right: 10px;
}

.meta-value {
    color: #0c0c0c;
    font-weight: 600;
}

.profile-login-links {
    margin-top: 25px;
    text-align: center;
    font-size: 14px;
    color: #666;
}

.profile-login-links a {
    color: #ae99ca;
    text-decoration: none;
    transition: color 0.3s;
}

.profile-login-links a:hover {
    color: #8667b0;
    text-decoration: underline;
}

/* 注册时间区域增加底部间距 */
.profile-meta { margin-bottom: 30px !important;
    margin-bottom: 25px;
}

/* 保存按钮增加顶部间距 */
.profile-form .caf-button {
    margin-top: 10px;
}

/* 强制增加间距 */
.custom-profile-form .profile-meta {
    margin-bottom: 30px !important;
    margin-top: 20px !important;
}

.custom-profile-form .caf-button {
    margin-top: 15px !important;
}

/* 空行间距 */
.caf-form-spacer {
    height: 25px;
    display: block;
}

/* 注册成功按钮文字颜色 */


/* 修复性别选择框显示问题 */
.caf-select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 12px !important;
    padding-right: 40px !important;
    display: block !important;
}

/* 修复选择框在移动端的显示 */
@media (max-width: 768px) {
    .caf-select {
        font-size: 16px !important;
    }
}

/* 头像区域 */
.profile-avatar-section {
    text-align: center;
    margin: 30px 0;
    padding: 25px;
    background: none !important;
    border-radius: 0 !important;
}

.avatar-preview {
    margin-bottom: 20px;
}

.avatar-preview img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ae99ca;
    box-shadow: 0 4px 12px rgba(174, 153, 202, 0.3);
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.avatar-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #ae99ca;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 600;
}

.avatar-upload-btn:hover {
    background: #8667b0;
    transform: translateY(-2px);
}

.avatar-hint {
    font-size: 12px;
    color: #999;
    margin: 0;
}

/* 头像预览脚本 */

/* 修复性别选择框下拉显示问题 */
.caf-select {
    position: relative !important;
    z-index: 100 !important;
    overflow: visible !important;
}

.caf-select:focus {
    z-index: 1000 !important;
}

/* 修复选择框父容器 overflow */
.caf-form-group {
    overflow: visible !important;
}

.caf-form-row {
    overflow: visible !important;
}

/* 优化更换头像按钮样式 */
.avatar-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ae99ca 0%, #9a85b8 100%);
    color: #fff !important;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(174, 153, 202, 0.3);
    border: none;
}

.avatar-upload-btn:hover {
    background: linear-gradient(135deg, #8667b0 0%, #9a85b8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(134, 103, 176, 0.4);
}

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

.avatar-upload-btn svg {
    width: 14px;
    height: 14px;
}

/* 性别选择框居中显示 */
select[name="gender"] {
    display: block !important;
    margin: 0 auto !important;
    left: 0 !important;
    right: 0 !important;
    text-align: left !important;
    
    -webkit-
    -moz-
}

/* 确保选择框选项正常显示 */
select[name="gender"] option {
    text-align: left !important;
}

/* 强制日期输入框显示英文格式 */
input[type="date"] {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

input[type="date"]::-webkit-datetime-edit {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-calendar-picker-indicator {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* 性别选择框最终修复 */
select[name="gender"] {
    display: block !important;
    width: 100% !important;
    padding: 14px 40px 14px 28px !important;
    box-sizing: border-box !important;
    text-align: left !important;
    background-position: right 20px center !important;
}

/* 性别选择框边距修复 */
select[name="gender"] {
    padding-left: 15px !important;
    padding-right: 35px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
/* 性别选择框 - 最终修复方案 */
select[name="gender"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 35px 12px 15px !important;
    box-sizing: border-box !important;
    text-align: left !important;
    background-position: right 15px center !important;
    background-size: 12px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
}

/* 修复选择框选项 */
select[name="gender"] option {
    padding: 8px 15px !important;
    text-align: left !important;
}
