Is this a dumb idea?
Only if it doesn't work. It's high risk with potential high returns. Allocate accordingly, but do your due diligence.
In my time following MMM, I have gone from mostly indices to almost exclusively single stocks, and whether there are actual shares here, this idea his highly analogous to a single-stock investment, since it's an ownership interest in one company. Your risk goes up and your returns may or may not. There are many questions that only you can answer, and it will take time. Whatever you do, don't rush in... false urgency is your enemy. Ask questions, ask more questions, ask follow-up questions. Anyone who values your capital will appreciate the due diligence and respond in good faith.
I have had many meetings over the course of months just to secure a few thousand in funding for my startup. I'm not saying to intentionally drag things out, but definitely take as long as it takes to answer every question you have. If it's all above board, they will appreciate the questions and be forthcoming about the answers. If they have a problem with it, HUGE red flag.
To some of your other questions:
Is this even legal?
Is
what legal?
Employees investing in a company is almost always legal. A company selling securities (shares, bonds, etc) without registering them is most definitely not. But you can invest in a company without it selling securities. That's where the EXACT "what" is everything. Figure that out, and you can probably tell if it's legal.
I have an LLC for real estate investments, and I'm accepting new members (co-owners), which is easy and simple to do, legally. The bylaws specify the requirements, expectations, and risk mitigation measures that apply to each new member's investment, along with expected performance and several "what ifs" like what happens if you want your money back and the company is broke. The contract each new members signs requires them to understand and agree to those conditions, and also requires the company to acknowledge its responsibility for meeting performance goals or to use various backup options (like borrowing money or selling assets) to mitigate their losses and provide at least some return before I ever get anything. I would expect something like that from this company.
What is the difficulties?
Lack of liquidity is a big one with small companies. They're going to invest your money, so they can't just buy your ownership interest back if you decide you want out, and maybe nobody else wants to buy when you want to sell. You might have to take a huge discount on actual value, if you can even sell at all.
Another big one is difficulty in precisely valuing the company or your piece of it, especially if it has no clear and simple share structure.
Another major concern could be a lack of transparency, if the company's finances are handled internally and not subject to independent audits. I hired a CPA for my startup long before I actually needed one for that reason, and will add third-party audits as soon as we can afford them, because that is one of the best ways to ensure nobody's skimming or faking profitability and I want to inspire maximum confidence among any potential investors.
SEC oversight?
Not unless it's publicly traded, and at 22 employees, that's highly unlikely.
Does this involve the employees buying shares?
It doesn't have to, but it could and probably should. Otherwise, your stake would have to be measured as a percentage of ownership, and every new buy-in would require a recalculation of everyone's percentages. It's an exponential nightmare in accounting.
How would the company be valued? I.E. How would this work?
You can calculate value a lot of ways. Book value is easiest, and if they have a CPA they are calculating this fairly often. Calculating net present value based on projected earnings growth is a bit more complex but can potentially demonstrate a higher current value than book value for a healthy, growing company. I would ask the CEO (or CFO or CPA) to tell you what they believe the answer is, and also what method they applied. Make them show their work so you can check it!
****************************
Side note: you could also just offer to be a creditor to the company - make loans to it instead of buying an ownership interest. Just a thought. That puts you higher in the typical capital stack than a part-owner, and might give a more secure but potentially lower return. Me, I always prefer to own common stock or the equivalent. Young, high-earning, low-spending people like this forum attracts will usually do better by accepting a lower position in the stack, higher risks, occasional losses, and the lion's share of the rewards.