/**
 * RT Formbuilder Frontend — moderne Formularoptik (0.20.1)
 * Schriften lokal (DSGVO); Labels/ARIA für Barrierefreiheit.
 */

.rtfb-form {
  --rtfb-gap: 1.05rem;
  --rtfb-theme-bg: #ffffff;
  --rtfb-theme-text: #333333;
  --rtfb-theme-muted: #5f6875;
  --rtfb-theme-border: #d7dde5;
  --rtfb-theme-primary: #006ab5;
  --rtfb-theme-button-text: #ffffff;
  --rtfb-theme-radius: 0.375rem;
  --rtfb-theme-field-bg: #ffffff;
  --rtfb-theme-focus: rgba(0, 106, 181, 0.14);
  align-items: flex-start;
  background: var(--rtfb-theme-bg);
  color: var(--rtfb-theme-text);
  display: flex;
  flex-wrap: wrap;
  font-family: inherit;
  gap: var(--rtfb-gap);
  margin: 1.75rem 0;
  max-width: 720px;
}


.rtfb-form,
.rtfb-form *,
.rtfb-form *::before,
.rtfb-form *::after {
  box-sizing: border-box;
}

/* Höhere Kapselung gegen Theme- und Pagebuilder-Standardstile. */
.rtfb-form.rtfb-form input,
.rtfb-form.rtfb-form select,
.rtfb-form.rtfb-form textarea,
.rtfb-form.rtfb-form button {
  box-shadow: none;
  line-height: normal;
  margin: 0;
  max-width: 100%;
}

