Allegri: Douglas Costa had lost his mind for spitting