/* Kontaktformular Kieferorthopädie Entrup – passt sich der Breite des Seitenbereichs an */
.ekf {
	--ekf-accent: #7d174f;
	--ekf-text: #393939;
	--ekf-muted: #666666;
	--ekf-border: #cfc6cb;
	--ekf-bg: #ffffff;
	--ekf-soft: color-mix(in srgb, var(--ekf-accent) 6%, #ffffff);
	--ekf-error: #b42318;
	--ekf-ok: var(--ekf-accent);
	--ekf-radius: 8px;
	container-type: inline-size;
	max-width: 860px;
	margin: 0 auto 0 0;
	color: var(--ekf-text);
	font: inherit;
	line-height: 1.5;
}
.ekf *, .ekf *::before, .ekf *::after { box-sizing: border-box; }

.ekf .ekf-title { margin: 0 0 .6em; font-size: 1.6em; font-weight: 400; line-height: 1.25; color: var(--ekf-accent); }
.ekf .ekf-intro p { margin: 0 0 1em; }
.ekf .ekf-note {
	font-size: .95em;
	color: var(--ekf-muted);
	margin: 0 0 1.25em;
}
.ekf .ekf-note-info {
	background: var(--ekf-soft);
	border-left: 4px solid var(--ekf-accent);
	border-radius: 0 var(--ekf-radius) var(--ekf-radius) 0;
	padding: 14px 18px;
	color: var(--ekf-text);
}
.ekf .ekf-note a, .ekf .ekf-checkbox a, .ekf .ekf-success a, .ekf .ekf-recaptcha-note a { color: var(--ekf-accent); text-decoration: underline; }

/* ---------- Raster ---------- */
.ekf .ekf-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 18px 20px;
}
.ekf .ekf-full  { grid-column: span 6; }
.ekf .ekf-half  { grid-column: span 3; }
.ekf .ekf-third { grid-column: span 2; }
.ekf .ekf-plz   { grid-column: span 2; }
.ekf .ekf-ort   { grid-column: span 4; }

@container (max-width: 620px) {
	.ekf .ekf-half, .ekf .ekf-third { grid-column: span 6; }
	.ekf .ekf-grid { gap: 16px 14px; }
}
/* Fallback für sehr alte Browser ohne Container Queries */
@supports not (container-type: inline-size) {
	@media (max-width: 680px) {
		.ekf .ekf-half, .ekf .ekf-third { grid-column: span 6; }
	}
}

/* ---------- Felder ---------- */
.ekf .ekf-field { min-width: 0; position: relative; }
.ekf .ekf-field > label {
	display: block;
	font-weight: 600;
	font-size: .95em;
	margin: 0 0 6px;
	color: var(--ekf-text);
}
.ekf .ekf-req { color: var(--ekf-error); }

