/* FFW Beitrittserklärung – öffentliches Formular im dunklen Gesamtdesign:
 * Text außerhalb der Karten hell, Karten und Felder weiß (ARCHITEKTUR §10).
 *
 * Skalierung: Alle Maße sind in em und hängen an der Grundschrift von .ffwbe. Diese wächst mit der
 * Bildschirmbreite (mindestens 16 px, höchstens 30 px). So wachsen Schrift, Felder, Abstände und
 * Kartenbreite gemeinsam mit dem Gerät – vom Handy bis zum großen Monitor. */
.ffwbe {
	--fb-card: #ffffff;
	--fb-ink: #1d1d1f;
	--fb-body: #3a3a3c;
	--fb-muted: #5f5f64;
	--fb-line: rgba(0, 0, 0, .08);
	--fb-feldrand: #8f877f;
	--fb-tint: #f5f3f0;
	--fb-red: var(--ffp-red, #b91c1c);
	--fb-red-d: var(--ffp-red-dark, #991b1b);
	--fb-red-soft: rgba(185, 28, 28, .08);
	--fb-r: .75em;
	--fb-r-lg: 1.375em;
	--fb-shadow: 0 1px 1px rgba(0, 0, 0, .06), 0 .75em 2em rgba(0, 0, 0, .28);
	background: transparent;
	color: #d9d4c7;
	font-family: var(--ffp-font, -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif);
	font-size: clamp(16px, .7vw + 6px, 30px);
	line-height: 1.5;
	padding: 0 0 2em;
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
	counter-reset: ffwbe-schritt;
}
.ffwbe *, .ffwbe *::before, .ffwbe *::after { box-sizing: border-box; }
.ffwbe [hidden] { display: none !important; }
.ffwbe-wrap { max-width: 47.5em; margin: 0; }

/* Einleitung (auf dunklem Grund) */
.ffwbe-intro { margin: 0 0 1.25em; max-width: 47.5em; }
.ffwbe .ffwbe-intro__titel { margin: 0 0 .3em; color: #fff; font-size: 1.75em; line-height: 1.2; font-weight: 700; }
.ffwbe-lead { margin: 0 0 .5em; color: #d9d4c7; font-size: 1em; line-height: 1.55; }
.ffwbe-intro .ffwbe-req { color: #fca5a5; }

/* Karten und Abschnittstitel (Titel innerhalb der Karte, nummeriert) */
.ffwbe-card {
	background: var(--fb-card);
	color: var(--fb-body);
	border: 1px solid var(--fb-line);
	border-radius: var(--fb-r-lg);
	box-shadow: var(--fb-shadow);
	padding: 1.25em;
	margin: 0 0 1.125em;
	min-width: 0;
}
.ffwbe-sektion:not(.ffwbe-sektion--text) { counter-increment: ffwbe-schritt; }
.ffwbe .ffwbe-titel {
	float: left; /* Legende in die Karte holen statt auf den Rahmen */
	width: 100%;
	display: flex;
	align-items: center;
	gap: .55em;
	margin: 0 0 .85em;
	padding: 0;
	color: var(--fb-ink);
	font-size: 1.2em;
	line-height: 1.3;
	font-weight: 700;
	overflow-wrap: anywhere;
}
.ffwbe .ffwbe-sektion:not(.ffwbe-sektion--text) .ffwbe-titel::before {
	content: counter(ffwbe-schritt);
	flex: 0 0 1.6em;
	height: 1.6em;
	border-radius: 50%;
	background: var(--fb-red);
	color: #fff;
	font-size: .8em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.ffwbe-raster { container-type: inline-size; clear: both; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1em .9em; }
.ffwbe-raster > * { grid-column: 1 / -1; margin: 0; }
.ffwbe-raster > .ffwbe-b2 { grid-column: span 2; }
.ffwbe-raster > .ffwbe-b3 { grid-column: span 3; }
.ffwbe-raster > .ffwbe-b4 { grid-column: span 4; }
/* Felder nebeneinander nur, wenn die Karte breit genug ist (egal ob ein- oder zweispaltig) */
@media (max-width: 560px) {
	.ffwbe-card { padding: 1em; }
	.ffwbe-raster > .ffwbe-b3 { grid-column: 1 / -1; }
}
@container (max-width: 25em) {
	.ffwbe-raster > .ffwbe-b3 { grid-column: 1 / -1; }
}
@container (max-width: 18em) {
	.ffwbe-raster > .ffwbe-b2, .ffwbe-raster > .ffwbe-b4 { grid-column: 1 / -1; }
}

/* Dynamische Skalierung: ab 1000 px Bildschirmbreite zwei Spalten. Die Breite wächst mit der Schrift
 * (96 em ≙ 1536 px bei 16 px, ≙ 1920 px bei 20 px), so nutzt das Formular große Bildschirme voll aus. */
.ffwbe-spalten { display: block; }
.ffwbe-abschluss { max-width: 47.5em; }
/* Reine Textabschnitte (Stimmrecht, Hinweise): ohne Nummer, mit rotem Rand links */
.ffwbe-sektion--text { border-left: .35em solid var(--fb-red); }
@media (min-width: 1000px) {
	.ffwbe-wrap { max-width: 96em; }
	.ffwbe-intro { max-width: 60em; }
	/* Festes Raster statt Textspalten: zwei gleich hohe Karten nebeneinander, Textabschnitte darunter über die ganze Breite */
	.ffwbe-spalten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5em; align-items: stretch; }
	.ffwbe-spalten > .ffwbe-card { margin: 0; }
	/* Karten füllen die Zeilenhöhe; die Unterschrift sitzt unten, damit beide Unterschriftsfelder auf gleicher Höhe liegen */
	.ffwbe-spalten > .ffwbe-sektion:not(.ffwbe-sektion--text) { display: flex; flex-direction: column; }
	.ffwbe-spalten > .ffwbe-sektion:not(.ffwbe-sektion--text) > .ffwbe-raster { flex: 1 1 auto; }
	.ffwbe-raster > .ffwbe-unterschrift { align-self: end; }
	.ffwbe-spalten > .ffwbe-sektion--voll, .ffwbe-spalten > .ffwbe-sektion--text { grid-column: 1 / -1; }
	.ffwbe-spalten > .ffwbe-sektion--text { order: 2; }
	.ffwbe-abschluss { max-width: 32em; margin-left: auto; margin-right: auto; }
}

/* Felder */
.ffwbe-feld { min-width: 0; border-radius: var(--fb-r); }
.ffwbe .ffwbe-label { display: block; margin: 0 0 .4em; color: var(--fb-ink); font-size: .9375em; font-weight: 600; line-height: 1.35; text-transform: none; letter-spacing: 0; }
.ffwbe-req { color: var(--fb-red); font-weight: 700; }
.ffwbe .ffwbe-input {
	display: block;
	width: 100%;
	min-height: 3em;
	margin: 0;
	padding: .6em .75em;
	font: inherit;
	font-size: 1em;
	color: var(--fb-ink);
	background: #fff;
	border: 1px solid var(--fb-feldrand);
	border-radius: var(--fb-r);
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}
.ffwbe select.ffwbe-input { background-image: linear-gradient(45deg, transparent 50%, var(--fb-muted) 50%), linear-gradient(135deg, var(--fb-muted) 50%, transparent 50%); background-position: calc(100% - 1.1em) 55%, calc(100% - .8em) 55%; background-size: .35em .35em, .35em .35em; background-repeat: no-repeat; padding-right: 2.2em; }
.ffwbe textarea.ffwbe-input { min-height: 5.25em; resize: vertical; }
.ffwbe input[type="date"].ffwbe-input { min-width: 0; max-width: 100%; }
.ffwbe .ffwbe-input:focus { outline: 3px solid rgba(185, 28, 28, .25); outline-offset: 0; border-color: var(--fb-red); }
.ffwbe .ffwbe-input::placeholder { color: #8a857f; }
.ffwbe-hint { margin: .4em 0 0; color: var(--fb-muted); font-size: .875em; line-height: 1.4; }
.ffwbe-raster > .ffwbe-gruppenhinweis { margin: 0 0 -.5em; }
.ffwbe-hinweis { color: var(--fb-body); font-size: .9375em; line-height: 1.55; }

/* Auswahl aktiv / fördernd als große Tippflächen */
.ffwbe-wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(13.5em, 1fr)); gap: .65em; }
.ffwbe .ffwbe-wahl__option {
	display: flex; gap: .75em; align-items: flex-start;
	margin: 0; padding: .9em; min-height: 2.75em;
	border: 1px solid var(--fb-feldrand); border-radius: var(--fb-r);
	background: #fff; color: var(--fb-body); cursor: pointer;
	font-size: .9375em; font-weight: 400;
}
.ffwbe-wahl__option:has(input:checked) { border-color: var(--fb-red); box-shadow: inset 0 0 0 1px var(--fb-red); background: var(--fb-red-soft); }
.ffwbe-wahl__option input { flex: 0 0 1.4em; width: 1.4em; height: 1.4em; margin: .05em 0 0; accent-color: var(--fb-red); }
.ffwbe-wahl__text { display: flex; flex-direction: column; gap: .15em; }
.ffwbe-wahl__name { color: var(--fb-ink); font-weight: 600; font-size: 1.0667em; }
.ffwbe-wahl__info { color: var(--fb-muted); font-size: .9333em; line-height: 1.4; }

.ffwbe .ffwbe-check { display: flex; gap: .75em; align-items: flex-start; margin: 0; cursor: pointer; color: var(--fb-body); font-size: .9375em; font-weight: 400; }
.ffwbe-check input { flex: 0 0 1.45em; width: 1.45em; height: 1.45em; margin: .05em 0 0; accent-color: var(--fb-red); }

/* Kontoinhaber wie oben */
.ffwbe-uebernahme { padding: .9em; background: var(--fb-tint); }
.ffwbe-uebernahme__info { margin: .5em 0 0 2.2em; color: var(--fb-ink); font-size: .9375em; }

/* Bank, Ort, Straße: Rückmeldungen */
.ffwbe-bankinfo { margin: .4em 0 0; font-size: .875em; color: var(--fb-muted); }
.ffwbe-bankinfo:empty { display: none; }
.ffwbe-bankinfo.ok { color: #1d6b32; font-weight: 600; }
.ffwbe-bankinfo.warn { color: var(--fb-red-d); }
.ffwbe-ortauswahl { margin-bottom: .4em; }

/* Unterschrift */
.ffwbe-sigflaeche { position: relative; }
.ffwbe-canvas {
	display: block; width: 100%; height: 10.5em;
	background: #fff linear-gradient(#cfc8c1, #cfc8c1) no-repeat 1em calc(100% - 2.25em) / calc(100% - 2em) 1px;
	border: 1px dashed var(--fb-feldrand); border-radius: var(--fb-r);
	cursor: crosshair; touch-action: none;
}
.ffwbe-sighinweis { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; color: #8a857f; font-size: .9375em; pointer-events: none; }
.ffwbe-sigfeld.hat-strich .ffwbe-sighinweis { display: none; }
.ffwbe-sigfuss { display: flex; justify-content: space-between; align-items: center; gap: .75em; margin-top: .4em; color: var(--fb-muted); font-size: .875em; }
.ffwbe button.ffwbe-link {
	min-height: 2.75em; padding: 0 .3em; margin: 0;
	background: none; border: 0; border-radius: .4em; box-shadow: none;
	color: var(--fb-red-d); font: inherit; font-size: 1.07em; font-weight: 600; text-decoration: underline; cursor: pointer;
}
.ffwbe button.ffwbe-link:hover { background: none; color: var(--fb-red); }

/* Fehler */
.ffwbe-feld.bad, .ffwbe-sigfeld.bad { outline: 2px solid var(--fb-red); outline-offset: 4px; }
.ffwbe-feldfehler { margin: .4em 0 0; color: var(--fb-red-d); font-size: .875em; font-weight: 600; }
.ffwbe-flash {
	margin: 0 0 .9em; padding: .75em .9em;
	background: #fff4f3; color: var(--fb-red-d);
	border: 1px solid #f0c4c0; border-radius: var(--fb-r); font-weight: 600;
}

/* Absenden */
.ffwbe-abschluss { margin-top: 1.5em; } /* nur oben, damit margin-left/right: auto im Desktop-Block gilt */
.ffwbe .ffwbe-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 100%; min-height: 3.25em; padding: .75em 1.5em;
	border: 0; border-radius: 980px;
	background: var(--fb-red); color: #fff;
	font: inherit; font-size: 1.0625em; font-weight: 700; text-decoration: none; cursor: pointer;
}
.ffwbe .ffwbe-btn:hover { background: var(--fb-red-d); color: #fff; }
.ffwbe .ffwbe-btn:disabled { opacity: .7; cursor: wait; }
.ffwbe-ds { margin: .8em 0 0; color: #d9d4c7; font-size: .875em; text-align: center; }
/* Spezifischer als die Theme-Regel .ffp-content a:not(.ffp-card):not(.ffp-btn):not(.wp-block-button__link) */
.ffwbe .ffwbe-abschluss .ffwbe-ds a:not(.ffp-card):not(.ffp-btn):not(.wp-block-button__link) { color: #fff; text-decoration: underline; }
.ffwbe .ffwbe-abschluss .ffwbe-ds a:not(.ffp-card):not(.ffp-btn):not(.wp-block-button__link):hover { color: #fca5a5; }

/* Bestätigung */
.ffwbe-done { border-left: .4em solid #1d6b32; }
.ffwbe-done__titel { margin: 0; color: #1d6b32; font-size: 1.25em; font-weight: 700; }
.ffwbe-danke { white-space: pre-line; margin: .5em 0 0; color: var(--fb-body); }
.ffwbe-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Sehr schmale Telefone (≤ 360 px): Auswahl und Knöpfe ohne seitlichen Überlauf */
@media (max-width: 360px) {
	.ffwbe-wahl { grid-template-columns: 1fr; }
	.ffwbe .ffwbe-wahl__option { padding: .75em; }
	.ffwbe-sigfuss { flex-wrap: wrap; }
}

/* Druck: Beschriftung und Feld (bzw. Unterschriftsfeld) nicht über Seitenumbrüche trennen */
@media print {
	.ffwbe-feld, .ffwbe-sigfeld { break-inside: avoid; page-break-inside: avoid; }
}

/* Apple HIG: sichtbarer Fokus und „Bewegung reduzieren“ */
.ffwbe a:focus-visible, .ffwbe button:focus-visible, .ffwbe input:focus-visible, .ffwbe [tabindex]:focus-visible { outline: 3px solid var(--fb-red); outline-offset: 2px; }
.ffwbe-intro a:focus-visible, .ffwbe-ds a:focus-visible { outline-color: #fff; }
@media (prefers-reduced-motion: reduce) {
	.ffwbe *, .ffwbe *::before, .ffwbe *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
