@charset "UTF-8";

/**
 * FunnelForms Barrierefrei - Darstellungskorrekturen
 *
 * Alles ist unter .ffx-form gescopt und greift ausschließlich in
 * Funnelforms-Pro-Formulare. Funnelforms selbst wird nicht verändert.
 *
 * Strategie
 * ---------
 * Funnelforms setzt seine Farben über CSS-Custom-Properties am Formular
 * (--ffx-color-primary usw.), teils als Inline-Style. Deshalb werden in
 * erster Linie diese Variablen überschrieben: ein Eingriff, der Buttons,
 * Überschriften, Markierungen und Fortschrittsbalken gemeinsam abdeckt.
 *
 * !important steht nur an den Variablen-Deklarationen - das ist gegen den
 * Inline-Style zwingend und berührt keine Farbangabe an einem Element.
 * Die Element-Regeln darunter sind Absicherung für den Fall, dass eine
 * Funnelforms-Version eine Farbe hart setzt; sie laufen bewusst OHNE
 * !important, damit die Kontrastmodi von OneTap sie weiter überschreiben
 * können. Ausnahme ist der Fokusrahmen: ein unsichtbarer Fokus ist das
 * schwerere Problem.
 *
 * Kontrastwerte (WCAG 2.1)
 * ------------------------
 * #4A7A16 auf Weiß          5,14:1  (AA Text, erfüllt 1.4.3)
 * Weiß auf #4A7A16          5,14:1  (Button-Beschriftung)
 * #3E6512 auf Weiß          6,83:1  (Hover/Active)
 * #4A7A16 gegen #e1e1e1      3,94:1  (Fortschrittsbalken, erfüllt 1.4.11)
 * Markenfarbe #77B729 lag bei 2,44:1 und war damit zu schwach.
 */

/* ------------------------------------------------------------------
   Variablenblock - hier zentral alle Farben pflegen
   ------------------------------------------------------------------ */

.ffx-form {
	/* Eigene Werte */
	--ffbf-primary: #4a7a16;
	--ffbf-primary-hover: #3e6512;
	--ffbf-focus: #4a7a16;
	--ffbf-focus-contrast: #ffffff;
	--ffbf-focus-width: 3px;
	--ffbf-focus-offset: 2px;
	--ffbf-text: #1d1b26;

	/* Funnelforms-Variablen umbiegen */
	--ffx-color-primary: var( --ffbf-primary ) !important;
	--ffx-color-heading: var( --ffbf-primary ) !important;
	--ffx-tint: color-mix( in srgb, var( --ffbf-primary ) 12%, transparent ) !important;
}

/* ------------------------------------------------------------------
   1. Textfarben (WCAG 1.4.3)
   ------------------------------------------------------------------ */

.ffx-form .ffx-question,
.ffx-form .ffx-contact-title {
	color: var( --ffbf-primary );
}

/* Zurück-Button: lag bei 3,55:1 */
.ffx-form .ffx-button-back {
	color: var( --ffbf-primary );
}

.ffx-form .ffx-button-back:hover,
.ffx-form .ffx-button-back:active {
	color: var( --ffbf-primary-hover );
}

/* ------------------------------------------------------------------
   2. Flächen und Zustände
   ------------------------------------------------------------------ */

.ffx-form .ffx-button-primary,
.ffx-form .ffx-button-next {
	background-color: var( --ffbf-primary );
	border-color: var( --ffbf-primary );
	color: #ffffff;
}

.ffx-form .ffx-button-primary:hover,
.ffx-form .ffx-button-primary:active,
.ffx-form .ffx-button-next:hover,
.ffx-form .ffx-button-next:active {
	background-color: var( --ffbf-primary-hover );
	border-color: var( --ffbf-primary-hover );
}

/* Gewählte Antwort: Markierung mind. 3:1 gegen den Hintergrund (1.4.11).
   Die blasse Tint-Fläche allein reicht dafür nicht aus. */
