/* 现代化认证模态框样式 */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.auth-modal.active {
    display: block;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
}

.auth-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 20, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    position: relative;
    animation: modalSlide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 优雅的外层发光 */
.auth-modal-content::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg,
        rgba(62, 196, 124, 0.2),
        rgba(255, 255, 255, 0.05),
        rgba(62, 196, 124, 0.1)
    );
    border-radius: 21px;
    z-index: -1;
    animation: shimmer 4s ease-in-out infinite;
}

/* 顶部微光 */
.auth-modal-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(62, 196, 124, 0.6),
        transparent
    );
    z-index: -1;
    animation: topGlow 3s ease-in-out infinite alternate;
}

/* 关闭按钮 */
.auth-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.6);
    z-index: 10;
}

.auth-close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Tab切换 */
.auth-tab-headers {
    display: flex;
    margin: 20px 20px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
}

.auth-tab-header {
    flex: 1;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.auth-tab-header.active {
    background: rgba(62, 196, 124, 0.2);
    color: #3ec47c;
    font-weight: 600;
}

/* 返回按钮 */
.auth-forgot-header {
    margin-bottom: 24px;
}

.auth-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* 表单容器 */
.auth-form-container {
    display: none;
    padding: 32px;
}

.auth-form-container.active {
    display: block;
}

/* 表单头部 */
.auth-form-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-form-title {
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.auth-form-subtitle {
    font-size: 14px;
    color: #999;
    margin-top: 8px;
}

/* 消息提示 */
.auth-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.success-message {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

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

.auth-form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 16px;
    color: #fff;
    transition: all 0.2s;
}

.auth-form-input::placeholder {
    color: #999;
}

.auth-form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

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

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
}

.auth-password-toggle:hover {
    color: #fff;
}

/* 验证码输入框 */
.auth-verification-input {
    display: flex;
    gap: 12px;
}

.auth-verification-btn {
    white-space: nowrap;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-verification-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.auth-verification-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.auth-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #000;
}

.auth-checkbox-text {
    font-size: 14px;
    color: #999;
}

.auth-forgot-password {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.auth-forgot-password:hover {
    color: #fff;
}

/* 提交按钮 */
.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3ec47c, #2a9d5c);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 4px 12px rgba(62, 196, 124, 0.3);
}

.auth-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #45d687, #31b466);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(62, 196, 124, 0.4);
}

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

.btn-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 分割线 */
.auth-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.auth-divider span {
    background: #1a1a1a;
    padding: 0 16px;
    color: #666;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

/* Google登录按钮 */
.auth-google-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-google-btn:hover {
    background: #f0f0f0;
    border-color: #f0f0f0;
}

/* 注册方式切换 */
.auth-register-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.auth-register-tab {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-register-tab.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 500;
}

/* 链接 */
.auth-link {
    color: #4a9eff;
    text-decoration: underline;
}

.auth-link:hover {
    color: #6bb3ff;
}

.auth-link-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.auth-link-btn:hover {
    color: #fff;
}

.auth-form-footer {
    text-align: center;
    margin-top: 24px;
}

/* 响应式 */
@media (max-width: 640px) {
    .auth-modal-content {
        width: 95%;
        max-width: 95%;
    }
    
    .auth-form-container {
        padding: 24px;
    }
    
    .auth-form-title {
        font-size: 24px;
    }
    
    .auth-tab-header,
    .auth-form-input,
    .auth-submit-btn,
    .auth-google-btn {
        font-size: 14px;
    }
}

/* 动画关键帧 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

@keyframes topGlow {
    0%, 100% {
        opacity: 0.5;
        transform: scaleX(0.8);
    }
    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}