/**
 * Retourne la route login correcte selon le domaine courant.
 * - gestion.* → /[locale]/admin/login  (espace super admin)
 * - tout autre → /[locale]/login        (espace tenant/agent)
 */
export function getLoginRoute(locale: string, reason?: string): string {
  const isAdminDomain =
    typeof window !== "undefined" &&
    window.location.hostname.startsWith("gestion.")

  const base = isAdminDomain ? `/${locale}/admin/login` : `/${locale}/login`
  return reason ? `${base}?reason=${reason}` : base
}
