/* MHC Anfragen – Formular
   Schrift kommt vom Theme. Farben lassen sich überschreiben, z. B. im
   Customizer → Zusätzliches CSS:
   .mhc-af { --mhc-af-accent: #003b6f; --mhc-af-surface: #fff; --mhc-af-radius: 16px; }
   Die Akzentfarbe lässt sich auch unter Anfragen → Einstellungen wählen. */

.mhc-af {
	--mhc-af-accent: #003b6f;
	--mhc-af-on-accent: #fff;
	--mhc-af-surface: #fff;
	--mhc-af-field: #f6f8fb;
	--mhc-af-text: #1b2430;
	--mhc-af-muted: #5d6b7c;
	--mhc-af-line: #dfe5ec;        /* Trennlinien */
	--mhc-af-border: #7b8796;      /* Feldränder: mind. 3:1 zur Karte (WCAG 1.4.11) */
	--mhc-af-error: #c0352b;
	--mhc-af-ok: #1f8a4c;
	--mhc-af-radius: 16px;
	--mhc-af-tint: rgba(0, 59, 111, 0.08);
	--mhc-af-ring: rgba(0, 59, 111, 0.18);

	box-sizing: border-box;
	max-width: 56rem;
	margin: 2rem auto;
	padding: clamp(1.25rem, 4vw, 2.75rem);
	color: var(--mhc-af-text);
	background: var(--mhc-af-surface);
	border: 1px solid var(--mhc-af-line);
	border-radius: var(--mhc-af-radius);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -12px rgba(16, 24, 40, 0.14);
	line-height: 1.5;
	text-align: left;
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
	.mhc-af {
		--mhc-af-tint: color-mix(in srgb, var(--mhc-af-accent) 8%, transparent);
		--mhc-af-ring: color-mix(in srgb, var(--mhc-af-accent) 22%, transparent);
	}
}

.mhc-af *,
.mhc-af *::before,
.mhc-af *::after {
	box-sizing: border-box;
}

/* Kopf ------------------------------------------------------------- */

.mhc-af-head {
	margin-bottom: 2rem;
}

.mhc-af-kicker {
	display: inline-block;
	margin: 0 0 0.6rem;
	padding: 0.25em 0.75em;
	border-radius: 999px;
	background: var(--mhc-af-tint);
	color: var(--mhc-af-accent);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.mhc-af-title {
	margin: 0;
	color: var(--mhc-af-text);
	font-size: clamp(1.5rem, 3.2vw, 2rem);
	line-height: 1.2;
}

.mhc-af-intro {
	margin: 0.6rem 0 0;
	max-width: 40rem;
	color: var(--mhc-af-muted);
	font-size: 1.05rem;
}

/* Abschnitte ------------------------------------------------------- */

.mhc-af-group {
	margin: 0;
	padding: 1.75rem 0 0;
	border: 0;
	border-top: 1px solid var(--mhc-af-line);
	min-width: 0;
}

.mhc-af-group + .mhc-af-group {
	margin-top: 2rem;
}

/* Der erste Abschnitt folgt immer direkt auf das versteckte Lockfeld. */
.mhc-af-hp + .mhc-af-group {
	border-top: 0;
	padding-top: 0;
}

.mhc-af-group > legend {
	float: left;
	width: 100%;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 1.25rem;
	padding: 0;
	color: var(--mhc-af-text);
	font-size: 1.125rem;
	font-weight: 700;
}

.mhc-af-group > legend + * {
	clear: both;
}

.mhc-af-step {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--mhc-af-accent);
	color: var(--mhc-af-on-accent);
	font-size: 0.9rem;
	font-weight: 700;
}

