/**
 * 认证翻译 - 中文
 * Authentication Translations - Chinese
 */
import { brand } from '@/lib/brand';

export const authZh = {
  // 登录
  login: {
    title: '登录',
    subtitle: '欢迎回来',
    brandName: brand.brandName,
    tagline: brand.taglineZh,
    slogan: brand.slogan,
    username: '邮箱',
    usernamePlaceholder: '请输入邮箱地址',
    password: '密码',
    passwordPlaceholder: '请输入密码',
    rememberMe: '记住我',
    forgotPassword: '忘记密码？',
    loginButton: '登录',
    processing: '处理中...',
    loggingIn: '登录中...',
    noAccount: '还没有账号？',
    signUp: '立即注册',
    
    // 验证消息
    usernameRequired: '请输入用户名',
    passwordRequired: '请输入密码',
    invalidCredentials: '用户名或密码错误',
    loginSuccess: '登录成功',
    loginFailed: '登录失败',
    devEmailLoginTitle: '开发测试邮箱登录',
    devEmailPlaceholder: '请输入测试邮箱',
    devEmailLoginButton: '邮箱免密登录',
    devEmailRequired: '请输入测试邮箱',
  },

  // SSO（v2.4：Entra ID OIDC 登录）
  sso: {
    button: {
      microsoft: '用微软账号登录',
      password: '用密码登录',  // 保留键以兼容（v2.4 UI 改为密码主+SSO 次后此键暂未使用）
      or: '或',
    },
    status: {
      redirecting: '正在跳转到 Microsoft 登录..',
      completing: '正在完成登录..',
    },
    error: {
      // 错误码 -> 用户文案（与 08-error-codes.md 对齐）
      domainNotAllowed: '你的邮箱域名暂未授权使用 SSO 登录，请联系 IT 或改用密码登录',
      tokenInvalid: 'SSO 登录校验失败，请重试',
      emailMissing: '你的微软账号未配置邮箱，请联系 IT',
      bindingConflict: 'SSO 账号绑定冲突，请联系 itadmin',
      providerUnavailable: 'Microsoft 登录暂时不可用，请改用密码登录',
      userCancelled: '你已取消 Microsoft 登录',
      consentRequired: 'Microsoft 要求重新授权，请重试登录',
      providerRejected: 'Microsoft 登录被拒绝，请联系 IT',
      iamUserSuspended: '账号已被停用，请联系管理员',
      // 未知错误码兜底
      fallback: '登录失败，请重试',
    },
  },
  
  // 注册
  register: {
    title: '注册',
    subtitle: '创建您的账号',
    username: '用户名',
    usernamePlaceholder: '请输入用户名',
    email: '邮箱',
    emailPlaceholder: '请输入邮箱地址',
    password: '密码',
    passwordPlaceholder: '请输入密码',
    confirmPassword: '确认密码',
    confirmPasswordPlaceholder: '请再次输入密码',
    registerButton: '注册',
    registering: '注册中...',
    haveAccount: '已有账号？',
    signIn: '立即登录',
    
    // 验证消息
    usernameRequired: '请输入用户名',
    usernameTooShort: '用户名至少需要 3 个字符',
    emailRequired: '请输入邮箱',
    emailInvalid: '邮箱格式不正确',
    passwordRequired: '请输入密码',
    passwordTooShort: '密码至少需要 6 个字符',
    confirmPasswordRequired: '请确认密码',
    passwordsNotMatch: '两次输入的密码不一致',
    registerSuccess: '注册成功',
    registerFailed: '注册失败',
  },
  
  // 忘记密码
  forgotPassword: {
    title: '忘记密码',
    subtitle: '重置您的密码',
    email: '邮箱',
    emailPlaceholder: '请输入您的邮箱',
    sendButton: '发送重置链接',
    sending: '发送中...',
    backToLogin: '返回登录',
    
    // 验证消息
    emailRequired: '请输入邮箱',
    emailInvalid: '邮箱格式不正确',
    sendSuccess: '重置链接已发送到您的邮箱',
    sendFailed: '发送失败',
  },
  
  // 重置密码
  resetPassword: {
    title: '重置密码',
    subtitle: '设置新密码',
    newPassword: '新密码',
    newPasswordPlaceholder: '请输入新密码',
    confirmPassword: '确认密码',
    confirmPasswordPlaceholder: '请再次输入新密码',
    resetButton: '重置密码',
    resetting: '重置中...',
    
    // 验证消息
    passwordRequired: '请输入新密码',
    passwordTooShort: '密码至少需要 6 个字符',
    confirmPasswordRequired: '请确认新密码',
    passwordsNotMatch: '两次输入的密码不一致',
    resetSuccess: '密码重置成功',
    resetFailed: '密码重置失败',
  },
  
  // 其他
  or: '或',
  continue: '继续',
  cancel: '取消',
};

export type AuthTranslations = typeof authZh;
