Inhomogeneous superconductivity in superconductor/ferromagnet heterostructures