/****************************
*   M10 Contact — Kontaktformular
*   Child-Override; ersetzt das Parent-CSS komplett.
****************************/

section.m10_contact {
	padding-top: 0;
	/* Abstand bis zur grauen Flaeche des Folgeabschnitts (Figma 14519 -> 14663) */
	padding-bottom: 144px;
}

/* --- Zweispalter: Text 459, Formular 904 --- */

section.m10_contact .m10_allgemeine_daten_formular_container {
	display: flex;
	flex-wrap: nowrap;
	justify-content: space-between;
	align-items: flex-start;
	gap: 40px;
}

section.m10_contact .m10_text_allgemeine_daten_container {
	flex: 0 1 459px;
	min-width: 0;
}

section.m10_contact .m10_shortcode_formular_container {
	flex: 0 1 904px;
	min-width: 0;
}

section.m10_contact .m10_titel {
	max-width: 434px;
	margin-bottom: 23px;
}

section.m10_contact .m10_text_container p {
	line-height: 25px;
	letter-spacing: 0.03em;
	margin: 0;
}

/* Figma laesst zwischen Fliesstext und den Kontaktzeilen eine Leerzeile */
section.m10_contact .m10_text_container p:not(:last-child) {
	margin-bottom: 25px;
}

section.m10_contact .m10_text_container a {
	color: inherit;
}

/* --- Formular --- */

section.m10_contact .bz_pflichthinweis {
	margin-bottom: 17px;
	font-size: 0.882rem; /* 15px */
	line-height: 25px;
	letter-spacing: 0.03em;
	text-align: right;
	opacity: 0.5;
}

/* minmax(0, 1fr) ist Pflicht: die Textarea bringt ueber cols eine Eigenbreite
   von rund 410px mit und wuerde die Spalte sonst aufspreizen. */
