/* Contact Us form: underline fields, floating "Message" label, red Send button.
   Scoped to .cu-form (class added to the form wrapper by contact-us-form.php).
   Row/column layout is left to the existing multi-column plugin. */

.cu-form {
  --cu-line: #9fc3d3;      /* underline / border */
  --cu-muted: #a5bfcd;     /* placeholders + labels */
  --cu-text: #333;
  --cu-accent: #c6401b;    /* "(Required)" + Send button */
}

/* Vertical spacing: every field row gets the SAME gap. Change this one value to tune it.
   :not(#cu) raises specificity above the theme rules in style.css (e.g. the select margin-bottom: 18px
   and the mobile .gfield margin-bottom: 18px) so nothing overrides it. */
.cu-form { --cu-row-gap: 32px; }
/* Only "leaf" fields (those that do not contain other .gfield) carry the gap. Row / column wrapper
   fields from the multi-column plugin get no margin, otherwise their margins stack on top of the
   inner fields' margins and the spacing becomes uneven. */
.cu-form .gfield:not(#cu):not(:has(.gfield)) {
  margin: 0 0 var(--cu-row-gap) !important;
  padding: 0 !important;
}
.cu-form .gfield:not(#cu):has(.gfield) {
  margin: 0 !important;
  padding: 0 !important;
}
.cu-form .gfield:not(#cu) .cu-field,
.cu-form .gfield:not(#cu) .cu-control,
.cu-form .gfield:not(#cu) .cu-field input:not(#cu),
.cu-form .gfield:not(#cu) .cu-field select:not(#cu),
.cu-form .gfield:not(#cu) .ginput_complex,
.cu-form .gfield:not(#cu) .ginput_complex > span { margin-bottom: 0 !important; }
/* The multi-column plugin adds padding-bottom: .5em to every nested div (.gfmc-field div:not(.gchoice)),
   which stacks up (3 nested divs = +21px per row) and makes the gaps bigger than --cu-row-gap. Remove it
   so the gap between rows is exactly --cu-row-gap. */
.cu-form .gfield:not(#cu) div:not(.gchoice):not(.gfield):not(#cu),
.cu-form .gfield:not(#cu) .cu-field:not(#cu),
.cu-form .gfmc-container:not(#cu) { padding-bottom: 0 !important; }
.cu-form .gfmc-container:not(#cu) { margin-bottom: 0 !important; }
/* Labels: regular weight (themes make .gfield_label bold) */
.cu-form .gfield:not(#cu) .cu-label { font-weight: 400 !important; }
.cu-form .gfield:not(#cu) .cu-label .gfield_required { font-weight: 400 !important; }
.cu-form .cu-field--textarea:not(#cu) { margin-top: 0 !important; }

/* Field labels are hidden (placeholders carry the text); Message and the SMS opt-in keep theirs */
.cu-form .cu-field--text > .cu-label,
.cu-form .cu-field--email > .cu-label,
.cu-form .cu-field--phone > .cu-label,
.cu-form .cu-field--select > .cu-label,
.cu-form .cu-field--name > .cu-label,
.cu-form .ginput_complex label {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.cu-form .cu-field { position: relative; display: block; }
.cu-form .cu-control { margin: 0; }

/* First / Last name side by side */
.cu-form .cu-field--name .ginput_complex { display: flex; gap: 8px; }
.cu-form .cu-field--name .ginput_complex > span { flex: 1 1 0; margin: 0; padding: 0; }

/* Underline inputs + select */
.cu-form .cu-field input[type="text"],
.cu-form .cu-field input[type="email"],
.cu-form .cu-field input[type="tel"],
.cu-form .cu-field select {
  width: 100%;
  box-sizing: border-box;
  height: auto;
  padding: 10px 0 8px;
  background-color: transparent;
  border: 0;
  border-bottom: 1px solid var(--cu-line);
  border-radius: 0;
  box-shadow: none;
  color: var(--cu-text);
  font-size: 17px;
  line-height: 1.3;
}
.cu-form .cu-field input::placeholder {
  color: var(--cu-muted);
  font-style: italic;
  opacity: 1;
}
.cu-form .cu-field input:focus,
.cu-form .cu-field select:focus,
.cu-form .cu-field textarea:focus {
  outline: none;
  border-color: var(--cu-accent);
}

/* Select: italic muted text, dark chevron on the right */
.cu-form .cu-field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 24px;
  color: var(--cu-muted);
  font-style: italic;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23222' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

/* Opt In to SMS: label then rounded checkbox on one line */
.cu-form .cu-field--checkbox { display: flex; align-items: center; gap: 18px; }
.cu-form .cu-field--checkbox > .cu-label {
  position: static;
  width: auto;
  height: auto;
  clip: auto;
  margin: 0;
  color: var(--cu-muted);
  font-size: 17px;
  font-weight: 400;
}
.cu-form .cu-field--checkbox .gfield_checkbox { margin: 0; padding: 0; list-style: none; display: flex; }
.cu-form .cu-field--checkbox .gchoice { display: flex; align-items: center; gap: 8px; margin: 0; }
.cu-form .cu-field--checkbox input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  flex: 0 0 22px;
  border: 1px solid var(--cu-line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  position: relative;
}
.cu-form .cu-field--checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid var(--cu-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.cu-form .cu-field--checkbox .gchoice label { color: var(--cu-muted); font-size: 17px; margin: 0; }

/* Message: bordered box, label sits on the top border */
.cu-form .cu-field--textarea { margin-top: 10px; }
.cu-form .cu-field--textarea > .cu-label {
  position: absolute;
  top: -12px;
  left: 0;
  z-index: 1;
  padding-right: 4px;
  background: #fff;
  color: var(--cu-muted);
  font-size: 17px;
  font-weight: 400;
  line-height: 24px;
}
.cu-form .cu-field--textarea textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 320px;
  padding: 18px 14px;
  background: transparent;
  border: 1px solid var(--cu-line);
  border-radius: 0;
  box-shadow: none;
  color: var(--cu-text);
  font-size: 17px;
  resize: vertical;
}

/* "(Required)" marker: red italic */
.cu-form .cu-required,
.cu-form .gfield_required {
  color: var(--cu-accent);
  font-style: italic;
  font-size: 0.9em;
  margin-left: 2px;
}

.cu-form .cu-error { color: var(--cu-accent); font-size: 14px; margin-top: 4px; }
/* Plain red text under the field (no box). Overrides the boxed style in style.css. */
.contact-page .gform_wrapper .cu-form .gfield_error .gfield_validation_message,
.contact-page .gform_wrapper.cu-form .gfield_error .gfield_validation_message,
.contact-page .gform_wrapper .gfield_error .cu-error,
.cu-form .cu-error {
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 4px 0 0 !important;
  text-align: left !important;
  color: #c02b0a !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
  box-shadow: none !important;
}
/* No extra space between the input and its message */
.cu-form .cu-control,
.cu-form .cu-control .ginput_complex,
.cu-form .cu-control .ginput_complex > span,
.cu-form .cu-field input,
.cu-form .cu-field select { margin-bottom: 0 !important; }
.cu-form .cu-field .cu-error { margin-top: 2px !important; }
/* Empty message shells (the stray box at the top) */
.contact-page .gform_wrapper .gfield_validation_message:empty,
.contact-page .gform_wrapper .validation_message:empty { display: none !important; }
/* Summary box is removed: hide the empty shell left by the theme styles. */
.contact-page .gform_wrapper .gform_validation_errors,
.cu-form .gform_validation_errors { display: none !important; }

/* Send button: centered red block */
.cu-form .gform_footer,
.cu-form .gform_page_footer {
  display: flex;
  justify-content: center;
  margin: 24px 0 0;
  padding: 0;
}
.cu-form .gform_footer input[type="submit"],
.cu-form .gform_footer button,
.cu-form .gform_page_footer input[type="submit"] {
  background: var(--cu-accent);
  color: #fff;
  border: 0;
  border-radius: 3px;
  padding: 12px 22px;
  font-size: 17px;
  line-height: 1.2;
  cursor: pointer;
}
.cu-form .gform_footer input[type="submit"]:hover,
.cu-form .gform_footer button:hover { filter: brightness(1.08); }
