"While it may not be perfect, it is not undemocratic."
Whilst the mechanics of the exercise as you describe them may be perfectly correct, Gromit, it tells only a fraction of the story.
The main difficulty with the EU is that it is a political entity which legislates for 28 very disparate nations. It is impossible to homogenise such a variety of economies, cultures and legislatures without many people feeling ignored or being disadvantaged. But that is precisely what the EU aims to do. For as long as I can remember many people in Scotland have bemoaned the fact that they are ruled by a Parliament which does not have their interests at heart. To a certain degree I sympathise with them, though Scotland did enter freely into the Union and they are financially compensated quite well for their supposed subservience. They had their independence referendum five years ago and during the campaigns I cannot recall those seeking independence being branded as "extremists" or "Little Scotlanders". But that is what Leavers stand accused of. So why the difference? At least Scotland did not make huge financial contributions to their Lords and Masters (quite the reverse, in fact).
The EU is a flawed project. It seeks to homogenise oil and water. Its "one size must fit all" approach continually fails huge swathes of the European population. You only have to look at the euro to see that demonstrated at its worst. But worse than that it was sold on a false premise and has sliced away at national sovereignty and independence mercilessly, but salami style over the last 50 years. It may be mechanically democratic but it displays a huge democratic deficit when viewed through the eyes of those in individual (so-called independent) nations.