section.m10_contact .bz_raster {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

section.m10_contact .bz_feld {
	min-width: 0;
}

section.m10_contact .bz_feld_breit {
	grid-column: 1 / -1;
}

section.m10_contact .wpcf7-form-control-wrap {
	display: block;
	position: relative;
}

/* Feldgrund: Figma legt 20 % #2b2b2b ueber #161616 */
section.m10_contact input[type="text"],
section.m10_contact input[type="email"],
section.m10_contact input[type="tel"],
section.m10_contact textarea,
section.m10_contact .mM_select_selected {
	display: block;
	width: 100%;
	height: 54px;
	padding: 15px 32px 14px;
	border: 1px solid transparent;
	border-radius: 15px;
	background-color: #2d2d2d;
	color: var(--color_weiss);
	font-family: inherit;
	font-size: 1rem;
	line-height: 25px;
	letter-spacing: 0.03em;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
}

section.m10_contact textarea {
	height: 135px;
	resize: vertical;
}

section.m10_contact input::placeholder,
section.m10_contact textarea::placeholder {
	color: var(--color_weiss);
	opacity: 1;
}

section.m10_contact input:focus,
section.m10_contact textarea:focus,
section.m10_contact .mM_custom_select:focus-within .mM_select_selected {
	outline: none;
	border-color: var(--color_primary);
}

/* --- Auswahlfelder ---
   Das Parent-Theme baut jedes <select> zu einem eigenen Widget um
   (lib/custom/mM_select). Das native Feld bleibt als Wertespeicher stehen. */

section.m10_contact .mM_custom_select select {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

section.m10_contact .mM_select_selected {
	position: relative;
	padding-right: 46px;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

section.m10_contact .mM_select_arrows {
	position: absolute;
	right: 14px;
	top: 50%;
	margin-top: -3.7px;
}

section.m10_contact .mM_select_arrow_down {
	width: 12px;
	height: 7.4px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 7.4'%3E%3Cpath d='M6 4.6L10.6 0L12 1.4L6 7.4L0 1.4L1.4 0L6 4.6Z' fill='%2330acd9'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
}

section.m10_contact .mM_select_items {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 5;
	padding: 8px 0;
	border-radius: 15px;
	background-color: #2d2d2d;
	max-height: 260px;
	overflow-y: auto;
}

section.m10_contact .mM_select_hide {
	display: none;
}

section.m10_contact .mM_select_item {
	padding: 6px 32px;
	line-height: 25px;
	letter-spacing: 0.03em;
	color: var(--color_weiss);
	cursor: pointer;
}

section.m10_contact .mM_select_item:hover,
section.m10_contact .mM_same_as_selected {
	background-color: rgba(247, 248, 250, 0.1);
}

/* --- Zustimmung und Absenden --- */

section.m10_contact .bz_abschluss {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 40px;
	margin-top: 20px;
}

section.m10_contact .bz_zustimmung {
	flex: 0 1 596px;
	font-size: 0.882rem; /* 15px */
	line-height: 25px;
	letter-spacing: 0.03em;
	color: rgba(247, 248, 250, 0.5);
}

/* Das Theme faerbt .wpcf7-list-item-label hart auf Weiss */
section.m10_contact .bz_zustimmung,
section.m10_contact .wpcf7-list-item-label {
	color: rgba(247, 248, 250, 0.5);
}

section.m10_contact .bz_zustimmung a {
	color: inherit;
	text-decoration: underline;
}

section.m10_contact .wpcf7-acceptance .wpcf7-list-item {
	margin: 0;
}

section.m10_contact .wpcf7-acceptance label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 0; /* das Theme setzt sonst 20px links */
	margin: 0;
	cursor: pointer;
}

/* Das Theme zeichnet seine eigene Checkbox als label::before (Kaestchen)
   und label::after (Haken) und blendet dafuer das echte Feld aus. Hier
   gestalten wir das echte Feld, also muessen die beiden weg. */
section.m10_contact .wpcf7-acceptance label::before,
section.m10_contact .wpcf7-acceptance label::after,
section.m10_contact .wpcf7-list-item-label::before,
section.m10_contact .wpcf7-list-item-label::after {
	content: none;
}

/* Der Entwurf zeigt nur eine minimal hellere Scheibe — ohne Rand und ohne
   sichtbaren Aktiv-Zustand waere das Kaestchen nicht bedienbar. */
section.m10_contact .wpcf7-acceptance input[type="checkbox"] {
	display: block; /* das Theme blendet Checkboxen sonst global aus */
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	margin: 1px 0 0;
	border: 1px solid rgba(247, 248, 250, 0.2);
	border-radius: 50%;
	background-color: #2d2d2d;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

section.m10_contact .wpcf7-acceptance input[type="checkbox"]:checked {
	border-color: var(--color_primary);
	background-color: var(--color_primary);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 9'%3E%3Cpath d='M1 4.5L4.4 8L11 1' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-size: 12px 9px;
	background-position: center;
	background-repeat: no-repeat;
}

section.m10_contact .bz_absenden {
	position: relative;
	flex: 0 0 auto;
}

section.m10_contact .wpcf7-submit {
	width: 184px;
	height: 54px;
	padding: 0 29px;
	border: 1px solid var(--color_tiefschwarz);
	border-radius: 15px;
	background-color: var(--color_primary);
	box-shadow: inset 0 4px 11px 4px rgba(255, 255, 255, 0.15);
	color: var(--color_weiss);
	font-family: inherit;
	font-size: 1rem;
	line-height: 25px;
	letter-spacing: 0.03em;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

section.m10_contact .wpcf7-spinner {
	position: absolute;
	top: 50%;
	right: calc(100% + 12px);
	margin: 0;
	-webkit-transform: translateY(-50%);
	transform: translateY(-50%);
}

/* --- Rueckmeldungen --- */

/* CF7 liefert den Hinweis mit hellrosa Flaeche — auf dunklem Grund falsch */
section.m10_contact .wpcf7-not-valid-tip {
	margin-top: 6px;
	padding: 0 0 0 32px;
	border: none;
	background: none;
	font-size: 0.882rem;
	line-height: 25px;
	color: #ff6b6b;
}

/* Bemaengeltes Pflichtfeld bekommt einen roten Rahmen.
   Die Grundregeln der Felder waehlen ueber [type=...] aus und wiegen damit
   schwerer als eine blosse Klasse — eine Regel "…  .wpcf7-not-valid" allein
   verliert gegen sie und faerbt nur das Auswahlfeld, das ueber den
   Elternknoten einen anderen Weg nimmt. Darum steht die Klasse hier direkt
   an denselben Auswahlformen wie in den Grundregeln. */
section.m10_contact input[type="text"].wpcf7-not-valid,
section.m10_contact input[type="email"].wpcf7-not-valid,
section.m10_contact input[type="tel"].wpcf7-not-valid,
section.m10_contact input[type="url"].wpcf7-not-valid,
section.m10_contact input[type="number"].wpcf7-not-valid,
section.m10_contact input[type="date"].wpcf7-not-valid,
section.m10_contact textarea.wpcf7-not-valid,
section.m10_contact .mM_custom_select:has(.wpcf7-not-valid) .mM_select_selected {
	border-color: #ff6b6b;
}

/* Das fehlende Haekchen meldet CF7 nicht am Feld, sondern nur am Formular:
   "unaccepted", wenn nur die Zustimmung fehlt, "invalid", wenn ausserdem
   etwas anderes leer ist. Darum haengt die Faerbung hier am Formularzustand
   und loest sich, sobald jemand das Haekchen setzt. */
section.m10_contact form.unaccepted .wpcf7-acceptance input[type="checkbox"]:not(:checked),
section.m10_contact form.invalid .wpcf7-acceptance input[type="checkbox"]:not(:checked) {
	border-color: #ff6b6b;
}

section.m10_contact .wpcf7-response-output {
	margin: 25px 0 0;
	padding: 15px 32px;
	border: 1px solid rgba(247, 248, 250, 0.2);
	border-radius: 15px;
	line-height: 25px;
}

section.m10_contact .wpcf7 form.sent .wpcf7-response-output {
	border-color: var(--color_primary);
}

/* --- Responsive --- */

@media only screen and (max-width: 1199px) {
	section.m10_contact {
		padding-bottom: 110px;
	}

	section.m10_contact .m10_allgemeine_daten_formular_container {
		flex-wrap: wrap;
		gap: 55px;
	}

	section.m10_contact .m10_text_allgemeine_daten_container,
	section.m10_contact .m10_shortcode_formular_container {
		flex: 1 1 100%;
	}

	section.m10_contact .m10_titel,
	section.m10_contact .m10_text_container {
		max-width: none;
	}
}

@media only screen and (max-width: 767px) {
	section.m10_contact {
		padding-bottom: 90px;
	}

	section.m10_contact .bz_raster {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Vollbreiter Knopf: die Ladeanzeige muss nach innen, sonst steht sie
	   links ausserhalb des Bildschirms. */
	section.m10_contact .wpcf7-spinner {
		right: 12px;
	}

	section.m10_contact input[type="text"],
	section.m10_contact input[type="email"],
	section.m10_contact input[type="tel"],
	section.m10_contact textarea,
	section.m10_contact .mM_select_selected {
		padding-left: 24px;
		padding-right: 24px;
	}

	section.m10_contact .mM_select_selected {
		padding-right: 40px;
	}

	section.m10_contact .mM_select_item {
		padding-left: 24px;
		padding-right: 24px;
	}

	section.m10_contact .bz_abschluss {
		flex-direction: column;
		align-items: stretch;
		gap: 30px;
	}

	/* Die Grundregel gibt dem Zustimmungsblock `flex: 0 1 596px`. In der Zeile
	   ist das seine Breite — in der Spalte wird daraus seine HOEHE, und der
	   Block stand 596px hoch bei 75px Inhalt. Zusammen mit space-between klebte
	   der Absenden-Knopf ganz unten und dazwischen gaehnte die Luecke. */
	section.m10_contact .bz_zustimmung {
		flex: 0 1 auto;
	}

	section.m10_contact .wpcf7-submit {
		width: 100%;
	}

	section.m10_contact .wpcf7-not-valid-tip {
		padding-left: 24px;
	}
}

/* --- Fokus ------------------------------------------------ */

/* Zur cyanen Kante ein weicher Ring, damit der Sprung von Feld zu Feld
   auch aus dem Augenwinkel sichtbar ist. */
section.m10_contact input:focus,
section.m10_contact textarea:focus,
section.m10_contact .mM_custom_select:focus-within .mM_select_selected {
	box-shadow: 0 0 0 3px rgba(48, 172, 217, 0.18);
}

section.m10_contact input,
section.m10_contact textarea,
section.m10_contact .mM_select_selected {
	-webkit-transition: border-color var(--bz_dauer), box-shadow var(--bz_dauer);
	transition: border-color var(--bz_dauer), box-shadow var(--bz_dauer);
}
