/* Reichert Formschutz — widget styling (REI-525).
   ALTCHA's own custom properties only; the widget lives in a shadow root, so
   this is the whole supported surface. The accent pair is set inline per site,
   see RI_Formschutz::accent(). Mirrors src/resources/sass/partials/_captcha.scss. */

.ri-formschutz {
  margin: 0 0 1rem;

  /* Gravity Forms and Elementor both lay their submit rows out as flex, so
     width alone leaves the widget squeezed in beside the button. flex-basis
     drops it onto its own line; it is inert outside a flex container. */
  width: 100%;
  max-width: 480px;
  flex: 0 0 100%;
}

.ri-formschutz altcha-widget {
  display: block;

  /* Stock 320px is cramped, full-bleed on a wide form is worse — the cap is on
     the wrapper above, so this just fills it. */
  --altcha-max-width: 100%;
  --altcha-border-radius: 4px;

  --altcha-color-success: var(--ri-formschutz-accent, #00487e);
  --altcha-color-success-content: var(--ri-formschutz-accent-content, #fff);
  --altcha-color-primary: var(--ri-formschutz-accent, #00487e);
  --altcha-color-primary-content: var(--ri-formschutz-accent-content, #fff);
  --altcha-checkbox-outline-color: var(--ri-formschutz-accent, #00487e);
}

/* Piotnet: hidden until ri-formschutz.js has moved the widget into the last
   step of the multistep form, which is also where it drops this class. Staying
   hidden if the script never runs is the safe end: the form then fails its
   check rather than showing a captcha under the wrong step's button. */
.ri-formschutz--defer {
  display: none;
}
