Added conditional flash messages with styling