How to use template inside plugin shortcode with variables for big HTML code

Your core issue is that you pass value as globals but never declare them as such.

Generally speaking, “template parts” are useful when you want to give the ability to someone else to override them via a child theme or plugin, but if you are doing a “one off” theme, it is just better to write a function that generates the form and pass to it the relevant parameters instead of using global variables.