/* FlyerFlieger – Styling für native Bricks-Formulare (.ff-form). Alle Tokens kommen aus der Bricks-Palette. */

/* Gutter per Padding statt column-gap: so passen zwei 50-%-Felder nebeneinander. */
.ff-form {
	display: flex;
	flex-wrap: wrap;
	row-gap: var(--space-m);
	column-gap: 0;
	margin-inline: calc(var(--space-m) / -2);
	scroll-margin-top: 5rem;
}

.ff-form > * {
	box-sizing: border-box;
	padding-inline: calc(var(--space-m) / 2);
}

/* Bricks setzt Breiten inline auf .form-group – mobil alles untereinander. */
@media (max-width: 767px) {
	.ff-form .form-group {
		width: 100% !important;
	}
}

/* Labels */
.ff-form label,
.ff-form .label {
	margin-bottom: var(--space-2xs);
	font-family: var(--ff-font-heading);
	font-weight: 600;
	font-size: var(--text-s);
	color: var(--ff-ink);
}

.ff-form .required::after {
	content: " *";
	color: var(--ff-blue);
}

/* Eingaben */
.ff-form input[type="text"],
.ff-form input[type="tel"],
.ff-form input[type="email"],
.ff-form input[type="url"],
.ff-form input[type="number"],
.ff-form input[type="search"],
.ff-form select,
.ff-form textarea {
	width: 100%;
	min-height: 48px;
	padding: var(--space-xs) var(--space-s);
	border: 1px solid var(--ff-line);
	border-radius: var(--ff-radius-m);
	background-color: var(--ff-white);
	color: var(--ff-ink);
	font: inherit;
}

.ff-form textarea {
	min-height: 9rem;
}

.ff-form input:focus-visible,
.ff-form select:focus-visible,
.ff-form textarea:focus-visible {
	outline: none;
	border-color: var(--ff-blue);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ff-blue) 25%, transparent);
}

/* Auswahl-Kacheln (Checkboxen & Radios) */
.ff-form .options-wrapper {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
	gap: var(--space-xs);
	padding: 0;
	margin: 0;
}

/* Echte Inputs für AT unsichtbar halten (nicht display:none). */
.ff-form .options-wrapper input[type="checkbox"],
.ff-form .options-wrapper input[type="radio"] {
	position: absolute;
	top: var(--space-s);
	left: var(--space-s);
	width: 1.25rem;
	height: 1.25rem;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.ff-form .options-wrapper label {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
	min-height: 48px;
	margin: 0;
	padding: var(--space-s);
	border: 1px solid var(--ff-line);
	border-radius: var(--ff-radius-m);
	font-family: var(--ff-font-body);
	font-weight: 400;
	cursor: pointer;
}

/* Eigene Box / Kreis statt Browser-Checkbox. */
.ff-form .options-wrapper label::before {
	content: "";
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid var(--ff-line);
	border-radius: var(--ff-radius-s);
	background-color: var(--ff-white);
}

.ff-form .options-wrapper li:has(> input[type="radio"]) label::before {
	border-radius: var(--ff-radius-pill);
}

.ff-form .options-wrapper input:checked + label {
	border-color: var(--ff-blue);
	background-color: var(--ff-blue-50);
}

.ff-form .options-wrapper input[type="checkbox"]:checked + label::before {
	content: "✓";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-color: var(--ff-blue);
	background-color: var(--ff-blue);
	color: var(--ff-white);
	font-size: var(--text-xs);
	line-height: 1;
}

.ff-form .options-wrapper input[type="radio"]:checked + label::before {
	border-color: var(--ff-blue);
	background: radial-gradient(circle, var(--ff-white) 0 30%, var(--ff-blue) 35% 100%);
}

.ff-form .options-wrapper input:focus-visible + label {
	outline: 3px solid var(--ff-cyan);
	outline-offset: 2px;
	border-color: var(--ff-blue);
}

/* Einzelne Checkbox (Einwilligung) bleibt schlicht – keine Kachel. */
.ff-form .options-wrapper li:only-child label {
	display: inline-flex;
	min-height: 0;
	padding: 0;
	border: 0;
	background: none;
}

.ff-form .options-wrapper li:only-child label::before {
	content: none;
}

.ff-form .options-wrapper li:only-child input {
	position: static;
	width: 1.15rem;
	height: 1.15rem;
	opacity: 1;
	pointer-events: auto;
	accent-color: var(--ff-blue);
}

.ff-form .options-wrapper li:only-child input:checked + label {
	border: 0;
	background: none;
}

/* Datei-Upload */
.ff-form .choose-files {
	display: flex;
	justify-content: center;
	padding: var(--space-s) var(--space-m);
	border: 2px dashed var(--ff-line);
	border-radius: var(--ff-radius-m);
	cursor: pointer;
}

.ff-form .choose-files:hover {
	border-color: var(--ff-blue);
}

/* Bricks blendet die Zeile erst mit .show ein (Vorlage pro gewählter Datei). */
.ff-form .file-result {
	display: none;
}

.ff-form .file-result.show {
	display: flex;
	align-items: center;
	gap: var(--space-2xs);
	margin-top: var(--space-2xs);
	font-size: var(--text-xs);
	color: var(--ff-muted);
}

/* CTA-Buttons: Absenden + Weiter im Gelb der Website. */
.ff-form .submit-button-wrapper .bricks-button,
.ff-steps-next {
	min-height: 48px;
	padding: var(--space-s) var(--space-xl);
	border: 0;
	border-radius: var(--ff-radius-pill);
	background-color: var(--ff-glow);
	color: var(--ff-night);
	font-family: var(--ff-font-heading);
	font-weight: 700;
	cursor: pointer;
}

.ff-form .submit-button-wrapper .bricks-button:hover,
.ff-steps-next:hover {
	background-color: var(--ff-glow-600);
	box-shadow: var(--ff-glow-yellow);
}

.ff-steps-back {
	padding: 0;
	border: 0;
	background: none;
	color: var(--ff-muted);
	font: inherit;
	cursor: pointer;
}

.ff-steps-back:hover {
	color: var(--ff-ink);
	text-decoration: underline;
}

.ff-steps-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	margin-top: var(--space-s);
}

