/* 登录注册页面样式 */

/* 容器 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 68, 99, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(255, 68, 99, 0.03) 0%, transparent 50%);
    animation: gradientMove 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gradientMove {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-5%, -5%); }
}

/* 卡片 */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px;
        border-radius: 12px;
    }
}

/* Logo */
.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo img {
    height: 40px;
    width: auto;
}

/* 标题 */
.auth-title {
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #FFFFFF;
    text-align: center;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.auth-subtitle {
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin: 0 0 32px 0;
    line-height: 1.5;
}

/* 表单 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 表单组 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 标签 */
.form-label {
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-left: 2px;
}

/* 输入框包装器 */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* 输入框图标 */
.input-icon {
    position: absolute;
    left: 16px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    transition: color 0.3s ease;
    pointer-events: none;
}

/* 输入框 */
.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 14px 48px 14px 44px;
    color: #FFFFFF;
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-input:focus {
    border-color: #FF4463;
    background: rgba(255, 68, 99, 0.05);
    box-shadow: 0 0 0 3px rgba(255, 68, 99, 0.1);
}

/* 输入框有值时的样式 (失去焦点后) */
.form-input:not(:placeholder-shown) {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

/* 聚焦时优先级更高 */
.form-input:focus:not(:placeholder-shown) {
    border-color: #FF4463;
    background: rgba(255, 68, 99, 0.05);
    box-shadow: 0 0 0 3px rgba(255, 68, 99, 0.1);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: #FF4463;
}

/* 输入框有值时图标颜色 */
.input-wrapper:has(.form-input:not(:placeholder-shown)) .input-icon {
    color: rgba(255, 255, 255, 0.6);
}

/* 聚焦时图标颜色优先级更高 */
.input-wrapper:has(.form-input:focus) .input-icon {
    color: #FF4463;
}

/* 切换密码可见性按钮 */
.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #FF4463;
}

/* 错误消息 */
.error-message {
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    color: #ff4444;
    min-height: 0;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    margin-left: 2px;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
    min-height: 16px;
}

/* 密码强度 */
.password-strength {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.password-strength.show {
    display: flex;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-text {
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11px;
    font-weight: 500;
    min-width: 60px;
    text-align: right;
}

/* 表单选项 */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -8px;
}

/* 记住我 */
.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.remember-me input[type="checkbox"] {
    display: none;
}

.remember-me .checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.remember-me input[type="checkbox"]:checked + .checkmark {
    background: #FF4463;
    border-color: #FF4463;
}

.remember-me input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* 忘记密码 */
.forgot-password {
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: #FF4463;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #ff6b88;
    text-decoration: underline;
}

/* 服务条款 */
.terms-group {
    margin-top: 4px;
}

.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.terms-checkbox input[type="checkbox"] {
    display: none;
}

.terms-checkbox .checkmark {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    margin-top: 2px;
}

.terms-checkbox input[type="checkbox"]:checked + .checkmark {
    background: #FF4463;
    border-color: #FF4463;
}

.terms-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.terms-text {
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

.terms-link {
    color: #FF4463;
    text-decoration: none;
    transition: color 0.3s ease;
}

.terms-link:hover {
    color: #ff6b88;
    text-decoration: underline;
}

/* 主按钮 */
.auth-btn {
    width: 100%;
    background: linear-gradient(135deg, #FF4463 0%, #ff6b88 100%);
    border: none;
    border-radius: 10px;
    padding: 16px 24px;
    color: #FFFFFF;
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 68, 99, 0.4);
}

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

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-btn .btn-text,
.auth-btn .btn-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-btn .btn-loading.hidden,
.auth-btn .btn-text.hidden {
    display: none;
}

/* 表单错误/成功消息 */
.form-error,
.form-success {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    margin-top: 8px;
}

.form-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff4444;
}

.form-success {
    background: rgba(0, 204, 0, 0.1);
    border: 1px solid rgba(0, 204, 0, 0.3);
    color: #00cc00;
}

.form-error.hidden,
.form-success.hidden {
    display: none;
}

/* 分隔线 */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 28px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    padding: 0 16px;
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 第三方登录 */
.social-login {
    display: flex;
    gap: 12px;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #FFFFFF;
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.social-btn i,
.social-btn svg {
    font-size: 18px;
}

.google-btn:hover {
    background: rgba(66, 133, 244, 0.1);
    border-color: rgba(66, 133, 244, 0.3);
}

.facebook-btn:hover {
    background: rgba(24, 119, 242, 0.1);
    border-color: rgba(24, 119, 242, 0.3);
}

.apple-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 400px) {
    .social-login {
        flex-direction: column;
    }

    .social-btn span {
        display: inline;
    }
}

/* 底部链接 */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.auth-link {
    color: #FF4463;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #ff6b88;
    text-decoration: underline;
}

/* RTL 支持 */
[dir="rtl"] .input-icon {
    left: auto;
    right: 16px;
}

[dir="rtl"] .form-input {
    padding: 14px 44px 14px 48px;
}

[dir="rtl"] .toggle-password {
    right: auto;
    left: 14px;
}

[dir="rtl"] .form-label,
[dir="rtl"] .error-message {
    margin-left: 0;
    margin-right: 2px;
}

[dir="rtl"] .strength-text {
    text-align: left;
}

[dir="rtl"] .remember-me input[type="checkbox"]:checked + .checkmark::after,
[dir="rtl"] .terms-checkbox input[type="checkbox"]:checked + .checkmark::after {
    left: auto;
    right: 5px;
}

/* 响应式 */
@media (max-width: 480px) {
    .auth-title {
        font-size: 24px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .form-input {
        padding: 12px 44px 12px 40px;
        font-size: 14px;
    }

    .auth-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeIn 0.5s ease-out;
}

/* 验证码输入框样式 */
.code-input-wrapper {
    position: relative;
}

.code-input {
    padding-right: 100px !important;
    letter-spacing: 4px;
    font-size: 18px !important;
    font-weight: 600;
}

.resend-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid rgba(255, 68, 99, 0.5);
    border-radius: 6px;
    padding: 8px 12px;
    color: #FF4463;
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.resend-btn:hover:not(:disabled) {
    background: rgba(255, 68, 99, 0.1);
    border-color: #FF4463;
}

.resend-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

/* 只读输入框样式 */
.form-input.readonly {
    background: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.6);
    cursor: not-allowed;
}

/* RTL 验证码样式 */
[dir="rtl"] .code-input {
    padding-left: 100px !important;
    padding-right: 44px !important;
}

[dir="rtl"] .resend-btn {
    right: auto;
    left: 8px;
}

/* 忘记密码链接 */
.forgot-password-link {
    text-align: right;
    margin-top: -8px;
}

.forgot-password-link a {
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: #FF4463;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password-link a:hover {
    color: #ff6b88;
    text-decoration: underline;
}

[dir="rtl"] .forgot-password-link {
    text-align: left;
}

/* Google 登录按钮 */
.google-login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    color: #1f1f1f;
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.google-login-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.google-login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.google-login-btn .google-icon {
    flex-shrink: 0;
}

/* 邮箱显示区域 (找回密码页面) */
.email-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
}

.email-display i {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.email-display span {
    flex: 1;
}

.change-email-btn {
    background: none;
    border: none;
    color: #FF4463;
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.3s ease;
}

.change-email-btn:hover {
    color: #ff6b88;
    text-decoration: underline;
}

/* 重发验证码按钮 */
.resend-code-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid rgba(255, 68, 99, 0.5);
    border-radius: 6px;
    padding: 8px 12px;
    color: #FF4463;
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 50px;
    text-align: center;
}

.resend-code-btn:hover:not(:disabled) {
    background: rgba(255, 68, 99, 0.1);
    border-color: #FF4463;
}

.resend-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

/* 验证码输入框调整 */
.code-input-wrapper .form-input {
    padding-right: 90px;
}

[dir="rtl"] .code-input-wrapper .form-input {
    padding-right: 44px;
    padding-left: 90px;
}

[dir="rtl"] .resend-code-btn {
    right: auto;
    left: 8px;
}

[dir="rtl"] .email-display {
    flex-direction: row-reverse;
}

/* 隐藏类 */
.auth-form.hidden {
    display: none;
}