.mhc-af-grid {
	display: grid;
	align-items: start;
	gap: 1.1rem 1.25rem;
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
	.mhc-af-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.mhc-af-group > .mhc-af-grid + .mhc-af-field,
.mhc-af-group > .mhc-af-field + .mhc-af-field,
.mhc-af-group > .mhc-af-grid + .mhc-af-chips {
	margin-top: 1.4rem;
}

/* Felder ----------------------------------------------------------- */

.mhc-af-field {
	display: grid;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.mhc-af-field > label,
.mhc-af-chips > legend {
	color: var(--mhc-af-text);
	font-size: 0.9rem;
	font-weight: 600;
}

.mhc-af input[type="text"],
.mhc-af input[type="email"],
.mhc-af input[type="tel"],
.mhc-af input[type="number"],
.mhc-af input[type="date"],
.mhc-af input[type="time"],
.mhc-af select,
.mhc-af textarea {
	width: 100%;
	max-width: 100%;
	min-height: 3rem;
	margin: 0;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--mhc-af-border);
	border-radius: 10px;
	background-color: var(--mhc-af-field);
	color: var(--mhc-af-text);
	font: inherit;
	font-size: 1rem;
	line-height: 1.4;
	box-shadow: none;
	transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.mhc-af input::placeholder,
.mhc-af textarea::placeholder {
	color: #66717f;
	opacity: 1;
}

.mhc-af input:hover,
.mhc-af select:hover,
.mhc-af textarea:hover {
	border-color: var(--mhc-af-text);
}

.mhc-af input:focus,
.mhc-af select:focus,
.mhc-af textarea:focus {
	outline: 2px solid transparent; /* bleibt im Kontrastmodus von Windows sichtbar */
	border-color: var(--mhc-af-accent);
	background-color: #fff;
	box-shadow: 0 0 0 4px var(--mhc-af-ring);
}

.mhc-af select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 2.5rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%235d6b7c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.85rem center;
	background-size: 1.1rem;
	cursor: pointer;
}

.mhc-af textarea {
	min-height: 8rem;
	resize: vertical;
}

.mhc-af-hint {
	margin: 0;
	color: var(--mhc-af-muted);
	font-size: 0.8rem;
	font-weight: 400;
}

.mhc-af-chips > legend .mhc-af-hint {
	margin-left: 0.4rem;
}

/* Auswahl-Chips (Bestuhlung, Leistungen) --------------------------- */

.mhc-af-chips > legend {
	margin-bottom: 0.55rem;
	padding: 0;
}

.mhc-af-chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.mhc-af-chip {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.mhc-af-chip input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.mhc-af-chip > span {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	min-height: 2.75rem; /* 44px Antippfläche */
	padding: 0.5rem 1.05rem;
	border: 1px solid var(--mhc-af-border);
	border-radius: 999px;
	background: var(--mhc-af-field);
	color: var(--mhc-af-text);
	font-size: 0.925rem;
	line-height: 1.2;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
	user-select: none;
}

.mhc-af-chip-icon {
	display: inline-grid;
	place-items: center;
	width: 1.1rem;
	height: 1.1rem;
	margin-left: -0.2rem;
	border-radius: 50%;
	background: rgba(93, 107, 124, 0.16);
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1;
}

/* Symbol per CSS in einem aria-hidden-Element: Screenreader lesen nur den Namen. */
.mhc-af-chip-icon::before {
	content: "+";
}

.mhc-af-chip:hover > span {
	border-color: var(--mhc-af-accent);
}

.mhc-af-chip input:focus-visible + span {
	outline: 2px solid var(--mhc-af-accent);
	outline-offset: 2px;
	box-shadow: 0 0 0 4px var(--mhc-af-ring);
	border-color: var(--mhc-af-accent);
}

.mhc-af-chip input:checked + span {
	border-color: var(--mhc-af-accent);
	background: var(--mhc-af-accent);
	color: var(--mhc-af-on-accent);
}

.mhc-af-chip-multi input:checked + span .mhc-af-chip-icon {
	background: rgba(255, 255, 255, 0.22);
}

.mhc-af-chip-multi input:checked + span .mhc-af-chip-icon::before {
	content: "✓";
}

/* Fuß: Einwilligung und Senden ------------------------------------- */

.mhc-af-foot {
	display: grid;
	gap: 1.25rem;
	margin-top: 2rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--mhc-af-line);
}

.mhc-af-consent {
	padding: 1rem 1.1rem;
	border-radius: 10px;
	background: var(--mhc-af-field);
	font-size: 0.9rem;
	color: var(--mhc-af-muted);
}

.mhc-af-consent > label {
	font-weight: 400;
	font-size: inherit;
	color: inherit;
}

.mhc-af-consent a {
	color: var(--mhc-af-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.mhc-af-check {
	min-height: 2.75rem;
	display: flex;
	gap: 0.7rem;
	align-items: flex-start;
	margin: 0;
	cursor: pointer;
}

.mhc-af-check input {
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	margin: 0.15rem 0 0;
	accent-color: var(--mhc-af-accent);
	cursor: pointer;
}

.mhc-af-send {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
}

.mhc-af-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 3.25rem;
	margin: 0;
	padding: 0.85rem 1.75rem;
	border: 0;
	border-radius: 999px;
	background: var(--mhc-af-accent);
	color: var(--mhc-af-on-accent);
	font: inherit;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 8px 20px -8px var(--mhc-af-accent);
	transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.mhc-af-submit svg {
	transition: transform 0.15s;
}

.mhc-af-submit:hover {
	filter: brightness(1.12);
	transform: translateY(-1px);
}

.mhc-af-submit:hover svg {
	transform: translateX(3px);
}

.mhc-af-submit:focus-visible {
	outline: 2px solid transparent; /* bleibt im Kontrastmodus von Windows sichtbar */
	box-shadow: 0 0 0 4px var(--mhc-af-ring), 0 8px 20px -8px var(--mhc-af-accent);
}

.mhc-af-submit:active {
	transform: translateY(0);
}

@media (max-width: 520px) {
	.mhc-af-submit {
		width: 100%;
	}
}

.mhc-af-note {
	margin: 0;
	color: var(--mhc-af-muted);
	font-size: 0.85rem;
}

.mhc-af-req {
	border: 0;
	color: var(--mhc-af-error);
	text-decoration: none;
	cursor: help;
}

/* Fehler ----------------------------------------------------------- */

.mhc-af .has-error input,
.mhc-af .has-error select,
.mhc-af .has-error textarea {
	border-color: var(--mhc-af-error);
	background-color: #fff;
}

.mhc-af .has-error input:focus,
.mhc-af .has-error select:focus,
.mhc-af .has-error textarea:focus {
	box-shadow: 0 0 0 4px rgba(192, 53, 43, 0.15);
}

.mhc-af-consent.has-error {
	background: rgba(192, 53, 43, 0.07);
	box-shadow: inset 0 0 0 1px rgba(192, 53, 43, 0.35);
}

.mhc-af-error {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0;
	color: var(--mhc-af-error);
	font-size: 0.82rem;
	font-weight: 500;
}

.mhc-af-consent .mhc-af-error {
	margin: 0.5rem 0 0 1.85rem;
}

.mhc-af-errors {
	display: flex;
	align-items: flex-start;
	gap: 0.8rem;
	margin: 0 0 1.75rem;
	padding: 0.9rem 1.1rem;
	border-radius: 10px;
	background: rgba(192, 53, 43, 0.08);
	color: #8f241c;
	font-weight: 600;
}

.mhc-af-errors p {
	margin: 0;
}

.mhc-af-errors ul {
	margin: 0.4rem 0 0;
	padding-left: 1.1rem;
	font-weight: 500;
}

.mhc-af-errors li + li {
	margin-top: 0.2rem;
}

.mhc-af-errors a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.mhc-af-errors:focus,
.mhc-af-done:focus {
	outline: 2px solid var(--mhc-af-accent);
	outline-offset: 3px;
}

.mhc-af-errors-icon {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	background: var(--mhc-af-error);
	color: #fff;
	font-weight: 800;
}

/* Danke ------------------------------------------------------------ */

.mhc-af-done {
	text-align: center;
	padding-top: clamp(2rem, 6vw, 3.5rem);
	padding-bottom: clamp(2rem, 6vw, 3.5rem);
}

.mhc-af-done-icon {
	display: inline-grid;
	place-items: center;
	width: 3.5rem;
	height: 3.5rem;
	margin-bottom: 1rem;
	border-radius: 50%;
	background: rgba(31, 138, 76, 0.12);
	color: var(--mhc-af-ok);
	animation: mhc-af-pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.mhc-af-done-title {
	margin: 0 0 0.4rem;
	font-size: 1.5rem;
	font-weight: 700;
}

.mhc-af-done-text {
	max-width: 32rem;
	margin: 0 auto;
	color: var(--mhc-af-muted);
}

.mhc-af-done-small {
	margin-top: 0.75rem;
	font-size: 0.9rem;
}

/* Nur für Screenreader sichtbar. */
.mhc-af-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@keyframes mhc-af-pop {
	from { transform: scale(0.6); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.mhc-af *,
	.mhc-af-done-icon {
		animation: none !important;
		transition: none !important;
	}
}

/* Honeypot: für Menschen unsichtbar, für Bots ein normales Feld. */
.mhc-af-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