/* Fortschrittsanzeige über dem Formular. */
.ff-steps-progress {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-xs);
	width: 100%;
	padding: 0;
	margin: 0 0 var(--space-l);
}

.ff-steps-progress li {
	display: flex;
	align-items: center;
	gap: var(--space-2xs);
}

.ff-steps-progress li.is-done {
	cursor: pointer;
}

.ff-steps-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 2rem;
	height: 2rem;
	border: 1px solid var(--ff-line);
	border-radius: var(--ff-radius-pill);
	background-color: transparent;
	color: var(--ff-muted);
	font-family: var(--ff-font-heading);
	font-weight: 600;
	font-size: var(--text-xs);
}

.ff-steps-progress li[aria-current="step"] .ff-steps-num {
	border-color: var(--ff-blue);
	background-color: var(--ff-blue);
	color: var(--ff-white);
}

.ff-steps-progress li.is-done .ff-steps-num {
	border-color: transparent;
	background-color: var(--ff-blue-100);
	color: transparent;
	font-size: 0;
}

.ff-steps-progress li.is-done .ff-steps-num::before {
	content: "✓";
	font-size: var(--text-xs);
	color: var(--ff-blue-700);
}

.ff-steps-label {
	font-size: var(--text-xs);
	color: var(--ff-muted);
}

.ff-steps-progress li[aria-current="step"] .ff-steps-label {
	color: var(--ff-ink);
	font-weight: 600;
}

/* Schritt-Überschrift & Sichtbarkeit. */
.ff-step-title {
	width: 100%;
	margin: 0;
	font-family: var(--ff-font-heading);
	font-weight: 700;
	font-size: var(--text-xl);
	color: var(--ff-ink);
}

.ff-step-hidden {
	display: none !important;
}

/* Fehler */
.ff-field-error input,
.ff-field-error textarea,
.ff-field-error select,
.ff-field-error .options-wrapper label {
	border-color: var(--ff-error);
}

.ff-field-error-text {
	margin: var(--space-2xs) 0 0;
	font-size: var(--text-xs);
	color: var(--ff-error);
}

/* Bricks-Ergebnis (AJAX). */
.ff-form .message {
	width: 100%;
	padding: var(--space-m);
	border-radius: var(--ff-radius-m);
}

.ff-form .message.success {
	background-color: color-mix(in srgb, var(--ff-success) 12%, transparent);
	border-left: 4px solid var(--ff-success);
}

.ff-form .message.danger {
	background-color: color-mix(in srgb, var(--ff-error) 12%, transparent);
	border-left: 4px solid var(--ff-error);
}

/* Hinweis unter dem Formular. */
.ff-form-hint {
	width: 100%;
	font-size: var(--text-xs);
	color: var(--ff-muted);
}

.ff-form-hint a {
	color: var(--ff-blue);
	text-decoration: underline;
}

/* Sehr kleine Viewports: nur die aktive Schrittbezeichnung zeigen. */
@media (max-width: 478px) {
	.ff-steps-label {
		display: none;
	}

	.ff-steps-progress li[aria-current="step"] .ff-steps-label {
		display: inline;
	}
}

/* Kacheln füllen ihre Grid-Zelle; Einzel-Checkbox (Einwilligung) nutzt die volle Breite. */
/* position: relative hält das versteckte Input in der Kachel – sonst springt der Fokus nach oben. */
.ff-form .options-wrapper li {
	position: relative;
	display: flex;
	align-items: stretch;
	margin: 0;
}

.ff-form .options-wrapper li > label {
	flex: 1 1 auto;
}

.ff-form .options-wrapper:has(> li:only-child) {
	display: block;
}

.ff-form .options-wrapper li:only-child {
	align-items: flex-start;
	gap: var(--space-xs);
}

.ff-form .file-result svg {
	width: 1em;
	height: 1em;
	flex: none;
}
