Costs -- professional fees. (1) The court from time to time, after considering the financial resources of both parties, may order a party to pay a reasonable amount for the cost to the other party of maintaining or defending any proceeding under chapters 1 and 4 and for professional fees, including sums for legal and professional services rendered and costs incurred prior to the commencement of th