/*
 * Fluent Forms, restyled to the Elementa enquiry design.
 *
 * Loaded only when Fluent Forms is active (see functions.php). Every rule is
 * scoped to .e-form--fluent, the wrapper \Elementa\Forms\render() prints around
 * the shortcode, and carries three classes so it always outranks the plugin's
 * own two-class selectors without !important.
 *
 * The design: underline-only inputs, small normal-case labels, a pill submit,
 * and colours inherited from the section so the same form works on the dark
 * enquiry band and on a white contact card. --fg, --bg, --fg-muted, --line and
 * --line-strong are the context pairs main.css sets per section; every var()
 * carries a fallback for a context that does not define them.
 */

.e-form--fluent .fluentform,
.e-form--fluent .frm-fluent-form {
  color: inherit;
  font: inherit;
}

.e-form--fluent .fluentform .ff-el-group {
  margin: 0 0 1.75rem;
}

.e-form--fluent .fluentform .ff-el-group.ff-el-form-check,
.e-form--fluent .fluentform .ff-el-group:last-child {
  margin-bottom: 0;
}

/* Labels */
.e-form--fluent .fluentform .ff-el-input--label label,
.e-form--fluent .fluentform .ff-el-input--label,
.e-form--fluent .fluentform .ff-el-input--label.ff-el-is-required.asterisk-right label::after,
.e-form--fluent .fluentform .ff-el-input--label.ff-el-is-required.asterisk-left label::before {
  display: inline-block;
  margin: 0 0 .35rem;
  padding: 0;
  font-size: var(--t-small, .875rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
  color: var(--fg, inherit);
}

/* Inputs, selects, textareas: one underline, nothing else */
.e-form--fluent .fluentform .ff-el-form-control,
.e-form--fluent .fluentform .ff-el-form-control:hover,
.e-form--fluent .fluentform select.ff-el-form-control,
.e-form--fluent .fluentform textarea.ff-el-form-control {
  width: 100%;
  min-height: 0;
  height: auto;
  padding: .75em 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong, currentColor);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--t-body, 1rem);
  line-height: 1.4;
  box-shadow: none;
  transition: border-color .25s, box-shadow .25s;
}

.e-form--fluent .fluentform select.ff-el-form-control {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: none;
}

.e-form--fluent .fluentform textarea.ff-el-form-control {
  min-height: 5.5rem;
  resize: vertical;
}

.e-form--fluent .fluentform .ff-el-form-control::placeholder {
  color: var(--fg-muted, currentColor);
  opacity: .7;
}

.e-form--fluent .fluentform .ff-el-form-control:focus,
.e-form--fluent .fluentform .ff-el-form-control:focus-visible {
  outline: none;
  border-bottom-color: var(--fg, currentColor);
  box-shadow: 0 1px 0 var(--fg, currentColor);
}

/* Checkbox and radio rows */
.e-form--fluent .fluentform .ff-el-form-check {
  margin: 0 0 .5rem;
}

.e-form--fluent .fluentform .ff-el-form-check-label,
.e-form--fluent .fluentform .ff-el-form-check label {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: inherit;
  font-size: var(--t-small, .875rem);
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1.4;
  cursor: pointer;
}

.e-form--fluent .fluentform .ff-el-form-check-input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  border: 1px solid var(--line-strong, currentColor);
  background: transparent;
  accent-color: var(--fg, currentColor);
}

