/** Build OIDC login URL (full navigation — never use Next.js Link). */
export function buildOidcLoginUrl(options?: {
  returnTo?: string
  intent?: "add_account"
  prompt?: string
}) {
  const returnTo = options?.returnTo ?? "/mail/inbox"
  const params = new URLSearchParams({
    returnTo,
  })
  if (options?.intent === "add_account") {
    params.set("intent", "add_account")
  }
  if (options?.prompt) {
    params.set("prompt", options.prompt)
  }
  return `/api/auth/login?${params.toString()}`
}
