Being a nerd, I have learned a lot of modern literature about the social contract theory (theory of games, cooperation, egoism/altruism, etc). This conception is revealed, in particular, by modern biologists, who write that the ancient people lived, in fact, in an ideal democracy, because they lived in small groups. 10,000 years ago humanity moved from living in small groups to living in states based on a social contract. The authorities in these states began to establish laws against the selfish behavior of members of the states; but the tragedy of humanity was that since the representatives of power are also selfish individuals, they have begun to oppress those who do not have power, and then more and more immerse humanity in their paradigm, in particular, modify moral codes for themselves.
And I came to the conclusion that misanthropy in society arises as a by-product of the fact that the social contract is not abided by effectively enough. It may be difficult for me to formulate this exactly, but I am sure that in principle this is true. Suppose you condemn people for driving selfishly on the roads. But they also suffer from it, so they will vote for laws prohibiting such driving. Those, in an ideal democracy, your attitude towards others will be determined not by how they behave, but by what they vote for. If in the future ways of forming morality in a person are developed (for example, methods of upbringing), in a democracy, people will vote for this to become widespread.
Near-perfect democracy is not so unattainable: for this it is enough to write in the constitution the rule that any law can be adopted only through a referendum (with the possible exception of martial law). At first glance, it may seem that such a system will not work, since an ordinary citizen is a layman in matters of governing the country. But this will not be such a big problem, since the referendums will be initiated by the authorities, i.e. experts, and they only need to convince the population of their position (by raising the level of education of the population for this).
However, for this system to work well, one more step is needed: a law on compulsory post-school education. For example, each citizen will have to spend half an hour a day studying materials that help understand the government of the country, and in case of non-compliance, pay an increased tax. I believe that the principle must be implemented: each citizen can choose what information he will study, but he must justify why, as he believes this information will help him vote more correctly, and this explanation should sound reasonable (this idea develops 20 article of the United Nations Convention against Corruption).
And then a new problem arises: since the resources of the brain are limited, it is difficult for a person to be versatile, and if he spends a lot of time studying the issues of running a country, he will earn less in his main job. Accordingly, a society in which the state forces everyone to study the issues of governing the country will be more reasonable and less likely to make erroneous decisions, but at the same time, it may militarily and economically lose competition to societies in which such norms do not exist. Therefore, such a society must export its way of life, perhaps even by military means. This is similar to the idea of exporting democracy by military means, which I fully support (“so that the barbarians do not conquer Rome, we must make Rome everywhere”).