If you lose your case, you don’t owe your attorney anything. It’s as if you didn’t do business with them. No loss, no penny!
While there are no upfront costs, keep in mind there may be additional costs for things like court fees or expert witnesses. But the attorney usually covers those upfront and deducts them from your winnings.