/* Submit: the design's solid pill (.e-btn--solid) */
.e-form--fluent .fluentform .ff-btn-submit,
.e-form--fluent .fluentform .ff-btn-submit:hover,
.e-form--fluent .fluentform .ff-btn-submit:focus {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  min-height: 0;
  height: auto;
  padding: .9em 1.6em;
  border: 1px solid var(--fg, #0e0e0e);
  border-radius: 999px;
  background: var(--fg, #0e0e0e);
  color: var(--bg, #ffffff);
  font: inherit;
  font-size: .9375rem;   /* 15px Light, as .e-btn */
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
  transition: background .25s, color .25s, border-color .25s;
}

.e-form--fluent .fluentform .ff-btn-submit:hover {
  background: transparent;
  color: var(--fg, #0e0e0e);
}

.e-form--fluent .fluentform .ff-btn-submit:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.e-form--fluent .fluentform .ff-btn-submit[disabled] {
  opacity: .5;
  cursor: default;
}

.e-form--fluent .fluentform .ff_submit_btn_wrapper,
.e-form--fluent .fluentform .ff-el-group.ff_submit_btn_wrapper {
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line, rgba(0, 0, 0, .14));
}

/* Messages */
.e-form--fluent .fluentform .ff-message-success,
.e-form--fluent .ff-message-success {
  margin: 0;
  padding: 1.5rem 0 0;
  border: 0;
  border-top: 1px solid var(--line, rgba(0, 0, 0, .14));
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: var(--t-lede, 1.125rem);
  line-height: 1.5;
}

.e-form--fluent .fluentform .ff-el-is-error .ff-el-form-control {
  border-bottom-color: currentColor;
}

.e-form--fluent .fluentform .ff-el-is-error .text-danger,
.e-form--fluent .fluentform .error,
.e-form--fluent .fluentform .ff-errors-in-stack {
  margin-top: .35rem;
  color: inherit;
  font-size: .75rem;
  letter-spacing: 0;
  opacity: .85;
}

.e-form--fluent .fluentform .ff-el-help-message {
  color: var(--fg-muted, inherit);
  font-size: .75rem;
}

/* Two-column rows the plugin builds with its own grid keep the design gutter */
.e-form--fluent .fluentform .ff-t-container {
  gap: 1.5rem;
}

.e-form--fluent .fluentform .ff-t-cell {
  padding: 0;
}

/* Elementa layout: the theme creates its Fluent forms with these container
   classes (inc/fluent-setup.php): e-ff-chips on the "I'm looking for" group,
   e-ff-half on the four short fields, e-ff-inline on the newsletter email. */

.e-form--fluent .fluentform,
.e-form--fluent .fluentform form,
.e-form--fluent .fluentform .ff-el-group,
.e-subscribe--fluent .fluentform,
.e-subscribe--fluent .fluentform form {
  min-width: 0;
  max-width: 100%;
}

.e-form--fluent .fluentform .ff-el-form-control,
.e-form--fluent .fluentform textarea.ff-el-form-control {
  box-sizing: border-box;
  max-width: 100%;
}

/* Two-column field grid on wider screens */
.e-form--fluent .fluentform form.frm-fluent-form > fieldset {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 1.5rem;
  row-gap: 0;
}
.e-form--fluent .fluentform .ff-el-group,
.e-form--fluent .fluentform legend { grid-column: 1 / -1; }
@media (min-width: 48rem) {
  .e-form--fluent .fluentform form.frm-fluent-form > fieldset { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .e-form--fluent .fluentform .ff-el-group.e-ff-half { grid-column: span 1; }
}

/* Chips: the checkboxes become the design's pills */
.e-form--fluent .fluentform .ff-el-group.e-ff-chips .ff-el-input--label label {
  font-size: var(--t-h3, 1.5rem);
  font-weight: 300;
  letter-spacing: -.01em;
  text-transform: none;
  color: inherit;
  margin-bottom: 1rem;
}
.e-form--fluent .fluentform .ff-el-group.e-ff-chips .ff-el-form-check,
.e-form--fluent .fluentform .ff-el-group.e-ff-chips .ff-el-form-check-inline {
  display: inline-block;
  margin: 0 .5rem .5rem 0;
  vertical-align: top;
}
.e-form--fluent .fluentform .ff-el-group.e-ff-chips .ff-el-form-check-label,
.e-form--fluent .fluentform .ff-el-group.e-ff-chips .ff-el-form-check label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: .8em 1.25em;
  border: 1px solid var(--line-strong, currentColor);
  border-radius: 999px;
  font-size: .9375rem;   /* 15px Light, as .e-chip */
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1;
  user-select: none;
  transition: background .25s, color .25s, border-color .25s;
}
.e-form--fluent .fluentform .ff-el-group.e-ff-chips .ff-el-form-check-label:hover { border-color: var(--fg, currentColor); }
.e-form--fluent .fluentform .ff-el-group.e-ff-chips .ff-el-form-check-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.e-form--fluent .fluentform .ff-el-group.e-ff-chips .ff-el-form-check-label:has(.ff-el-form-check-input:checked) {
  background: var(--fg, #0e0e0e);
  color: var(--bg, #ffffff);
  border-color: var(--fg, #0e0e0e);
}
.e-form--fluent .fluentform .ff-el-group.e-ff-chips .ff-el-form-check-label:has(.ff-el-form-check-input:focus-visible) {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Newsletter: one underline, the field and the button on a single line */
.e-subscribe--fluent { display: block; max-width: 22rem; border: 0; }
.e-subscribe--fluent .fluentform form.frm-fluent-form > fieldset {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid var(--line-strong, currentColor);
  transition: border-color .25s;
}
.e-subscribe--fluent .fluentform form.frm-fluent-form > fieldset:focus-within { border-bottom-color: var(--fg, currentColor); }
.e-subscribe--fluent .fluentform .ff-el-group { flex: 1 1 auto; min-width: 0; margin: 0; }
.e-subscribe--fluent .fluentform .ff-el-group.ff_submit_btn_wrapper { flex: 0 0 auto; border: 0; padding: 0; }
.e-subscribe--fluent .fluentform .ff-el-input--label { display: none; }
.e-subscribe--fluent .fluentform .ff-el-form-control {
  width: 100%;
  min-height: 0;
  padding: .75em 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--t-small, .875rem);   /* 14px, the live newsletter field */
  box-shadow: none;
}
.e-subscribe--fluent .fluentform .ff-el-form-control::placeholder { color: var(--e-muted, #b2b2b2); opacity: 1; }   /* the live placeholder */
.e-subscribe--fluent .fluentform .ff-el-form-control:focus { outline: none; box-shadow: none; }
.e-subscribe--fluent .fluentform .ff-btn-submit {
  min-height: 0;
  height: auto;
  padding: .6em 1em;
  border: 1px solid var(--line-strong, currentColor);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--t-small, .875rem);
  line-height: 1;
  cursor: pointer;
  transition: background .25s, color .25s;
}
.e-subscribe--fluent .fluentform .ff-btn-submit:hover { background: var(--fg, currentColor); color: var(--bg, #0e0e0e); }
.e-subscribe--fluent .fluentform .ff-message-success { font-size: var(--t-small, .875rem); padding: .75rem 0 0; border: 0; }
.e-subscribe--fluent .fluentform .ff-errors-in-stack,
.e-subscribe--fluent .fluentform .text-danger { font-size: .75rem; }

/* An error line from an outdated page (inc/forms.php) goes once the Fluent form has sent. */
.e-form--fluent:has(.ff-message-success) > .e-form__error,
.e-subscribe__error:has(+ .e-subscribe--fluent .ff-message-success) { display: none; }