.rtfb-field {
  box-sizing: border-box;
  flex: 0 0 100%;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.rtfb-width-full { flex: 0 0 100%; max-width: 100%; width: 100%; }
.rtfb-width-two-thirds {
  flex: 0 0 calc(((100% - (var(--rtfb-gap) * 2)) / 3) * 2 + var(--rtfb-gap));
  max-width: calc(((100% - (var(--rtfb-gap) * 2)) / 3) * 2 + var(--rtfb-gap));
  width: calc(((100% - (var(--rtfb-gap) * 2)) / 3) * 2 + var(--rtfb-gap));
}
.rtfb-width-half {
  flex: 0 0 calc((100% - var(--rtfb-gap)) / 2);
  max-width: calc((100% - var(--rtfb-gap)) / 2);
  width: calc((100% - var(--rtfb-gap)) / 2);
}
.rtfb-width-third {
  flex: 0 0 calc((100% - (var(--rtfb-gap) * 2)) / 3);
  max-width: calc((100% - (var(--rtfb-gap) * 2)) / 3);
  width: calc((100% - (var(--rtfb-gap) * 2)) / 3);
}

.rtfb-form label,
.rtfb-field label {
  color: var(--rtfb-theme-text);
  display: block;
  font-family: var(--rtfb-label-font-family, inherit);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.45rem;
}

.rtfb-field input[type="text"],
.rtfb-field input[type="email"],
.rtfb-field input[type="tel"],
.rtfb-field input[type="number"],
.rtfb-field input[type="url"],
.rtfb-field input[type="date"],
.rtfb-field input[type="time"],
.rtfb-field input[type="datetime-local"],
.rtfb-field input[type="password"],
.rtfb-field input[type="month"],
.rtfb-field input[type="week"],
.rtfb-field input[type="file"],
.rtfb-field input[type="color"],
.rtfb-field select,
.rtfb-field textarea {
  background: var(--rtfb-theme-field-bg);
  border: 1px solid var(--rtfb-theme-border);
  border-radius: var(--rtfb-theme-radius);
  box-sizing: border-box;
  color: var(--rtfb-theme-text);
  font: inherit;
  font-family: var(--rtfb-input-font-family, inherit);
  min-height: 42px;
  padding: 0.72rem 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.rtfb-field input:focus,
.rtfb-field select:focus,
.rtfb-field textarea:focus {
  border-color: var(--rtfb-theme-primary);
  box-shadow: 0 0 0 3px var(--rtfb-theme-focus);
  outline: none;
}

.rtfb-field textarea {
  min-height: 140px;
  resize: vertical;
}

.rtfb-field input[type="range"] {
  width: 100%;
}

.rtfb-checkbox,
.rtfb-choice {
  align-items: flex-start;
  display: flex;
  gap: 0.55rem;
  line-height: 1.45;
}

.rtfb-checkbox input,
.rtfb-choice input {
  flex: 0 0 auto;
  margin-top: 0.2rem;
}

.rtfb-field-checkbox.rtfb-width-full,
.rtfb-field-decision_box.rtfb-width-full {
  flex: 0 0 auto;
  max-width: 100%;
  width: auto;
}

.rtfb-checkbox {
  display: inline-flex;
  margin: 0;
  width: auto;
}

.rtfb-field-consent .rtfb-checkbox {
  display: flex;
  width: 100%;
}

.rtfb-choice-group {
  border: 0;
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.rtfb-choice-group legend {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.rtfb-heading {
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.rtfb-heading-text > :first-child,
.rtfb-html > :first-child,
.rtfb-section-text > :first-child {
  margin-top: 0;
}

.rtfb-heading-text > :last-child,
.rtfb-html > :last-child,
.rtfb-section-text > :last-child {
  margin-bottom: 0;
}

.rtfb-section h3 {
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.rtfb-separator {
  border: 0;
  border-top: 1px solid var(--rtfb-theme-border);
  margin: 0.75rem 0;
}

.rtfb-spacer {
  min-height: 28px;
}

.rtfb-image {
  border-radius: calc(var(--rtfb-theme-radius) - 2px);
  display: block;
  height: auto;
  max-width: 100%;
}

.rtfb-inline-button,
.rtfb-placeholder-field {
  border: 1px solid var(--rtfb-theme-border);
  border-radius: var(--rtfb-theme-radius);
  display: inline-block;
  font: inherit;
  padding: 0.7rem 0.9rem;
}

.rtfb-captcha-label {
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.rtfb-captcha-wrap {
  min-height: 65px;
}

.rtfb-captcha-missing {
  background: color-mix(in srgb, #b45309 12%, transparent);
  border: 1px solid color-mix(in srgb, #b45309 35%, transparent);
  border-radius: var(--rtfb-theme-radius);
  color: #92400e;
  font-size: 0.92em;
  margin: 0;
  padding: 0.65rem 0.8rem;
}

.rtfb-field-turnstile .rtfb-field-error,
.rtfb-field-hcaptcha .rtfb-field-error,
.rtfb-field-recaptcha .rtfb-field-error {
  margin-top: 0.5rem;
}

.rtfb-submit {
  background: var(--rtfb-theme-primary);
  border: 0;
  border-radius: var(--rtfb-theme-radius);
  color: var(--rtfb-theme-button-text);
  cursor: pointer;
  flex: 0 0 100%;
  font: inherit;
  font-family: var(--rtfb-button-font-family, inherit);
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 100%;
  min-height: 48px;
  padding: 0.8rem 1.25rem;
  transition: filter 0.15s ease, transform 0.15s ease;
  width: 100%;
}

.rtfb-submit:hover {
  filter: brightness(1.06);
}

.rtfb-submit:active {
  transform: translateY(1px);
}

.rtfb-required {
  color: #b91c1c;
  font-weight: 700;
}

.rtfb-message {
  border-radius: var(--rtfb-theme-radius);
  margin: 1rem 0;
  padding: 0.9rem 1rem;
}

.rtfb-message-success {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.rtfb-message-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.rtfb-field.rtfb-has-error input,
.rtfb-field.rtfb-has-error select,
.rtfb-field.rtfb-has-error textarea {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.rtfb-field-error {
  color: #b91c1c;
  font-size: 0.86rem;
  font-weight: 600;
  margin: 0.45rem 0 0;
}

.rtfb-form :focus-visible {
  outline: 3px solid var(--rtfb-theme-primary);
  outline-offset: 2px;
}

.rtfb-form .screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

@media (prefers-reduced-motion: reduce) {
  .rtfb-form *,
  .rtfb-form *::before,
  .rtfb-form *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.rtfb-upload-hint {
  color: var(--rtfb-theme-muted);
  font-size: 0.82rem;
  margin: 0.4rem 0 0;
}

.rtfb-hp {
  height: 0;
  left: -9999px;
  overflow: hidden;
  position: absolute;
  width: 0;
}

.rtfb-is-logic-hidden {
  display: none !important;
}

.rtfb-calculation-wrap {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.rtfb-calculation-wrap input[readonly] {
  background: color-mix(in srgb, var(--rtfb-theme-field-bg) 88%, #eef2f7);
  font-weight: 600;
}

.rtfb-calculation-prefix,
.rtfb-calculation-suffix {
  color: var(--rtfb-theme-muted);
  font-size: 0.95em;
  font-weight: 600;
  white-space: nowrap;
}

/* Themes */
.rtfb-theme-clean {
  --rtfb-theme-primary: #006ab5;
  --rtfb-theme-border: #d7dde5;
  --rtfb-theme-focus: rgba(0, 106, 181, 0.14);
}

.rtfb-theme-business {
  --rtfb-theme-primary: #00538f;
  --rtfb-theme-border: #b8c6d6;
  --rtfb-theme-field-bg: #f8fbff;
  --rtfb-theme-focus: rgba(0, 83, 143, 0.18);
  --rtfb-theme-radius: 0.35rem;
  border: 1px solid #d7e3ef;
  padding: 1.25rem 1.35rem;
}

.rtfb-theme-business .rtfb-submit {
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
}

.rtfb-theme-minimal {
  --rtfb-theme-primary: #111827;
  --rtfb-theme-border: #e5e7eb;
  --rtfb-theme-radius: 0;
  --rtfb-theme-bg: transparent;
  --rtfb-theme-focus: rgba(17, 24, 39, 0.12);
}

.rtfb-theme-minimal .rtfb-field input,
.rtfb-theme-minimal .rtfb-field select,
.rtfb-theme-minimal .rtfb-field textarea {
  border-width: 0 0 1px;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
}

.rtfb-theme-minimal .rtfb-submit {
  background: transparent;
  border: 1px solid var(--rtfb-theme-primary);
  color: var(--rtfb-theme-primary);
}

.rtfb-theme-soft {
  --rtfb-theme-primary: #4f6bed;
  --rtfb-theme-border: #c7d2fe;
  --rtfb-theme-bg: #f8f9ff;
  --rtfb-theme-field-bg: #ffffff;
  --rtfb-theme-radius: 0.85rem;
  --rtfb-theme-focus: rgba(79, 107, 237, 0.18);
  padding: 1.35rem;
  border-radius: 1rem;
}

.rtfb-theme-soft .rtfb-submit {
  box-shadow: 0 8px 20px rgba(79, 107, 237, 0.22);
}

.rtfb-theme-contrast {
  --rtfb-theme-primary: #000000;
  --rtfb-theme-border: #000000;
  --rtfb-theme-bg: #ffffff;
  --rtfb-theme-text: #000000;
  --rtfb-theme-radius: 0;
  --rtfb-theme-focus: rgba(0, 0, 0, 0.12);
}

.rtfb-theme-contrast .rtfb-field input,
.rtfb-theme-contrast .rtfb-field select,
.rtfb-theme-contrast .rtfb-field textarea {
  border-width: 2px;
}

.rtfb-theme-contrast .rtfb-submit {
  box-shadow: 4px 4px 0 #000;
  font-weight: 800;
}

.rtfb-theme-dark {
  --rtfb-theme-primary: #5eead4;
  --rtfb-theme-border: #334155;
  --rtfb-theme-bg: #0f172a;
  --rtfb-theme-text: #f8fafc;
  --rtfb-theme-muted: #cbd5e1;
  --rtfb-theme-field-bg: #111827;
  --rtfb-theme-button-text: #0f172a;
  --rtfb-theme-focus: rgba(94, 234, 212, 0.22);
  padding: 1.35rem;
  border-radius: 0.75rem;
}

.rtfb-theme-warm {
  --rtfb-theme-primary: #c2410c;
  --rtfb-theme-border: #fed7aa;
  --rtfb-theme-bg: #fff7ed;
  --rtfb-theme-field-bg: #ffffff;
  --rtfb-theme-focus: rgba(194, 65, 12, 0.16);
  padding: 1.35rem;
  border-radius: 0.75rem;
}

.rtfb-theme-fresh {
  --rtfb-theme-primary: #047857;
  --rtfb-theme-border: #a7f3d0;
  --rtfb-theme-bg: #f0fdf4;
  --rtfb-theme-field-bg: #ffffff;
  --rtfb-theme-focus: rgba(4, 120, 87, 0.16);
  padding: 1.35rem;
  border-radius: 1rem;
}

.rtfb-theme-premium {
  --rtfb-theme-primary: #8b5a2b;
  --rtfb-theme-border: #d6c6a8;
  --rtfb-theme-bg: #fffdf7;
  --rtfb-theme-field-bg: #ffffff;
  --rtfb-theme-radius: 0.25rem;
  --rtfb-theme-focus: rgba(139, 90, 43, 0.16);
  padding: 1.5rem;
  border: 2px solid #d6c6a8;
}

.rtfb-theme-premium .rtfb-submit {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.rtfb-theme-compact {
  --rtfb-gap: 0.7rem;
  --rtfb-theme-primary: #334155;
  --rtfb-theme-border: #cbd5e1;
  --rtfb-theme-radius: 0.3rem;
  --rtfb-theme-focus: rgba(51, 65, 85, 0.14);
  font-size: 0.95rem;
}

.rtfb-theme-compact .rtfb-field input,
.rtfb-theme-compact .rtfb-field select,
.rtfb-theme-compact .rtfb-field textarea {
  min-height: 38px;
  padding: 0.5rem 0.65rem;
}

.rtfb-theme-compact .rtfb-submit {
  min-height: 40px;
  padding: 0.55rem 0.9rem;
}

/* Image select */
.rtfb-image-select-group {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.rtfb-image-choice {
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 0.45rem;
  width: var(--rtfb-image-item-size, 160px);
}

.rtfb-image-choice input {
  opacity: 0;
  position: absolute;
}

.rtfb-image-choice-media {
  align-items: center;
  aspect-ratio: 1.2 / 1;
  background: var(--rtfb-theme-field-bg);
  border: 2px solid var(--rtfb-theme-border);
  border-radius: var(--rtfb-theme-radius);
  display: flex;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.rtfb-image-choice-media img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.rtfb-image-choice-label {
  font-size: 0.92em;
  font-weight: 600;
  line-height: 1.25;
}

.rtfb-hide-image-labels .rtfb-image-choice-label {
  display: none;
}

.rtfb-image-choice-check {
  align-items: center;
  background: var(--rtfb-theme-primary);
  border-radius: 999px;
  color: var(--rtfb-theme-button-text);
  display: none;
  font-weight: 800;
  height: 26px;
  justify-content: center;
  position: absolute;
  width: 26px;
}

.rtfb-image-choice input:checked + .rtfb-image-choice-media {
  border-color: var(--rtfb-theme-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rtfb-theme-primary) 20%, transparent);
}

.rtfb-image-choice input:checked + .rtfb-image-choice-media .rtfb-image-choice-check {
  display: inline-flex;
}

.rtfb-check-top_left .rtfb-image-choice-check { left: 8px; top: 8px; }
.rtfb-check-top_right .rtfb-image-choice-check { right: 8px; top: 8px; }
.rtfb-check-center .rtfb-image-choice-check { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.rtfb-check-bottom_left .rtfb-image-choice-check { bottom: 8px; left: 8px; }
.rtfb-check-bottom_right .rtfb-image-choice-check { bottom: 8px; right: 8px; }

/* Signature */
.rtfb-signature-pad {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

.rtfb-signature-pad canvas {
  background: #fff;
  border: 1px solid var(--rtfb-theme-border);
  border-radius: var(--rtfb-theme-radius);
  cursor: crosshair;
  display: block;
  height: 220px;
  max-width: 640px;
  touch-action: none;
  width: 100%;
}

.rtfb-signature-clear {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--rtfb-theme-border);
  border-radius: var(--rtfb-theme-radius);
  color: var(--rtfb-theme-text);
  cursor: pointer;
  font: inherit;
  padding: 7px 12px;
}

.rtfb-signature-invalid canvas {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px #dc2626 inset;
}

.rtfb-signature-invalid::after {
  color: #dc2626;
  content: "Bitte unterschreiben.";
  display: block;
  font-size: 13px;
  margin-top: 2px;
}

@media (max-width: 700px) {
  .rtfb-width-two-thirds,
  .rtfb-width-half,
  .rtfb-width-third {
    flex-basis: 100%;
    max-width: 100%;
    width: 100%;
  }
}

/* 0.20.0: frei platzierbarer Absenden-Button */
.rtfb-submit-field {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.rtfb-button-content {
  align-items: center;
  display: inline-flex;
  gap: 0.55em;
  justify-content: center;
  line-height: 1.2;
}

.rtfb-button-icon {
  display: inline-flex;
  flex: 0 0 auto;
  height: 1.15em;
  width: 1.15em;
}

.rtfb-button-icon svg {
  display: block;
  height: 100%;
  width: 100%;
}

.rtfb-button-text {
  display: inline-block;
}

/* 0.20.0: Hex-/RGBA-Farbfeld */
.rtfb-color-field-control {
  align-items: center;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 48px minmax(150px, 1fr);
  width: 100%;
}

.rtfb-form .rtfb-field input.rtfb-color-field-swatch {
  border: 1px solid var(--rtfb-theme-border);
  border-radius: var(--rtfb-theme-radius);
  cursor: pointer;
  height: 46px;
  min-height: 46px;
  padding: 3px;
  width: 48px;
}

.rtfb-color-field-value {
  min-width: 0;
  width: 100%;
}

.rtfb-form .rtfb-color-field-alpha {
  align-items: center;
  display: grid;
  gap: 0.65rem;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(100px, 1fr) 52px;
  margin: 0;
}

.rtfb-color-field-alpha span,
.rtfb-color-field-alpha output {
  color: var(--rtfb-theme-muted);
  font-size: 0.82em;
}

.rtfb-color-field-alpha output {
  text-align: right;
}

.rtfb-color-field-control.has-invalid-value .rtfb-color-field-value {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px #dc2626;
}

.rtfb-color-preview-swatch {
  border: 1px solid var(--rtfb-theme-border);
  border-radius: var(--rtfb-theme-radius);
  display: inline-block;
  height: 42px;
  width: 48px;
}

@media (max-width: 520px) {
  .rtfb-color-field-control {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .rtfb-color-field-alpha {
    grid-template-columns: 1fr 48px;
  }

  .rtfb-color-field-alpha span {
    grid-column: 1 / -1;
  }
}

/* 0.20.1: konsistente Frontend-Steuerelemente und Builder-Parität */
.rtfb-form.rtfb-form {
  min-width: 0;
  width: 100%;
}

.rtfb-form.rtfb-form fieldset,
.rtfb-form.rtfb-form legend {
  min-width: 0;
}

.rtfb-form.rtfb-form .rtfb-choice-group {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.rtfb-form.rtfb-form .rtfb-choice-group legend {
  color: var(--rtfb-theme-text);
  display: block;
  font-family: var(--rtfb-label-font-family, inherit);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin: 0 0 0.45rem;
  padding: 0;
  width: 100%;
}

.rtfb-form.rtfb-form .rtfb-checkbox,
.rtfb-form.rtfb-form .rtfb-choice {
  align-items: flex-start;
  display: flex;
  gap: 0.55rem;
  line-height: 1.45;
  margin: 0;
  max-width: 100%;
  min-width: 0;
  width: auto;
}

.rtfb-form.rtfb-form .rtfb-checkbox > span,
.rtfb-form.rtfb-form .rtfb-choice > span {
  display: block;
  min-width: 0;
}

.rtfb-form.rtfb-form input[type="checkbox"],
.rtfb-form.rtfb-form input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  background: var(--rtfb-theme-field-bg);
  border: 2px solid var(--rtfb-theme-border);
  box-shadow: none;
  cursor: pointer;
  display: inline-grid;
  flex: 0 0 20px;
  height: 20px;
  margin: 0.08rem 0 0;
  min-height: 20px;
  min-width: 20px;
  padding: 0;
  place-content: center;
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  width: 20px;
}

.rtfb-form.rtfb-form input[type="checkbox"] {
  border-radius: max(3px, calc(var(--rtfb-theme-radius) * 0.55));
}

.rtfb-form.rtfb-form input[type="radio"] {
  border-radius: 50%;
}

.rtfb-form.rtfb-form input[type="checkbox"]::before,
.rtfb-form.rtfb-form input[type="radio"]::before {
  content: "";
  display: block;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.rtfb-form.rtfb-form input[type="checkbox"]::before {
  border: solid var(--rtfb-theme-button-text);
  border-width: 0 2px 2px 0;
  height: 9px;
  transform: rotate(45deg) scale(0.5);
  width: 5px;
}

.rtfb-form.rtfb-form input[type="radio"]::before {
  background: var(--rtfb-theme-button-text);
  border-radius: 50%;
  height: 8px;
  width: 8px;
}

.rtfb-form.rtfb-form input[type="checkbox"]:checked,
.rtfb-form.rtfb-form input[type="radio"]:checked {
  background: var(--rtfb-theme-primary);
  border-color: var(--rtfb-theme-primary);
}

.rtfb-form.rtfb-form input[type="checkbox"]:checked::before {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.rtfb-form.rtfb-form input[type="radio"]:checked::before {
  opacity: 1;
  transform: scale(1);
}

.rtfb-form.rtfb-form input[type="checkbox"]:focus-visible,
.rtfb-form.rtfb-form input[type="radio"]:focus-visible {
  box-shadow: 0 0 0 3px var(--rtfb-theme-focus);
  outline: none;
}

.rtfb-form.rtfb-form select {
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 2.5rem;
}

.rtfb-form.rtfb-form select[multiple] {
  background-image: none;
  min-height: 120px;
  padding-right: 0.9rem;
}

.rtfb-form.rtfb-form input[type="file"] {
  overflow: hidden;
  padding: 0.35rem;
}

.rtfb-form.rtfb-form input[type="file"]::file-selector-button {
  background: color-mix(in srgb, var(--rtfb-theme-primary) 10%, var(--rtfb-theme-field-bg));
  border: 0;
  border-radius: max(3px, calc(var(--rtfb-theme-radius) - 2px));
  color: var(--rtfb-theme-text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  margin: -0.08rem 0.7rem -0.08rem -0.08rem;
  min-height: 34px;
  padding: 0.45rem 0.75rem;
}

.rtfb-form.rtfb-form input[type="file"]::-webkit-file-upload-button {
  background: color-mix(in srgb, var(--rtfb-theme-primary) 10%, var(--rtfb-theme-field-bg));
  border: 0;
  border-radius: max(3px, calc(var(--rtfb-theme-radius) - 2px));
  color: var(--rtfb-theme-text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  margin: -0.08rem 0.7rem -0.08rem -0.08rem;
  min-height: 34px;
  padding: 0.45rem 0.75rem;
}

.rtfb-form.rtfb-form input[type="range"],
.rtfb-form.rtfb-form input.rtfb-range-control {
  --rtfb-range-track-bg-default: color-mix(in srgb, var(--rtfb-theme-border) 72%, var(--rtfb-theme-field-bg));
  -webkit-appearance: none !important;
  appearance: none !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--rtfb-theme-primary);
  cursor: pointer;
  display: block;
  height: 24px;
  margin: 0;
  min-height: 24px;
  padding: 0 !important;
  width: 100%;
}

.rtfb-form.rtfb-form input[type="range"]::-webkit-slider-runnable-track,
.rtfb-form.rtfb-form input.rtfb-range-control::-webkit-slider-runnable-track {
  background: var(--rtfb-range-track-bg, var(--rtfb-range-track-bg-default));
  border-color: var(--rtfb-range-track-border-color, transparent);
  border-radius: var(--rtfb-range-track-radius, 999px);
  border-style: var(--rtfb-range-track-border-style, solid);
  border-width: var(--rtfb-range-track-border-width, 0);
  box-sizing: border-box;
  height: 6px;
}

.rtfb-form.rtfb-form input[type="range"]::-webkit-slider-thumb,
.rtfb-form.rtfb-form input.rtfb-range-control::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: var(--rtfb-range-thumb-bg, var(--rtfb-theme-primary));
  border: 3px solid var(--rtfb-theme-field-bg);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--rtfb-range-thumb-bg, var(--rtfb-theme-primary));
  height: 20px;
  margin-top: -7px;
  width: 20px;
}

.rtfb-form.rtfb-form input[type="range"]::-moz-range-track,
.rtfb-form.rtfb-form input.rtfb-range-control::-moz-range-track {
  background: var(--rtfb-range-track-bg, var(--rtfb-range-track-bg-default));
  border-color: var(--rtfb-range-track-border-color, transparent);
  border-radius: var(--rtfb-range-track-radius, 999px);
  border-style: var(--rtfb-range-track-border-style, solid);
  border-width: var(--rtfb-range-track-border-width, 0);
  box-sizing: border-box;
  height: 6px;
}

.rtfb-form.rtfb-form input[type="range"]::-moz-range-progress,
.rtfb-form.rtfb-form input.rtfb-range-control::-moz-range-progress {
  background: var(--rtfb-range-thumb-bg, var(--rtfb-theme-primary));
  border-radius: var(--rtfb-range-track-radius, 999px);
  height: 6px;
}

.rtfb-form.rtfb-form input[type="range"]::-moz-range-thumb,
.rtfb-form.rtfb-form input.rtfb-range-control::-moz-range-thumb {
  background: var(--rtfb-range-thumb-bg, var(--rtfb-theme-primary));
  border: 3px solid var(--rtfb-theme-field-bg);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--rtfb-range-thumb-bg, var(--rtfb-theme-primary));
  height: 14px;
  width: 14px;
}

.rtfb-form.rtfb-form input[type="range"]:focus,
.rtfb-form.rtfb-form input[type="range"]:focus-visible,
.rtfb-form.rtfb-form input.rtfb-range-control:focus,
.rtfb-form.rtfb-form input.rtfb-range-control:focus-visible {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

.rtfb-form.rtfb-form input[type="range"]:focus-visible::-webkit-slider-thumb,
.rtfb-form.rtfb-form input.rtfb-range-control:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px var(--rtfb-range-thumb-bg, var(--rtfb-theme-primary)), 0 0 0 5px var(--rtfb-theme-focus);
}

.rtfb-form.rtfb-form input[type="range"]:focus-visible::-moz-range-thumb,
.rtfb-form.rtfb-form input.rtfb-range-control:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 1px var(--rtfb-range-thumb-bg, var(--rtfb-theme-primary)), 0 0 0 5px var(--rtfb-theme-focus);
}

.rtfb-form.rtfb-form .rtfb-color-field-alpha input[type="range"] {
  --rtfb-range-track-bg: color-mix(in srgb, var(--rtfb-theme-border) 72%, var(--rtfb-theme-field-bg));
  --rtfb-range-thumb-bg: var(--rtfb-theme-primary);
}

.rtfb-form.rtfb-form .rtfb-inline-button,
.rtfb-form.rtfb-form .rtfb-signature-clear {
  -webkit-appearance: none;
  appearance: none;
  background: var(--rtfb-theme-field-bg);
  border: 1px solid var(--rtfb-theme-border);
  border-radius: var(--rtfb-theme-radius);
  box-shadow: none;
  color: var(--rtfb-theme-text);
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  margin: 0;
  max-width: 100%;
}

.rtfb-form.rtfb-form .rtfb-inline-button {
  display: inline-flex;
  min-height: 44px;
  padding: 0.7rem 0.9rem;
}

.rtfb-form.rtfb-form .rtfb-signature-clear {
  align-self: flex-start;
  padding: 7px 12px;
}

.rtfb-form.rtfb-form .rtfb-image-choice {
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  max-width: 100%;
  min-width: 0;
  width: var(--rtfb-image-item-size, 160px);
}

.rtfb-form.rtfb-form .rtfb-image-choice input[type="radio"] {
  height: 1px;
  margin: -1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.rtfb-form.rtfb-form .rtfb-image-choice input[type="radio"]:focus-visible + .rtfb-image-choice-media {
  box-shadow: 0 0 0 3px var(--rtfb-theme-focus);
}

.rtfb-form.rtfb-form .rtfb-signature-pad canvas {
  background: var(--rtfb-theme-field-bg);
}

.rtfb-form.rtfb-form .rtfb-field.rtfb-has-error input[type="checkbox"],
.rtfb-form.rtfb-form .rtfb-field.rtfb-has-error input[type="radio"] {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.rtfb-form.rtfb-form .rtfb-field.rtfb-has-error input[type="range"] {
  box-shadow: none !important;
}

.rtfb-form.rtfb-form .rtfb-field.rtfb-has-error input[type="range"]::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px #dc2626, 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.rtfb-form.rtfb-form .rtfb-field.rtfb-has-error input[type="range"]::-moz-range-thumb {
  box-shadow: 0 0 0 1px #dc2626, 0 0 0 4px rgba(220, 38, 38, 0.12);
}

/* Theme-Regeln dürfen native Auswahl- und Bereichselemente nicht als Textfelder behandeln. */
.rtfb-theme-minimal .rtfb-field input[type="range"],
.rtfb-theme-minimal .rtfb-field input[type="checkbox"],
.rtfb-theme-minimal .rtfb-field input[type="radio"],
.rtfb-theme-contrast .rtfb-field input[type="range"],
.rtfb-theme-contrast .rtfb-field input[type="checkbox"],
.rtfb-theme-contrast .rtfb-field input[type="radio"],
.rtfb-theme-compact .rtfb-field input[type="range"],
.rtfb-theme-compact .rtfb-field input[type="checkbox"],
.rtfb-theme-compact .rtfb-field input[type="radio"] {
  min-height: initial;
  padding: 0 !important;
}

@media (max-width: 520px) {
  .rtfb-form.rtfb-form .rtfb-color-field-control {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .rtfb-form.rtfb-form .rtfb-color-field-alpha {
    grid-template-columns: minmax(0, 1fr) 48px;
  }
}

/* Zusätzliche Engstellen innerhalb schmaler Feldspalten. */
.rtfb-form.rtfb-form .rtfb-color-field-control {
  grid-template-columns: 48px minmax(0, 1fr);
  max-width: 100%;
  min-width: 0;
}

.rtfb-form.rtfb-form .rtfb-color-field-alpha {
  grid-template-columns: max-content minmax(0, 1fr) 52px;
  max-width: 100%;
  min-width: 0;
}

.rtfb-form.rtfb-form .rtfb-color-field-value,
.rtfb-form.rtfb-form .rtfb-calculation-wrap,
.rtfb-form.rtfb-form .rtfb-calculation-wrap input {
  min-width: 0;
}

.rtfb-form.rtfb-form .rtfb-calculation-wrap input {
  flex: 1 1 auto;
  width: auto;
}

.rtfb-form.rtfb-form .rtfb-captcha-wrap {
  max-width: 100%;
  overflow-x: auto;
}

@media (max-width: 520px) {
  .rtfb-form.rtfb-form .rtfb-color-field-alpha {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .rtfb-form.rtfb-form .rtfb-color-field-alpha > span {
    grid-column: 1 / -1;
  }
}

/* 0.25.0 – dezimalgenaue Kalkulation und Positionsaufstellung */
.rtfb-form .rtfb-calculation-breakdown {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 6px;
  background: rgba(0, 0, 0, .03);
  font-size: .9em;
}
.rtfb-form .rtfb-calculation-breakdown:empty { display: none; }
.rtfb-form .rtfb-calculation-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  align-items: baseline;
}
.rtfb-form .rtfb-calculation-line > span:first-child { min-width: 0; }
.rtfb-form .rtfb-calculation-line > strong { white-space: nowrap; }
.rtfb-form .rtfb-calculation-line > span:last-child {
  grid-column: 1 / -1;
  opacity: .72;
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .rtfb-form .rtfb-calculation-line { grid-template-columns: 1fr; }
  .rtfb-form .rtfb-calculation-line > strong { white-space: normal; }
}

/* 0.26.0 – individuell gestaltbarer Absenden-Button */
.rtfb-submit-field .rtfb-button-content {
  gap: var(--rtfb-button-icon-gap, 0.55em);
}

.rtfb-submit-field .rtfb-button-icon {
  color: var(--rtfb-button-icon-color, currentColor);
  height: var(--rtfb-button-icon-size, 1.15em);
  width: var(--rtfb-button-icon-size, 1.15em);
}

/* RT Core Components 1.0.0 frontend normalization */
.rtfb-form {
  --rtfb-theme-primary-dark: #00538f;
  --rtfb-theme-success: #009416;
  --rtfb-theme-warning: #eda509;
  --rtfb-theme-danger: #c22515;
}

.rtfb-form.rtfb-form input[type="checkbox"],
.rtfb-form.rtfb-form input[type="radio"] {
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  flex: 0 0 16px;
  padding: 0;
  box-shadow: none;
  accent-color: var(--rtfb-theme-primary);
}

.rtfb-form.rtfb-form button,
.rtfb-form.rtfb-form .rtfb-submit,
.rtfb-form.rtfb-form .rtfb-inline-button {
  min-height: 40px;
  border-radius: 6px;
  box-shadow: none;
  font-weight: 700;
}

.rtfb-form.rtfb-form .rtfb-submit:hover,
.rtfb-form.rtfb-form .rtfb-submit:focus {
  filter: none;
}

.rtfb-form {
  font-family: var(--rtfb-form-font-family, "Mulish", "Segoe UI", Arial, sans-serif);
}

.rtfb-form .rtfb-heading,
.rtfb-form .rtfb-heading-text h1,
.rtfb-form .rtfb-heading-text h2,
.rtfb-form .rtfb-heading-text h3,
.rtfb-form .rtfb-heading-text h4,
.rtfb-form .rtfb-heading-text h5,
.rtfb-form .rtfb-heading-text h6,
.rtfb-form .rtfb-section h3 {
  font-family: "Sora", "Segoe UI", Arial, sans-serif;
}