.ffx-form .ffx-option[aria-pressed="true"] {
	border-color: var( --ffbf-primary );
	border-width: 2px;
	box-shadow: inset 0 0 0 1px var( --ffbf-primary );
}

/* Fortschrittsbalken: Füllung gegen Track */
.ffx-form .ffx-progress-bar,
.ffx-form .ffx-progress > span,
.ffx-form .ffx-progress-step.is-active {
	background-color: var( --ffbf-primary );
}

/* ------------------------------------------------------------------
   3. Tastaturfokus (WCAG 2.4.7 / 1.4.11)
   ------------------------------------------------------------------
   Zweifarbiger Ring: der weiße Innenring sitzt im Abstand zwischen
   Element und Outline, damit der Fokus auch auf grüner Fläche sichtbar
   bleibt. outline-offset hält ihn außerdem von der Elementfarbe frei.
   ------------------------------------------------------------------ */

.ffx-form .ffx-option:focus-visible,
.ffx-form .ffx-button:focus-visible,
.ffx-form .ffx-button-primary:focus-visible,
.ffx-form .ffx-button-next:focus-visible,
.ffx-form .ffx-button-back:focus-visible,
.ffx-form .ffx-input:focus-visible,
.ffx-form input:focus-visible,
.ffx-form select:focus-visible,
.ffx-form textarea:focus-visible,
.ffx-form .ffx-dropzone:focus-visible,
.ffx-form .ffx-file-input:focus-visible,
.ffx-form .ffx-checkbox input:focus-visible,
.ffx-form a:focus-visible {
	outline: var( --ffbf-focus-width ) solid var( --ffbf-focus ) !important;
	outline-offset: var( --ffbf-focus-offset ) !important;
	box-shadow: 0 0 0 var( --ffbf-focus-offset ) var( --ffbf-focus-contrast );
}

/* Checkbox und Radio sind häufig visuell ersetzt - Fokus auf das
   sichtbare Ersatzelement spiegeln. */
.ffx-form input[type="checkbox"]:focus-visible + label,
.ffx-form input[type="checkbox"]:focus-visible + span,
.ffx-form input[type="radio"]:focus-visible + label,
.ffx-form input[type="radio"]:focus-visible + span {
	outline: var( --ffbf-focus-width ) solid var( --ffbf-focus );
	outline-offset: var( --ffbf-focus-offset );
}

/* Dateiauswahl: der Button im Inneren des Inputs bekommt keinen eigenen
   Fokus, deshalb den Container markieren. */
.ffx-form .ffx-dropzone:focus-within {
	outline: var( --ffbf-focus-width ) solid var( --ffbf-focus );
	outline-offset: var( --ffbf-focus-offset );
}

/* ------------------------------------------------------------------
   4. Nachgetragene Beschriftungen (WCAG 3.3.2 / 2.5.3)
   ------------------------------------------------------------------
   a11y.js setzt die Labels; die Optik folgt den bereits vorhandenen
   .ffx-label-Feldern. Nur die vom Plugin erzeugten Labels werden
   angefasst, erkennbar am Marker-Attribut.
   ------------------------------------------------------------------ */

.ffx-form .ffx-label[data-ffbf-label] {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	line-height: 1.35;
	color: var( --ffbf-text );
	color: var( --ffx-color-text, var( --ffbf-text ) );
}

.ffx-form .ffx-label[data-ffbf-label] .ffx-required {
	color: var( --ffx-color-error, #b42318 );
}

/* ------------------------------------------------------------------
   5. Hoher Kontrastmodus des Betriebssystems
   ------------------------------------------------------------------ */

@media ( forced-colors: active ) {
	.ffx-form .ffx-option:focus-visible,
	.ffx-form .ffx-button:focus-visible,
	.ffx-form .ffx-input:focus-visible,
	.ffx-form input:focus-visible,
	.ffx-form select:focus-visible,
	.ffx-form textarea:focus-visible {
		outline: 3px solid Highlight !important;
	}

	.ffx-form .ffx-option[aria-pressed="true"] {
		border-color: Highlight;
	}
}