.ekf input[type="text"],
.ekf input[type="email"],
.ekf input[type="tel"],
.ekf input[type="date"],
.ekf select,
.ekf textarea {
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
	min-height: 48px;
	padding: 11px 14px;
	font: inherit;
	font-size: 16px; /* verhindert Zoom auf iPhone */
	line-height: 1.4;
	color: var(--ekf-text);
	background: var(--ekf-bg);
	border: 1px solid var(--ekf-border);
	border-radius: var(--ekf-radius);
	box-shadow: none;
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none;
	appearance: none;
}
.ekf select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2352606d' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	cursor: pointer;
}
.ekf textarea { min-height: 150px; resize: vertical; }
.ekf ::placeholder { color: #9aa5b1; opacity: 1; }

.ekf input:focus, .ekf select:focus, .ekf textarea:focus {
	outline: none;
	border-color: var(--ekf-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ekf-accent) 22%, transparent);
}
.ekf .is-invalid input, .ekf .is-invalid select, .ekf .is-invalid textarea {
	border-color: var(--ekf-error);
	background-color: #fffafa;
}
.ekf .is-invalid input:focus, .ekf .is-invalid select:focus, .ekf .is-invalid textarea:focus {
	box-shadow: 0 0 0 3px rgba(180, 35, 24, .18);
}
.ekf .is-valid input:not([type="checkbox"]), .ekf .is-valid textarea { border-color: color-mix(in srgb, var(--ekf-accent) 55%, #ffffff); }
.ekf .is-valid input[type="text"], .ekf .is-valid input[type="email"], .ekf .is-valid input[type="tel"] {
	padding-right: 40px;
	background-image: var(--ekf-check);
	background-repeat: no-repeat;
	background-position: right 13px center;
}

.ekf .ekf-error {
	display: none;
	margin: 6px 0 0;
	font-size: .875em;
	line-height: 1.4;
	color: var(--ekf-error);
}
.ekf .ekf-error:not(:empty) { display: flex; gap: 6px; }
.ekf .ekf-error:not(:empty)::before {
	content: "!";
	flex: 0 0 16px;
	height: 16px;
	margin-top: 1px;
	border-radius: 50%;
	background: var(--ekf-error);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
}
.ekf .ekf-counter { margin-top: 4px; font-size: .8em; color: var(--ekf-muted); text-align: right; }
.ekf .ekf-counter.is-near { color: var(--ekf-error); }

/* ---------- Checkbox ---------- */
.ekf .ekf-field > label.ekf-checkbox,
.ekf .ekf-checkbox {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	font-weight: 400;
	font-size: .95em;
	cursor: pointer;
	margin: 0;
}
.ekf .ekf-checkbox input {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	margin: 1px 0 0;
	accent-color: var(--ekf-accent);
	cursor: pointer;
}
.ekf .is-invalid .ekf-checkbox input { outline: 2px solid var(--ekf-error); outline-offset: 1px; }

/* ---------- Captcha ---------- */
.ekf .ekf-captcha {
	background: var(--ekf-soft);
	border-radius: var(--ekf-radius);
	padding: 16px 18px;
}
.ekf .ekf-captcha-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ekf .ekf-captcha-img {
	display: block;
	width: 190px;
	height: 56px;
	border: 1px solid var(--ekf-border);
	border-radius: var(--ekf-radius);
	background: #fff;
}
.ekf .ekf-captcha-reload {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	margin: 0;
	border: 1px solid var(--ekf-border);
	border-radius: var(--ekf-radius);
	background: #fff;
	color: var(--ekf-muted);
	cursor: pointer;
}
.ekf .ekf-captcha-reload:hover { color: var(--ekf-accent); border-color: var(--ekf-accent); }
.ekf .ekf-captcha-reload.is-spinning svg { animation: ekf-spin .6s linear; }
.ekf .ekf-captcha-row input { width: 130px; flex: 0 0 130px; text-align: center; font-size: 18px; letter-spacing: .05em; }
@keyframes ekf-spin { to { transform: rotate(360deg); } }

/* ---------- Honeypot (für Menschen unsichtbar) ---------- */
.ekf .ekf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Absenden ---------- */
.ekf .ekf-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin-top: 24px;
}
.ekf .ekf-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 12px 32px;
	margin: 0;
	font: inherit;
	font-size: 17px;
	font-weight: 600;
	color: #fff;
	background: var(--ekf-accent);
	border: 0;
	border-radius: var(--ekf-radius);
	cursor: pointer;
	transition: filter .15s, transform .05s;
}
.ekf .ekf-submit:hover { filter: brightness(1.08); }
.ekf .ekf-submit:active { transform: translateY(1px); }
.ekf .ekf-submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--ekf-accent) 45%, transparent); outline-offset: 2px; }
.ekf .ekf-submit[disabled] { opacity: .7; cursor: progress; }
.ekf .ekf-submit[disabled]::before {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255,255,255,.5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ekf-spin .7s linear infinite;
}
.ekf .ekf-required-note { margin: 0; font-size: .875em; color: var(--ekf-muted); }

@container (max-width: 480px) {
	.ekf .ekf-submit { width: 100%; }
	.ekf .ekf-captcha-row input { flex: 1 1 110px; }
}

