Conformal invariance and critical systems with mixed boundary conditions