/*
 * Form 3's fallback fields are driven by the NLF finder controller instead of
 * Fluent Forms' hidden-field conditional UI. This prevents the create-Group
 * section from flashing or remaining visible on first load.
 */
#fluentform_3 .nlf-create-group-only,
form[data-form_id="3"] .nlf-create-group-only {
  display: none !important;
}

#fluentform_3.nlf-group-finder--create .nlf-create-group-only:not([hidden]),
form[data-form_id="3"].nlf-group-finder--create .nlf-create-group-only:not([hidden]) {
  display: var(--nlf-create-group-display, block) !important;
  visibility: visible !important;
}

#fluentform_3 .nlf-create-group-only[hidden],
form[data-form_id="3"] .nlf-create-group-only[hidden] {
  display: none !important;
}

#fluentform_3.nlf-group-finder--create .nlf-create-group-only[hidden],
form[data-form_id="3"].nlf-group-finder--create .nlf-create-group-only[hidden] {
  display: none !important;
}

.nlf-group-finder-summary[hidden] {
  display: none !important;
}

.nlf-group-finder-summary {
  width: min(100%, 68ch);
  margin: 0 auto 27px;
  color: inherit;
  text-align: center;
}

.nlf-group-finder-summary__title {
  margin: 0 0 10px !important;
  color: inherit !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

.nlf-group-finder-summary__values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: flex-start;
  justify-content: center;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.nlf-group-finder-summary__values li {
  display: flex;
  gap: 5px;
  align-items: baseline;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  font-size: 14px;
  line-height: 1.35;
}

.nlf-group-finder-summary__values strong {
  font-weight: 700;
}

.nlf-group-finder-summary__change {
  margin: 13px 0 0 !important;
  padding: 0 0 2px !important;
  border: 0 !important;
  border-bottom: 1px solid currentColor !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font: inherit !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  cursor: pointer;
}

.nlf-group-finder-summary__change:hover,
.nlf-group-finder-summary__change:focus-visible {
  border-bottom-width: 2px !important;
}

/* v0.6.22: autocomplete hints and clear validation on the group finder. */
#find-your-group .nlf-finder-custom-hint,
.nlf-session-modal .nlf-finder-custom-hint {
  display: block;
  margin: 6px 0 0 !important;
  color: #ffffff !important;
  font: 13px/1.45 Arial, Helvetica, sans-serif !important;
}
#find-your-group .nlf-finder-custom-hint[hidden],
.nlf-session-modal .nlf-finder-custom-hint[hidden] { display: none !important; }
#find-your-group .nlf-finder-required-notice,
.nlf-session-modal .nlf-finder-required-notice {
  display: block;
  margin: 14px 0 !important;
  color: #ffffff !important;
  font: 600 15px/1.5 Arial, Helvetica, sans-serif !important;
}
/* v0.6.24: Fluent Forms inserts the success confirmation after Form 3.
 * Strip its alert box on all finder surfaces, preserving layout and wording.
 */
#find-your-group .ff-message-success,
.nlf-session-modal .ff-message-success,
.nlf-am6-modal .ff-message-success {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
}

/* Finder embedded in the navy homepage panel: light text. */
#find-your-group .ff-message-success,
#find-your-group .ff-message-success * {
  color: #ffffff !important;
}

/* Session and About page popups have cream backgrounds: dark readable text. */
.nlf-session-modal .ff-message-success,
.nlf-session-modal .ff-message-success *,
.nlf-am6-modal .ff-message-success,
.nlf-am6-modal .ff-message-success * {
  color: #173044 !important;
}

/* v0.6.25: the homepage's responsive layout forces the form to display:block.
 * Fluent Forms' successful hide_form action sets display:none + ff_force_hide.
 * Ensure its success state wins over the layout rules, on desktop and mobile.
 */
body.home #find-your-group #fluentform_3.ff_force_hide,
body.home #find-your-group #fluentform_3[style*="display: none"],
body.home #find-your-group #fluentform_3[style*="display:none"],
body.home #find-your-group .fluent_form_3.ff_force_hide,
.nlf-session-modal #fluentform_3.ff_force_hide,
.nlf-am6-modal #fluentform_3.ff_force_hide {
  display: none !important;
}


