/**
 * 商户认证系统扩展样式
 * 用于支持手机号注册/登录、第三方登录等新功能
 */

/* ============================================
   登录/注册方式切换标签
   ============================================ */

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    border: none;
    background: transparent;
}

.auth-tab:hover {
    color: #111827;
}

.auth-tab.active {
    background: white;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ============================================
   验证码倒计时按钮
   ============================================ */

.sms-btn {
    width: 65px;
    padding: 0.75rem 0.25rem;
    background: #f3f4f6;
    color: #374151;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
}

.sms-btn:hover:not(:disabled) {
    background: #e5e7eb;
}

.sms-btn:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.sms-btn.sending {
    background: #dbeafe;
    color: #2563eb;
}

/* 验证码输入框容器 - 增加宽度 */
.flex-1.input-with-icon {
    flex-grow: 10;
    flex-basis: 0;
    min-width: 0;
}

/* ============================================
   第三方登录按钮
   ============================================ */

.oauth-section {
    margin-top: 2rem;
}

.oauth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.oauth-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e5e7eb;
}

.oauth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 1rem;
    background: white;
    color: #9ca3af;
    font-size: 0.875rem;
}

.oauth-buttons-compact {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.oauth-btn-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.oauth-btn-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.oauth-btn-icon:active {
    transform: translateY(-1px);
}

/* 微信登录按钮 */
.oauth-btn-icon.oauth-btn-wechat {
    background: #07c160;
    color: white;
}

.oauth-btn-icon.oauth-btn-wechat:hover {
    background: #06ad56;
}

/* QQ登录按钮 */
.oauth-btn-icon.oauth-btn-qq {
    background: #12b7f5;
    color: white;
}

.oauth-btn-icon.oauth-btn-qq:hover {
    background: #0fa3db;
}

/* 旧版OAuth按钮样式（保留兼容性） */
.oauth-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.oauth-btn {
    flex: 1;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.oauth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.oauth-btn:active {
    transform: translateY(0);
}

/* 微信登录按钮 */
.oauth-btn-wechat {
    background: #07c160;
    color: white;
    border-color: #07c160;
}

.oauth-btn-wechat:hover {
    background: #06ad56;
    border-color: #06ad56;
}

/* QQ登录按钮 */
.oauth-btn-qq {
    background: #12b7f5;
    color: white;
    border-color: #12b7f5;
}

.oauth-btn-qq:hover {
    background: #0fa3db;
    border-color: #0fa3db;
}

/* 支付宝登录按钮 */
.oauth-btn-alipay {
    background: #1677ff;
    color: white;
    border-color: #1677ff;
}

.oauth-btn-alipay:hover {
    background: #1366d6;
    border-color: #1366d6;
}

/* OAuth按钮图标 */
.oauth-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ============================================
   表单字段组
   ============================================ */

#formsWrapper {
    /* 包装器不需要特殊样式，只是用来容纳两个表单 */
    position: relative;
    z-index: 1;
}

.form-fields-group {
    display: none !important;
    position: relative;
    z-index: 1;
}

.form-fields-group.active {
    display: block !important;
}

/* 确保表单内容正确显示 */
.form-fields-group.space-y-6 > * + * {
    margin-top: 1.5rem;
}

/* 确保输入框可以交互 */
.form-fields-group input,
.form-fields-group button,
.form-fields-group a,
.form-fields-group label {
    pointer-events: auto !important;
    position: relative;
    z-index: 2;
}

.form-fields-group .input-with-icon {
    position: relative;
    z-index: 2;
}

.form-fields-group .auth-input {
    pointer-events: auto !important;
    cursor: text !important;
    user-select: text !important;
}

/* 确保表单组可见且可交互 */
.form-group {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

/* ============================================
   加载动画
   ============================================ */

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   提示消息增强
   ============================================ */

.alert-box {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-box.success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.alert-box.error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-box.info {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.alert-box svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* ============================================
   密码强度指示器增强
   ============================================ */

.password-strength {
    margin-top: 0.5rem;
}

.strength-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.strength-bar {
    flex: 1;
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
}

.strength-bar-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 0.25rem;
}

.strength-text {
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 2rem;
}

/* 强度颜色 */
.strength-weak {
    background: #ef4444;
}

.strength-medium {
    background: #f59e0b;
}

.strength-strong {
    background: #10b981;
}

/* ============================================
   响应式设计
   ============================================ */

@media (max-width: 640px) {
    .oauth-buttons {
        flex-direction: column;
    }
    
    .oauth-btn {
        width: 100%;
    }
    
    .oauth-buttons-compact {
        gap: 0.75rem;
    }
    
    .oauth-btn-icon {
        width: 2.75rem;
        height: 2.75rem;
    }
    
    .auth-tabs {
        gap: 0.25rem;
    }
    
    .auth-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .sms-btn {
        min-width: 100px;
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
}

/* ============================================
   工具类
   ============================================ */

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.font-medium {
    font-weight: 500;
}

.text-gray-500 {
    color: #6b7280;
}

.text-gray-600 {
    color: #4b5563;
}

.text-blue-600 {
    color: #2563eb;
}

/* ============================================
   过渡效果
   ============================================ */

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   焦点状态增强
   ============================================ */

.auth-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* ============================================
   禁用状态
   ============================================ */

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-input:disabled {
    background: #f9fafb;
    cursor: not-allowed;
}

/* ============================================
   OAuth用户信息卡片
   ============================================ */

.oauth-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.oauth-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.oauth-info {
    flex: 1;
}

.oauth-nickname {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.oauth-provider {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ============================================
   倒计时数字动画
   ============================================ */

.countdown-number {
    display: inline-block;
    animation: countdownPulse 1s ease infinite;
}

@keyframes countdownPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}


/* OAuth图标图片样式 */
.oauth-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}
