It’s not possible to create a form meeting those specifications with HubSpot’s native pop-up forms tool, but you can recreate your custom solution in the HubSpot CMS with custom modules and JavaScript, sending submissions to this Forms API endpoint.
It seems like you’re comfortable with front-end development, so I’ll just link to some general resources for others with similar questions.
To create a pop-up modal, you can take inspiration from these related discussions or leverage custom modules in the HubSpot Marketplace: