/**
 * MediaFitPass - Formulare "Vertrag widerrufen" und "Vertraege hier kuendigen"
 *
 * Online-Widerruf (§ 356a BGB) und Kuendigungsschaltflaeche (§ 312k BGB).
 * Markup aus inc/vertrag-formulare.php, functions.php laedt diese Datei nur
 * auf den Seiten vertrag-widerrufen und kuendigen. Seit 29.09.2026 auch auf
 * der Kontaktseite (inc/kontakt-formular.php, Abschnitt am Ende).
 *
 * Gestaltung wie die Anmeldekarte auf "Meine Kurse" (learndash.css,
 * .has-login-form): weisse Karte, Beschriftung ueber dem Feld, Felder 50px
 * hoch mit gruenem Fokusring, Knopf als Pille ueber die ganze Breite. Die
 * Anzeige nach dem Absenden ist eine Karte mit gruenem Rand links.
 */

/* ── Rahmen und Karte ── */

.mfp-formular {
	max-width: 560px;
	margin: 0 auto;
	color: var(--wp--preset--color--dark);
}

/* Das Layout der Gruppe (contentSize 900px) gibt jedem Kind eine eigene
   Hoechstbreite, die Karte bleibt trotzdem schmal */
.mfp-vertragsformular .mfp-formular {
	max-width: 560px;
}

.mfp-formular__karte,
.mfp-formular__bestaetigung {
	padding: clamp(1.75rem, 5vw, 2.5rem);
	background: #ffffff;
	border: 1px solid #DCE5DF;
	border-radius: 24px;
	box-shadow: 0 2px 4px rgba(26, 26, 46, 0.04), 0 28px 60px -36px rgba(26, 26, 46, 0.35);
}

.mfp-formular__einleitung {
	margin: 0 0 1.75rem;
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--wp--preset--color--text-gray);
}

/* ── Felder ── */

.mfp-formular__feld {
	margin: 0 0 1.25rem;
}

.mfp-formular__label {
	display: block;
	margin: 0 0 0.4rem;
	padding: 0;
	font-family: var(--wp--preset--font-family--poppins), sans-serif;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--wp--preset--color--dark);
}

.mfp-formular__pflicht {
	font-weight: 400;
	color: var(--wp--preset--color--text-gray);
}

.mfp-formular__eingabe {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 50px;
	margin: 0;
	padding: 0 1rem;
	border: 1.5px solid #D5DDD8;
	border-radius: 12px;
	background: #ffffff;
	font-family: var(--wp--preset--font-family--poppins), sans-serif;
	font-size: 1rem;
	line-height: 1.4;
	color: var(--wp--preset--color--dark);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.mfp-formular__eingabe {
	height: auto;
	min-height: 120px;
	padding: 0.75rem 1rem;
	line-height: 1.5;
	resize: vertical;
}

/* Die transparente Kontur wird im Kontrastmodus von Windows sichtbar, dort
   fehlt der Schatten */
.mfp-formular__eingabe:focus {
	outline: 2px solid transparent;
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 4px rgba(37, 128, 87, 0.15);
}

/* ── Gruppen, Auswahl ── */

.mfp-formular fieldset {
	min-width: 0;
	margin: 0 0 1.25rem;
	padding: 0;
	border: 0;
}

/* Legenden schwimmen, damit Abstaende in allen Browsern gleich wirken */
.mfp-formular legend {
	float: left;
	width: 100%;
	padding: 0;
}

.mfp-formular legend + * {
	clear: both;
}

/* "Welchen Kauf moechten Sie widerrufen?": Bestellnummer und Kurs als Block */
.mfp-formular .mfp-formular__gruppe {
	padding: 1.1rem 1.1rem 0.1rem;
	border: 1px solid #E3EAE5;
	border-radius: 16px;
	background: #F7FAF8;
}

.mfp-formular__legende {
	margin: 0 0 0.9rem;
	font-family: var(--wp--preset--font-family--poppins), sans-serif;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--wp--preset--color--dark);
}

.mfp-formular__hinweis {
	margin: 0 0 0.7rem;
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--wp--preset--color--text-gray);
}

/* Radio-Buttons und Kaestchen untereinander, Text neben dem Knopf */
.mfp-formular__option {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	margin: 0 0 0.6rem;
	font-family: var(--wp--preset--font-family--poppins), sans-serif;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.45;
	color: var(--wp--preset--color--dark);
	cursor: pointer;
}

.mfp-formular__option span {
	min-width: 0;
	overflow-wrap: break-word;
}

.mfp-formular__option input[type="radio"],
.mfp-formular__option input[type="checkbox"] {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0.1rem 0 0;
	accent-color: var(--wp--preset--color--primary);
	cursor: pointer;
}

.mfp-formular__option input[type="radio"]:focus-visible,
.mfp-formular__option input[type="checkbox"]:focus-visible {
	outline: 3px solid #1A1A2E;
	outline-offset: 2px;
}

/* "zum [Datum]": Radio-Button, "zum" und Datumsfeld in einer Zeile */
.mfp-formular__option--datum {
	flex-wrap: wrap;
	align-items: center;
	cursor: default;
}

.mfp-formular__option--datum label {
	cursor: pointer;
}

.mfp-formular__option--datum input[type="radio"] {
	margin-top: 0;
}

.mfp-formular .mfp-formular__datum {
	flex: 1 1 11rem;
	width: auto;
	max-width: 14rem;
	min-width: 0;
	text-align: left;
}

.mfp-formular__datum::-webkit-date-and-time-value {
	text-align: left;
}

/* Nur fuer Screenreader */
.mfp-formular__unsichtbar {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ── Erklaerung und Knopf ── */

.mfp-formular__erklaerung {
	margin: 1.5rem 0 1rem;
	padding: 0.9rem 1.1rem;
	border-radius: 12px;
	background: #F4F8F6;
	font-size: 0.98rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--wp--preset--color--dark);
}

.mfp-formular__knopf {
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 0.8rem 1.5rem;
	border: 0;
	border-radius: 9999px;
	background: var(--wp--preset--color--primary);
	color: #ffffff;
	font-family: var(--wp--preset--font-family--poppins), sans-serif;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.mfp-formular__knopf:hover,
.mfp-formular__knopf:focus-visible {
	background: var(--wp--preset--color--accent);
}

.mfp-formular__knopf:focus-visible {
	outline: 3px solid #1A1A2E;
	outline-offset: 3px;
}

/* Die Kuendigung hat keinen Erklaerungstext ueber dem Knopf */
.mfp-formular--kuendigung .mfp-formular__knopf {
	margin-top: 1.75rem;
}

/* ── Fehler ── */

.mfp-formular__fehlerliste {
	margin: 0 0 1.5rem;
	padding: 1rem 1.15rem;
	border: 1px solid #F3C4BF;
	border-left: 4px solid #B42318;
	border-radius: 12px;
	background: #FEF3F2;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--wp--preset--color--dark);
}

.mfp-formular__fehlertitel {
	margin: 0 0 0.35rem;
	font-weight: 700;
	color: #B42318;
}

.mfp-formular__fehlerliste ul {
	margin: 0;
	padding-left: 1.2rem;
}

.mfp-formular__fehlerliste li + li {
	margin-top: 0.25rem;
}

.mfp-formular__fehlerliste a {
	font-weight: 600;
	color: #B42318;
	text-decoration: underline;
}

.mfp-formular__fehlerliste a:hover,
.mfp-formular__fehlerliste a:focus-visible {
	color: var(--wp--preset--color--accent);
}

.mfp-formular__fehler {
	margin: 0.4rem 0 0;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.4;
	color: #B42318;
}

.mfp-formular__eingabe[aria-invalid="true"] {
	border-color: #B42318;
}

.mfp-formular__eingabe[aria-invalid="true"]:focus {
	box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.15);
}

/* Aufruf der Bestaetigung nach mehr als 30 Minuten */
.mfp-formular__abgelaufen {
	margin: 0 0 1.25rem;
	padding: 0.9rem 1.1rem;
	border: 1px solid #DCE5DF;
	border-radius: 12px;
	background: #F4F8F6;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--wp--preset--color--dark);
}

/* ── Anzeige nach dem Absenden ── */

.mfp-formular .mfp-formular__bestaetigung {
	border-left: 6px solid var(--wp--preset--color--primary);
}

.mfp-formular__bestaetigung p {
	margin: 0 0 1.1rem;
	font-size: 1rem;
	line-height: 1.6;
}

/* Erster Satz fett: Datum und Uhrzeit des Eingangs */
.mfp-formular__eingang strong {
	font-weight: 700;
}

