/* 登录/注册页面样式 */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
    position: relative;
    overflow: hidden;
}

.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.auth-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(99, 102, 241, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(139, 92, 246, 0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(6, 182, 212, 0.3), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(99, 102, 241, 0.3), transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: float 20s infinite linear;
    opacity: 0.6;
}

.auth-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

.auth-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
}

.auth-box {
    background: var(--bg-secondary);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

/* 标签切换 */
.auth-tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.auth-tab:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.auth-tab.active {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
}

.auth-tab i {
    font-size: 1.1rem;
}

/* 表单容器 */
.auth-form-container {
    display: none;
    padding: 40px;
    animation: fadeIn 0.3s ease;
}

.auth-form-container.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 表单样式 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group label i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.form-group input {
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-group input:valid:not(:placeholder-shown) {
    border-color: #22c55e;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.form-error {
    color: #ef4444;
    font-size: 0.85rem;
    min-height: 20px;
    display: none;
}

.form-group.error .form-error {
    display: block;
}

.form-group.error input {
    border-color: #ef4444;
}

/* 密码强度指示器 */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: #ef4444;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-fill.weak {
    width: 33%;
    background: #ef4444;
}

.strength-fill.medium {
    width: 66%;
    background: #f59e0b;
}

.strength-fill.strong {
    width: 100%;
    background: #22c55e;
}

.strength-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.strength-text.weak {
    color: #ef4444;
}

.strength-text.medium {
    color: #f59e0b;
}

.strength-text.strong {
    color: #22c55e;
}

/* 表单选项 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* 按钮 */
.btn-block {
    width: 100%;
    justify-content: center;
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn-loader {
    display: none;
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-loader {
    display: inline-flex;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* 分割线 */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 社交登录 */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.social-btn:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.social-btn i {
    font-size: 1.2rem;
}

.social-btn.google:hover {
    border-color: #ea4335;
    background: rgba(234, 67, 53, 0.1);
}

.social-btn.github:hover {
    border-color: #333;
    background: rgba(51, 51, 51, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .auth-container {
        padding: 80px 16px 32px;
    }

    .auth-box {
        border-radius: 20px;
    }

    .auth-form-container {
        padding: 32px 24px;
    }

    .auth-header h2 {
        font-size: 1.75rem;
    }

    .auth-tab {
        padding: 16px;
        font-size: 0.9rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .auth-form-container {
        padding: 24px 20px;
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }

    .auth-tab span {
        display: none;
    }

    .auth-tab {
        padding: 16px 12px;
    }
}

/* 动画效果 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-group.error input {
    animation: shake 0.5s ease;
}

/* 成功状态 */
.form-group.success input {
    border-color: #22c55e;
}

.form-group.success::after {
    content: '✓';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #22c55e;
    font-weight: bold;
}

