Justice Minister resigns over handling of Brexit