Hi!
We've got a proverb in Spain that says: "Hasta el 40 de Mayo, no te quites el sayo". That is, the weather here is unpredictable until the beginning of June.
Spanish spring tends to be warm and sunny, perhaps a bit chilly at night and sometimes rainy. Bring a raincoat just in case. A jacket, some sweaters, etc. Shorts and jeans are ok as well.
Don't worry about formal clothes and stuff like that, imagine you are going to a nice restaurant at home and choose things alike unless you like being flashy
. I mean... common sense depending on the place you want to go. Cool restaurant = cool clothes; Posh restaurant = Formal clothes...
There are some restaurants and discos which might ask their customers to wear specifc clothes but there are only a few of them.
Have a nice stay!!