Correct, your airline ticket will have to show a return date within 90 days when you first enter Costa Rica. What many people do if they plan to stay longer is change the date when they leave – as you are to Panama – and re-enter. You do, of course, have to pay change fees to the airline -and make sure your airline allows you to make changes to your ticket. The other option is to buy a refundable ticket. With those you can usually change the date without penalty. I wouldn’t risk buying an open return date ticket- the Costa Rican officials like to see a specific return date.