I don't think you need religion.
Medieval learning was really advanced.
Democracy functions best when we have an active citizenry.