.mfp-formular__angaben {
	margin: 0 0 1.25rem;
	padding: 1rem 1.15rem;
	border-radius: 14px;
	background: #F4F8F6;
}

.mfp-formular__angaben dt {
	margin: 0.85rem 0 0;
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--wp--preset--color--text-gray);
}

.mfp-formular__angaben dt:first-child {
	margin-top: 0;
}

.mfp-formular__angaben dd {
	margin: 0.15rem 0 0;
	font-size: 0.98rem;
	line-height: 1.5;
	color: var(--wp--preset--color--dark);
	overflow-wrap: anywhere;
}

.mfp-formular__bestaetigung .mfp-formular__drucken-zeile {
	margin: 0;
}

/* Umriss-Knopf wie .mfp-knopf--umriss: zweitrangig neben der Anzeige */
.mfp-formular__drucken {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.55rem 1.3rem;
	border: 1.5px solid var(--wp--preset--color--primary);
	border-radius: 9999px;
	background: transparent;
	color: var(--wp--preset--color--primary-dark);
	font-family: var(--wp--preset--font-family--poppins), sans-serif;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.mfp-formular__drucken:hover,
.mfp-formular__drucken:focus-visible {
	color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
}

.mfp-formular__drucken:focus-visible {
	outline: 3px solid #1A1A2E;
	outline-offset: 2px;
}

/* ── Schmale Bildschirme ── */

@media (max-width: 400px) {
	.mfp-formular .mfp-formular__gruppe {
		padding-right: 0.85rem;
		padding-left: 0.85rem;
	}

	.mfp-formular__angaben {
		padding-right: 0.9rem;
		padding-left: 0.9rem;
	}
}

/* Unter 360px wuerden lange Kursnamen ("Selbstverantwortung") mitten im
   Wort umbrechen */
@media (max-width: 359px) {
	.mfp-formular__karte,
	.mfp-formular__bestaetigung {
		padding-right: 1.25rem;
		padding-left: 1.25rem;
	}
}

/* ── Drucken: nur die Anzeige ── */

@media print {
	.site-header,
	.site-footer,
	.mfp-formular__drucken-zeile {
		display: none !important;
	}

	/* Weniger Weissraum im Seitenkopf (page_header) und um die Karte, damit
	   die Bestaetigung moeglichst auf eine Seite passt. Die Abstaende stehen
	   inline am Block, daher !important. */
	.wp-block-post-content > .wp-block-group.has-background:first-child {
		padding-top: 0.5rem !important;
		padding-bottom: 1rem !important;
	}

	.mfp-vertragsformular {
		padding-top: 1rem !important;
		padding-bottom: 0 !important;
	}

	.mfp-formular__karte,
	.mfp-formular__bestaetigung {
		box-shadow: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mfp-formular__eingabe,
	.mfp-formular__knopf,
	.mfp-formular__drucken {
		transition: none;
	}
}

/* ── Kontaktformular (inc/kontakt-formular.php, 29.09.2026) ──
   Steht in der Karte der Kontaktseite (custom.css, .mfp-kontakt__karte),
   deshalb ohne eigene Karte und in voller Breite. Die Themen sind Pillen
   zum Anklicken, der Radioknopf bleibt fuer Tastatur und Screenreader
   bedienbar. */

.mfp-formular--kontakt {
	max-width: none;
}

.mfp-formular--kontakt .mfp-formular__themen {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.mfp-formular__thema {
	position: relative;
	display: inline-flex;
	cursor: pointer;
}

.mfp-formular__thema input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.mfp-formular__thema span {
	display: inline-block;
	padding: 0.5rem 0.95rem;
	border: 1.5px solid #D5DDD8;
	border-radius: 9999px;
	background: #ffffff;
	font-family: var(--wp--preset--font-family--poppins), sans-serif;
	font-size: 0.9rem;
	line-height: 1.3;
	color: var(--wp--preset--color--dark);
	transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.mfp-formular__thema:hover span {
	border-color: var(--wp--preset--color--primary);
}

.mfp-formular__thema input:checked + span {
	border-color: var(--wp--preset--color--primary);
	background: var(--wp--preset--color--primary);
	color: #ffffff;
}

.mfp-formular__thema input:focus-visible + span {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

.mfp-formular--kontakt .mfp-formular__bestaetigung {
	padding: 1.25rem 1.4rem;
	box-shadow: none;
}
