Nelson Mandela's health 'perilous,' court documents say