/* ---------- Meldungen ---------- */
.ekf .ekf-summary {
	margin: 0 0 20px;
	padding: 12px 16px;
	border: 1px solid var(--ekf-error);
	border-radius: var(--ekf-radius);
	background: #fef3f2;
	color: var(--ekf-error);
	font-weight: 600;
}
.ekf .ekf-summary[hidden], .ekf .ekf-success[hidden] { display: none; }
.ekf .ekf-success {
	padding: 22px 24px 22px 64px;
	border-radius: var(--ekf-radius);
	background: var(--ekf-soft);
	border: 1px solid color-mix(in srgb, var(--ekf-accent) 35%, #ffffff);
	color: var(--ekf-text);
	position: relative;
	outline: none;
}
.ekf .ekf-success::before {
	content: "";
	position: absolute;
	left: 22px;
	top: 22px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--ekf-ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center no-repeat;
}

@media (prefers-reduced-motion: reduce) {
	.ekf *, .ekf *::before { animation: none !important; transition: none !important; }
}

/* ---------- Datum ---------- */
.ekf input[type="date"] { min-height: 48px; }
.ekf input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }

/* ---------- Mehrfachauswahl (Wochentage, Tageszeit) ---------- */
.ekf .ekf-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.ekf .ekf-group legend { display: block; padding: 0; margin: 0 0 8px; font-weight: 600; font-size: .95em; color: var(--ekf-text); }
.ekf .ekf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ekf .ekf-chip { position: relative; display: inline-flex; margin: 0; cursor: pointer; font-weight: 400; }
.ekf .ekf-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ekf .ekf-chip span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 42px;
	padding: 8px 16px;
	border: 1px solid var(--ekf-border);
	border-radius: 999px;
	background: #fff;
	font-size: .95em;
	transition: background .15s, border-color .15s, color .15s;
	user-select: none;
}
.ekf .ekf-chip:hover span { border-color: var(--ekf-accent); }
.ekf .ekf-chip input:checked + span { background: var(--ekf-accent); border-color: var(--ekf-accent); color: #fff; }
.ekf .ekf-chip input:checked + span::before {
	content: "";
	width: 14px;
	height: 14px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center no-repeat;
}
.ekf .ekf-chip input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ekf-accent) 30%, transparent); }
.ekf .is-invalid .ekf-chip span { border-color: var(--ekf-error); }

/* ---------- Google reCAPTCHA ---------- */
.ekf .ekf-recaptcha { min-height: 78px; }
.ekf .ekf-recaptcha-note { margin: 8px 0 0; font-size: .8em; color: var(--ekf-muted); line-height: 1.45; }
.ekf.ekf-captcha-recaptcha_v3 .ekf-recaptcha-field .ekf-error:empty { display: none; }
body:has(.ekf-captcha-recaptcha_v3) .grecaptcha-badge { visibility: hidden; }
@container (max-width: 340px) {
	.ekf .ekf-recaptcha { transform: scale(.88); transform-origin: 0 0; }
}

/* ---------- Eigener Roboter-Check ---------- */
.ekf .ekf-robot {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	max-width: 340px;
	min-height: 74px;
	margin: 0;
	padding: 12px 14px 12px 16px;
	font: inherit;
	font-size: 15px;
	color: var(--ekf-text);
	text-align: left;
	background: #fff;
	border: 1px solid var(--ekf-border);
	border-radius: var(--ekf-radius);
	box-shadow: 0 1px 3px rgba(0,0,0,.06);
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s;
}
.ekf .ekf-robot:hover { border-color: var(--ekf-accent); }
.ekf .ekf-robot:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ekf-accent) 28%, transparent); border-color: var(--ekf-accent); }
.ekf .ekf-robot-box {
	position: relative;
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	border: 2px solid #b9b1b5;
	border-radius: 4px;
	background: #fff;
	transition: border-color .2s, background .2s, border-radius .2s;
}
.ekf .ekf-robot-label { flex: 1 1 auto; font-weight: 500; }
.ekf .ekf-robot-brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	flex: 0 0 auto;
	color: var(--ekf-accent);
	text-align: center;
}
.ekf .ekf-robot-brand small { font-size: 9px; line-height: 1.2; color: var(--ekf-muted); letter-spacing: .02em; }
/* Prüfung läuft */
.ekf .ekf-robot.is-busy { cursor: progress; }
.ekf .ekf-robot.is-busy .ekf-robot-box {
	border-radius: 50%;
	border-color: color-mix(in srgb, var(--ekf-accent) 25%, transparent);
	border-top-color: var(--ekf-accent);
	animation: ekf-spin .7s linear infinite;
}
/* bestätigt */
.ekf .ekf-robot.is-done { cursor: default; border-color: var(--ekf-ok); }
.ekf .ekf-robot.is-done .ekf-robot-box { border-color: var(--ekf-ok); background: var(--ekf-ok); }
.ekf .ekf-robot.is-done .ekf-robot-box::after {
	content: "";
	position: absolute;
	inset: 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center no-repeat;
}
.ekf .is-invalid .ekf-robot { border-color: var(--ekf-error); }

