/*
 * forms-cf7.css: the Contact Form 7 states the owner's stylesheet does not cover
 * (invalid-field tip, response message, spinner, and the form hidden once sent,
 * as Squarespace replaced it by the thank-you text). Loaded after ohm-custom.css,
 * only on pages whose sections carry a form (/contact and /investors).
 *
 * The site plugin switches Contact Form 7's own stylesheet off (wpcf7_load_css), so
 * the two rules it supplied for markup it prints around every form (the set of
 * hidden fields and the response kept for screen readers) are written here as
 * well. Nothing here touches the look of the form before it is sent: fonts and
 * field styles come from ohm-custom.css (.form-wrapper), colours from its palette.
 * The texts Contact Form 7 writes (the response and the field tips) are set in the owner's
 * body face (ohm-custom.css, body: 'Inter', sans-serif) by name (R18), never the template
 * serif base.css gives #siteWrapper for text the owner never styled.
 */

/* R18: Contact Form 7's own texts in the owner's body face. */
.wpcf7 form .wpcf7-response-output,
.wpcf7-not-valid-tip {
  font-family: 'Inter', sans-serif;
}

/* Contact Form 7's hidden fields sit in a fieldset of their own: nothing of it shows. */
.wpcf7 .hidden-fields-container {
  display: none;
}

/* The response for screen readers: read out, never shown. */
.wpcf7 .screen-reader-response {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* A field that needs attention: its border in the owner's gold, the reason below it. */
.form-wrapper .field-list .field .field-element.wpcf7-not-valid {
  border-color: var(--ohm-gold) !important;
}

.wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ohm-gold-hi);
}

/* The response under the form: the thank-you text, or what went wrong. Hidden until a submission. */
.wpcf7 form .wpcf7-response-output {
  margin: 16px 0 0;
  padding: 0;
  color: var(--ohm-white);
}

.wpcf7 form.init .wpcf7-response-output,
.wpcf7 form.resetting .wpcf7-response-output,
.wpcf7 form.submitting .wpcf7-response-output {
  display: none;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output {
  color: var(--ohm-gold-hi);
}

/* Once sent, the form gives way to the thank-you text, as on Squarespace. */
.wpcf7 form.sent .field-list,
.wpcf7 form.sent .form-button-wrapper {
  display: none;
}

.wpcf7 form.sent .wpcf7-response-output {
  margin-top: 0;
}

/* The spinner Contact Form 7's script puts after the button: shown only while sending. */
.wpcf7-spinner {
  display: none;
}

.wpcf7 form.submitting .wpcf7-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-left: 16px;
  vertical-align: middle;
  border: 2px solid var(--ohm-line);
  border-top-color: var(--ohm-purple-hi);
  border-radius: 50%;
  animation: ohm-cf7-spin 0.8s linear infinite;
}

@keyframes ohm-cf7-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wpcf7 form.submitting .wpcf7-spinner {
    animation: none;
  }
}
