What happened to you is called brewdogging, named after a similar public shaming:
https://www.urbandictionary.com/define.php?term=brewdogging
https://www.edinburghlive.co.uk/news/edinburgh-news/brewdog-...
Or brain rape: https://www.youtube.com/watch?v=JlwwVuSUUfc
Or getting free labour out of job candidates: https://www.inc.com/geoffrey-james/companies-are-using-job-c...
Ignore all the gaslighters telling you maybe the company didn't steal your idea and some fantasy happened where they thought about it themselves. They didn't, the CTO definitely stole it.
If it was me and I had proof I would send an invoice and then sue if not paid. If I didn't have proof I would just write about it and share everywhere and prepare to fight. When I was younger and more naive I also accepted it and moved on. That's also an option.
Whatever you do, be very very careful from now on. Job interviews and hiring changed, it's all about power and self-preservation now. The people doing the hiring will rob and destroy you if it makes them look good to their bosses.