Character counter for text inputs