/* Security check of the contact forms. It takes no space until it has something to show. */
.faist-fs {
  display: block;
  position: relative;
  /* The check is at least 300px wide. In a narrower column it grows evenly to both sides. */
  margin: 0 min(0px, calc((100% - 300px) / 2));
  font-size: 0;
  line-height: 0;
  text-align: left;
}

/* Visible: same frame as the form fields, same distance to the button as between two fields. */
.faist-fs--offen {
  margin-bottom: 30px;
  border-radius: 10px;
  overflow: hidden;
}

.faist-fs--offen::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #000;
  border-radius: 10px;
  pointer-events: none;
  transition: border-color 0.3s;
}

/* The visitor tried to send, but the check still needs them. */
.faist-fs--achtung::after {
  border-color: #ff0827;
  box-shadow: inset 0 0 0 1px #ff0827;
}

.faist-fs:focus {
  outline: none;
}

/* Waiting for the check after the button was pressed: the same sign the form shows while sending. */
.wpcf7-form.faist-fs-wartet .wpcf7-spinner {
  visibility: visible;
}

/* One column on small screens: the fields are closer together there. */
@media (max-width: 768px) {
  .faist-fs--offen {
    margin-bottom: 15px;
  }
}

/*
 * Two columns: the column of the button can be narrower than the 300px the check needs.
 * While the check is visible, that column gets the width and the column next to it gives it up.
 */
@media (min-width: 769px) {
  .faist-fs-zeile--offen > .cf7-left {
    flex: 1 1 0;
    min-width: 0;
  }

  .faist-fs-zeile--offen > .cf7-right {
    flex: 0 0 max(30%, 300px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .faist-fs--offen::after {
    transition: none;
  }
}
