An implicit three-dimensional fully non-hydrostatic model for free-surface flows