/* ---------- Bündig mit der Textspalte (Theme mit Foundation-Raster „fdn-grid“) ----------
   Der Formular-Abschnitt bekommt bei jeder Bildschirmbreite denselben Rand wie die
   Textabschnitte (Klasse „full-with-margin-10“): 10 %, bis 1024 px 5 %, ohne Innenabstand. */
.fdn-grid .grid-container.grid-container:has(.ekf) {
	margin-left: 10%;
	margin-right: 10%;
	padding-left: 0;
	padding-right: 0;
}
@media (max-width: 1024px) {
	.fdn-grid .grid-container.grid-container:has(.ekf) {
		margin-left: 5%;
		margin-right: 5%;
	}
}

/* ---------- Anamnesebögen ---------- */
.ekf .ekf-section {
	grid-column: span 6;
	margin: 18px 0 -4px;
	padding: 0 0 8px;
	font-size: 1.2em;
	line-height: 1.3;
	color: var(--ekf-accent);
	border-bottom: 2px solid color-mix(in srgb, var(--ekf-accent) 25%, #ffffff);
}
.ekf .ekf-grid > .ekf-section:first-child { margin-top: 0; }
.ekf .ekf-section-text { grid-column: span 6; margin: -4px 0 0; color: var(--ekf-muted); font-size: .95em; }
.ekf .ekf-ana-janein .ekf-frage,
.ekf .ekf-ana-skala .ekf-frage {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid color-mix(in srgb, var(--ekf-border) 70%, #ffffff);
	border-radius: var(--ekf-radius);
}
.ekf .ekf-ana-janein .ekf-frage legend,
.ekf .ekf-ana-skala .ekf-frage legend { float: left; margin: 0; padding: 0; font-weight: 500; flex: 1 1 260px; }
.ekf .ekf-ana-janein .ekf-chips { flex: 0 0 auto; }
.ekf .ekf-ana-janein .ekf-chip span { min-height: 36px; padding: 6px 18px; }
.ekf .ekf-ana-skala .ekf-chips { gap: 4px; }
.ekf .ekf-ana-skala .ekf-chip span { min-height: 34px; min-width: 34px; padding: 4px 8px; justify-content: center; }
.ekf .ekf-ana-skala .ekf-chip input:checked + span::before { display: none; }
.ekf [data-if] { margin-left: 24px; padding-left: 14px; border-left: 3px solid color-mix(in srgb, var(--ekf-accent) 30%, #ffffff); }
.ekf [hidden] { display: none !important; }
.ekf .ekf-koerper canvas {
	display: block;
	width: 100%;
	max-width: 594px;
	height: auto;
	border: 1px solid var(--ekf-border);
	border-radius: var(--ekf-radius);
	background: #fff;
	cursor: crosshair;
	touch-action: manipulation;
}
.ekf .ekf-koerper-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.ekf .ekf-koerper-tools button {
	padding: 8px 14px;
	margin: 0;
	font: inherit;
	font-size: .9em;
	color: var(--ekf-accent);
	background: #fff;
	border: 1px solid var(--ekf-accent);
	border-radius: var(--ekf-radius);
	cursor: pointer;
}
.ekf .ekf-koerper-count { color: var(--ekf-muted); font-size: .9em; }
.ekf .ekf-pdf-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
	padding: 10px 18px;
	color: #fff !important;
	text-decoration: none !important;
	background: var(--ekf-accent);
	border-radius: var(--ekf-radius);
	font-weight: 600;
}
