/*
 * Leni Rosenbauer_Kontaktformular
 * Erstellt von Leni Rosenbauer
 *
 * Ausschliesslich Theme-Tokens (--wp--preset--*, --wp--custom--*).
 * Keine eigenen Farbwerte, keine eigenen Schriftgroessen ausserhalb der Skala.
 */

.lr-kf {
	--lr-kf-gap: var(--wp--preset--spacing--m, 1.25rem);
	max-width: var(--wp--custom--measure--body, 68ch);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--text, inherit);
}

.lr-kf__form {
	display: flex;
	flex-direction: column;
	gap: var(--lr-kf-gap);
	margin: 0;
}

/* ---------- Meldungen ---------- */

.lr-kf__notice {
	margin: 0 0 var(--wp--preset--spacing--l, 1.75rem);
	padding: var(--wp--preset--spacing--m, 1.25rem);
	border: 1px solid var(--wp--preset--color--line);
	border-left-width: 4px;
	border-radius: var(--wp--custom--radius--m, 14px);
	background-color: var(--wp--preset--color--surface-alt);
}

.lr-kf__notice:focus {
	outline: var(--wp--custom--focus--width, 2px) solid var(--wp--preset--color--brand-secondary);
	outline-offset: var(--wp--custom--focus--offset, 3px);
}

.lr-kf__notice--success {
	border-color: var(--wp--preset--color--success);
	background-color: var(--wp--preset--color--success-soft);
}

.lr-kf__notice--error {
	border-color: var(--wp--preset--color--error);
	background-color: var(--wp--preset--color--error-soft);
}

.lr-kf__notice-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--display, inherit);
	font-size: var(--wp--preset--font-size--xl, 1.5rem);
	font-weight: 400;
	line-height: var(--wp--custom--line-height--snug, 1.35);
}

.lr-kf__notice-text {
	margin: var(--wp--preset--spacing--xs, 0.5rem) 0 0;
	font-size: var(--wp--preset--font-size--sm, 0.9375rem);
	line-height: var(--wp--custom--line-height--body, 1.62);
}

.lr-kf__notice-icon {
	display: inline-block;
	margin-right: var(--wp--preset--spacing--2xs, 0.25rem);
	font-weight: 700;
}

.lr-kf__notice--success .lr-kf__notice-icon {
	color: var(--wp--preset--color--success);
}

.lr-kf__notice--error .lr-kf__notice-icon {
	color: var(--wp--preset--color--error);
}

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

.lr-kf__legend {
	margin: 0;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--xs, 0.8125rem);
}

.lr-kf__field {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--2xs, 0.375rem);
	margin: 0;
}

.lr-kf__label {
	font-size: var(--wp--preset--font-size--sm, 0.9375rem);
	font-weight: 600;
	line-height: var(--wp--custom--line-height--snug, 1.35);
}

.lr-kf__required {
	color: var(--wp--preset--color--brand-primary-deep);
}

.lr-kf__input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.7em 0.9em;
	border: 1px solid var(--wp--preset--color--line-strong);
	border-radius: var(--wp--custom--radius--s, 10px);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--base, 1rem);
	line-height: var(--wp--custom--line-height--normal, 1.5);
	transition: border-color var(--wp--custom--dur--fast, 150ms) var(--wp--custom--ease--out, ease-out);
}

.lr-kf__input:hover {
	border-color: var(--wp--preset--color--ink);
}

.lr-kf__input:focus,
.lr-kf__file:focus,
.lr-kf__checkbox:focus,
.lr-kf__submit:focus,
.lr-kf__link:focus {
	outline: var(--wp--custom--focus--width, 2px) solid var(--wp--preset--color--brand-secondary);
	outline-offset: var(--wp--custom--focus--offset, 3px);
}

.lr-kf__input[aria-invalid="true"],
.lr-kf__file[aria-invalid="true"] {
	border-color: var(--wp--preset--color--error);
	border-width: 2px;
}

.lr-kf__textarea {
	min-height: 9rem;
	resize: vertical;
}

.lr-kf__select {
	appearance: none;
	padding-right: 2.4em;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 1.25em) 55%, calc(100% - 0.9em) 55%;
	background-size: 0.4em 0.4em, 0.4em 0.4em;
	background-repeat: no-repeat;
}

.lr-kf__file {
	padding: 0.6em 0;
	font-size: var(--wp--preset--font-size--sm, 0.9375rem);
}

.lr-kf__hint {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--xs, 0.8125rem);
	line-height: var(--wp--custom--line-height--normal, 1.5);
}

/* Fehler: Wort, Zeichen und Farbe – nie Farbe allein. */
.lr-kf__error {
	display: block;
	padding: 0.45em 0.7em;
	border-left: 3px solid var(--wp--preset--color--error);
	border-radius: var(--wp--custom--radius--xs, 6px);
	background-color: var(--wp--preset--color--error-soft);
	color: var(--wp--preset--color--error);
	font-size: var(--wp--preset--font-size--xs, 0.8125rem);
	line-height: var(--wp--custom--line-height--normal, 1.5);
}

.lr-kf__error-icon {
	font-weight: 700;
}

.lr-kf__error-word {
	font-weight: 700;
}

/* ---------- Einwilligung ---------- */

.lr-kf__field--check {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: start;
	gap: var(--wp--preset--spacing--xs, 0.6rem);
}

.lr-kf__checkbox {
	width: 1.15rem;
	height: 1.15rem;
	margin: 0.15rem 0 0;
	accent-color: var(--wp--preset--color--brand-primary);
}

.lr-kf__label--check {
	font-weight: 400;
	font-size: var(--wp--preset--font-size--sm, 0.9375rem);
	line-height: var(--wp--custom--line-height--body, 1.62);
}

.lr-kf__field--check .lr-kf__error {
	grid-column: 1 / -1;
}

.lr-kf__link {
	color: inherit;
	text-decoration-thickness: from-font;
	text-underline-offset: 0.2em;
}

/* ---------- Aktionen ---------- */

.lr-kf__actions {
	margin: var(--wp--preset--spacing--xs, 0.5rem) 0 0;
}

.lr-kf__submit {
	cursor: pointer;
	border: 0;
	font-family: inherit;
}

.lr-kf__footnote {
	margin: 0;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--xs, 0.8125rem);
	line-height: var(--wp--custom--line-height--normal, 1.5);
}

.lr-kf__live:empty {
	display: none;
}

.lr-kf__live {
	margin: 0;
	padding: 0.45em 0.7em;
	border-left: 3px solid var(--wp--preset--color--error);
	border-radius: var(--wp--custom--radius--xs, 6px);
	background-color: var(--wp--preset--color--error-soft);
	color: var(--wp--preset--color--error);
	font-size: var(--wp--preset--font-size--xs, 0.8125rem);
}

/* ---------- Honeypot: fuer Menschen unsichtbar, fuer Bots verlockend ---------- */

.lr-kf__honeypot {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.lr-kf__input {
		transition: none;
	}
}
