/**
 * Custom styling - webform_civicrm Contact Autocomplete fields
 * Site: purcon.co.za
 *
 * Field uses jQuery TokenInput (wfCivi.existingInit), not Select2.
 * civi-custom.js marks the "create new / not found" row with the class
 * "crm-not-found-msg" - it can appear either as a standalone <p> (zero
 * matches) or as the last <li> in the results list (some matches, still
 * under webform_civicrm's 12-result cap) - both use identical text, so JS
 * matches on that text rather than position (a pure :last-child rule would
 * incorrectly color a genuine 12th contact when the list is exactly full).
 *
 * !important is used because the site's own CSS for this widget loads
 * after ours and would otherwise win on equal specificity.
 */

/* "Not found - click to create a new record" prompt: white text, green bg */
div.token-input-dropdown p.crm-not-found-msg,
div.token-input-dropdown ul li.crm-not-found-msg {
  background-color: green !important;
  color: #fff !important;
}

div.token-input-dropdown p.crm-not-found-msg:hover,
div.token-input-dropdown ul li.crm-not-found-msg:hover,
div.token-input-dropdown ul li.crm-not-found-msg.token-input-selected-dropdown-item {
  background-color: red !important;
  color: #fff !important;
}

/* "More matches exist..." notice: white text, red background */
div.token-input-dropdown p.crm-more-results-msg {
  background-color: red !important;
  color: #fff !important;
}
