A 44-year-old man lacks capacity due to advanced dementia and presents with a fractured neck of femur requiring surgery. There is no advance decision or lasting power of attorney. What is the most appropriate legal and ethical basis for proceeding with surgery?