How can a 'referendum' be illegal in a free democratic nation?  Its like an opinion poll, survey, or a petition.  
Closing polling stations, throwing people in jail, violence towards citizens wanting to express their opinion are the actions of a fascist totalitarian state.  It makes Spain look like an ultra-reactionary catholic medieval monarchy.  What's next?  A new Spanish Inquisition?