Insiders say the final days of negotiations were filled with uncertainty, pressure - and a lot of lawyers