If someone having the same problem I found the solution. After validation Drupal changes the html form id. If you are using css selectors based on the form id, just add a custom class name to your form using the #attributes form attribute somewhere in your form creating function.
$form['#attributes'] = array('class' => array('your_id'));
Then use this class for various selections in your css file.
OR
You can always use attribute CSS selectors with wildcards.