/* AI SSO Client — Login / Register Form Styles */

.ai-sso-wrap {
    max-width: 420px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── 面板容器 ──────────────────────────────────────────────── */
.ai-sso-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px 36px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .06);
}

.ai-sso-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 24px;
    text-align: center;
}

/* ── 字段 ──────────────────────────────────────────────────── */
.ai-sso-field {
    margin-bottom: 18px;
}

.ai-sso-field label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.ai-sso-field input[type="text"],
.ai-sso-field input[type="email"],
.ai-sso-field input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: .95rem;
    color: #111827;
    background: #f9fafb;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}

.ai-sso-field input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
    background: #fff;
}

/* ── 消息提示 ───────────────────────────────────────────────── */
.ai-sso-msg {
    font-size: .85rem;
    min-height: 20px;
    margin-bottom: 12px;
    border-radius: 6px;
    padding: 0;
    transition: all .2s;
}

.ai-sso-msg.error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 8px 12px;
}

.ai-sso-msg.success {
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 8px 12px;
}

/* ── 按钮 ──────────────────────────────────────────────────── */
.ai-sso-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
    border: none;
    text-decoration: none;
}

.ai-sso-btn-submit {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .3);
}

.ai-sso-btn-submit:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 4px 14px rgba(99, 102, 241, .4);
    transform: translateY(-1px);
}

.ai-sso-btn-submit:active {
    transform: translateY(0);
}

.ai-sso-btn-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

.ai-sso-btn-outline {
    background: transparent;
    color: #6366f1;
    border: 1.5px solid #6366f1;
    width: auto;
    padding: 7px 18px;
    font-size: .9rem;
}

.ai-sso-btn-outline:hover {
    background: #ede9fe;
}

/* ── 切换注册/登录 ───────────────────────────────────────────── */
.ai-sso-switch {
    text-align: center;
    font-size: .85rem;
    color: #6b7280;
    margin: 14px 0 0;
}

.ai-sso-switch a,
.ai-sso-toggle {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}

.ai-sso-switch a:hover,
.ai-sso-toggle:hover {
    text-decoration: underline;
}

/* ── 已登录状态 ─────────────────────────────────────────────── */
.ai-sso-logged-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
    max-width: 420px;
    margin: 0 auto;
}

.ai-sso-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-sso-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ai-sso-welcome {
    font-size: .9rem;
    color: #374151;
    margin: 0 0 4px;
}

.ai-sso-plan-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
}

.ai-sso-plan--free       { background: #e5e7eb; color: #6b7280; }
.ai-sso-plan--pro        { background: #dbeafe; color: #1d4ed8; }
.ai-sso-plan--premium    { background: #ede9fe; color: #6d28d9; }
.ai-sso-plan--enterprise { background: #fef3c7; color: #b45309; }

/* ── [ai_sso_user_info] 独立用户信息卡片 ──────────────────────── */
.ai-sso-user-info {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 16px;
    font-family: inherit;
}

.ai-sso-user-info .ai-sso-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ai-sso-user-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ai-sso-display-name {
    font-size: .9rem;
    font-weight: 600;
    color: #111827;
}

.ai-sso-balance-info {
    font-size: .78rem;
    color: #6b7280;
}

.ai-sso-logout-btn {
    margin-left: 6px;
    font-size: .78rem;
    color: #6b7280;
    text-decoration: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 3px 10px;
    white-space: nowrap;
    transition: background .15s;
}

.ai-sso-logout-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* ── 加载中旋转 ─────────────────────────────────────────────── */
.ai-sso-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ai-sso-spin .6s linear infinite;
    flex-shrink: 0;
}

@keyframes ai-sso-spin {
    to { transform: rotate(360deg); }
}

/* ── 响应式 ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .ai-sso-panel {
        padding: 24px 20px;
    }
    .ai-sso-logged-in {
        flex-direction: column;
        text-align: center;
    }
    .ai-sso-user-info {
        flex-direction: column;
    }
}