/* v0.6.26: unmatched text remains editable in the *same visible field*.
 * Choices.js places its text input inside the dropdown, so hiding the entire
 * dropdown would hide typing too. Instead, overlay just that input across the
 * normal select box and hide only the suggestion list. New entries can be
 * completed simply by moving to the next field, without an extra click.
 * This is intentionally limited to Form 3 and only when no saved choice matches.
 */
form[data-form_id="3"] .nlf-finder-unmatched .choices,
#fluentform_3 .nlf-finder-unmatched .choices {
  position: relative !important;
}
form[data-form_id="3"] .nlf-finder-unmatched .choices__list--dropdown,
#fluentform_3 .nlf-finder-unmatched .choices__list--dropdown {
  display: block !important;
  visibility: visible !important;
  position: absolute !important;
  top: 0 !important;
  bottom: auto !important;
  left: 0 !important;
  right: 0 !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 0 !important;
  max-height: 58px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  z-index: 20 !important;
  background: #fff !important;
}
form[data-form_id="3"] .nlf-finder-unmatched .choices__list--dropdown > .choices__list,
#fluentform_3 .nlf-finder-unmatched .choices__list--dropdown > .choices__list,
form[data-form_id="3"] .nlf-finder-unmatched .choices__list--dropdown .choices__item--choice,
#fluentform_3 .nlf-finder-unmatched .choices__list--dropdown .choices__item--choice {
  display: none !important;
}
form[data-form_id="3"] .nlf-finder-unmatched .choices__list--dropdown .choices__input--cloned,
#fluentform_3 .nlf-finder-unmatched .choices__list--dropdown .choices__input--cloned {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 52px !important;
  margin: 0 !important;
  padding: 12px 40px 12px 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #172f3d !important;
  font: inherit !important;
  font-size: 18px !important;
  box-shadow: none !important;
}
/* Cream dialogs have borderless selectors, so the overlay follows suit. */
.nlf-session-modal form[data-form_id="3"] .nlf-finder-unmatched .choices__list--dropdown,
.nlf-am6-modal form[data-form_id="3"] .nlf-finder-unmatched .choices__list--dropdown {
  background: var(--nlf-finder-paper, #f2ede6) !important;
}
.nlf-session-modal form[data-form_id="3"] .nlf-finder-unmatched .choices__list--dropdown .choices__input--cloned,
.nlf-am6-modal form[data-form_id="3"] .nlf-finder-unmatched .choices__list--dropdown .choices__input--cloned {
  padding: 10px 38px 10px 0 !important;
  border-bottom: 1px solid rgba(23, 47, 61, .36) !important;
  background: transparent !important;
}

/* No extra help line should remain under the active field. */
form[data-form_id="3"] .nlf-finder-custom-hint,
#fluentform_3 .nlf-finder-custom-hint { display: none !important; }

/* Only the navy homepage's intermediate Create Group explanation changes.
 * Light-background About / Session dialogs retain their current ink color
 * and typography from site-fixes-v062.css.
 */
body.home #find-your-group .advice-form-area .fluent_form_3.nlf-group-finder--create .nlf-no-group-message {
  width: 100% !important;
  max-width: min(100%, 830px) !important;
  color: #b5d3fa !important;
  font-size: clamp(17px, 1.35vw, 19px) !important;
  line-height: 1.4 !important;
  font-weight: 400 !important;
  text-align: center !important;
  text-wrap: balance;
}

/* Light-background About and Session form dialogs use the same blue as the
 * FIND YOUR GROUP heading, rather than the homepage panel's pale blue. */
.nlf-session-modal .fluent_form_3.nlf-group-finder--create .nlf-no-group-message,
.nlf-am6-modal .fluent_form_3.nlf-group-finder--create .nlf-no-group-message {
  color: var(--nlf-finder-blue, #285b8f) !important;
}


/* v0.6.27: Only the genuinely unmatched input uses the quiet overlay.
 * Matching saved options must retain the full Choices.js dropdown/list.
 * Keep default no-results notices invisible if a widget has not yet exposed
 * its search inventory (it can still show an empty panel in that case).
 */
form[data-form_id="3"] .choices__list--dropdown .choices__item.has-no-results,
form[data-form_id="3"] .choices__list--dropdown .choices__item.has-no-choices,
#fluentform_3 .choices__list--dropdown .choices__item.has-no-results,
#fluentform_3 .choices__list--dropdown .choices__item.has-no-choices {
  display: none !important;
}
