Superconductivity from spin fluctuations and long-range interactions in magic-angle twisted bilayer graphene