/* HMF Pop-up Hinweis – übernimmt Schrift und Akzentfarbe der Website */

.hmfp {
	--hmfp-rgb: 42, 111, 176;
	--hmfp-accent: rgb(var(--hmfp-rgb));
	--hmfp-accent-dark: rgb(29, 78, 123);
	--hmfp-text: #23282d;
	--hmfp-muted: #66717b;
	--hmfp-line: rgba(20, 30, 40, 0.09);
	--hmfp-bg: #ffffff;
	--hmfp-radius: 20px;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	font-family: inherit;
	font-size: inherit;
	line-height: 1.6;
	text-align: left;
	color: var(--hmfp-text);
	-webkit-font-smoothing: antialiased;
}

.hmfp.is-open {
	display: flex;
}

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

/* ---------- Hintergrund ---------- */

.hmfp__backdrop {
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at center, rgba(14, 20, 28, 0.55) 0%, rgba(10, 14, 20, 0.72) 100%);
	backdrop-filter: blur(6px) saturate(120%);
	-webkit-backdrop-filter: blur(6px) saturate(120%);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.hmfp.is-visible .hmfp__backdrop {
	opacity: 1;
}

/* ---------- Fenster ---------- */

.hmfp__dialog {
	position: relative;
	width: 100%;
	max-width: 640px;
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	overflow-x: hidden;
	overflow-y: auto;
	background: var(--hmfp-bg);
	border-radius: var(--hmfp-radius);
	text-align: left;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.06),
		0 2px 6px rgba(0, 0, 0, 0.06),
		0 30px 80px -10px rgba(var(--hmfp-rgb), 0.35),
		0 40px 100px rgba(0, 0, 0, 0.30);
	transform: translateY(24px) scale(0.97);
	opacity: 0;
	transition:
		transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
		opacity 0.35s ease;
	outline: none;
	scrollbar-width: thin;
}

.hmfp.is-visible .hmfp__dialog {
	transform: none;
	opacity: 1;
}

/* ---------- Schließen-X ---------- */

.hmfp__x {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	box-shadow: none;
	line-height: 1;
	transition: background 0.25s ease, transform 0.25s ease;
}

.hmfp__x:hover,
.hmfp__x:focus-visible {
	background: rgba(255, 255, 255, 0.24);
	transform: rotate(90deg);
}

/* ---------- Kopfbereich ---------- */

.hmfp__head {
	position: relative;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 30px 76px 28px 36px;
	color: #fff;
	text-align: left;
	background: linear-gradient(135deg, var(--hmfp-accent-dark) 0%, var(--hmfp-accent) 100%);
	overflow: hidden;
	isolation: isolate;
}

/* dezente Dekor-Kreise */
.hmfp__head::before,
.hmfp__head::after {
	content: "";
	position: absolute;
	z-index: -1;
	border-radius: 50%;
	pointer-events: none;
}

.hmfp__head::before {
	width: 260px;
	height: 260px;
	right: -90px;
	top: -130px;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 70%);
}

.hmfp__head::after {
	width: 160px;
	height: 160px;
	right: 40px;
	bottom: -110px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	box-shadow: 0 0 0 26px rgba(255, 255, 255, 0.04);
}

.hmfp__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.35);
	color: #fff;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 20px rgba(0, 0, 0, 0.12);
}

.hmfp__icon svg {
	width: 24px;
	height: 24px;
}

.hmfp__headings {
	min-width: 0;
}

.hmfp .hmfp__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 6px;
	padding: 0;
	font-family: inherit;
	font-size: 0.7em;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-align: left;
	color: rgba(255, 255, 255, 0.82);
}

.hmfp .hmfp__eyebrow::after {
	content: "";
	display: inline-block;
	width: 28px;
	height: 1px;
	background: rgba(255, 255, 255, 0.55);
}

.hmfp .hmfp__title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 1.85em;
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.015em;
	text-align: left;
	color: #fff;
	text-transform: none;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* ---------- Inhalt ---------- */

.hmfp__body {
	padding: 26px 36px 4px;
	font-size: 1em;
	text-align: left;
}

.hmfp__body > :first-child {
	margin-top: 0;
}

.hmfp__body > :last-child {
	margin-bottom: 0;
}

.hmfp .hmfp__body p {
	margin: 0 0 0.85em;
	padding: 0;
	text-align: left;
	color: var(--hmfp-text);
}

/* Anrede etwas betonter */
.hmfp .hmfp__body > p:first-child {
	margin-bottom: 0.5em;
	font-size: 1.06em;
	font-weight: 600;
	color: var(--hmfp-text);
}

/* Zwischenüberschriften als feine Label mit Linie */
.hmfp .hmfp__body h2,
.hmfp .hmfp__body h3,
.hmfp .hmfp__body h4 {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 1.5em 0 0.6em;
	padding: 0;
	font-family: inherit;
	font-size: 0.76em;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-align: left;
	color: var(--hmfp-accent);
}

.hmfp .hmfp__body h2::after,
.hmfp .hmfp__body h3::after,
.hmfp .hmfp__body h4::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: linear-gradient(90deg, rgba(var(--hmfp-rgb), 0.35), rgba(var(--hmfp-rgb), 0));
}

/* Absatz direkt unter einer Zwischenüberschrift = hervorgehobene Info-Karte */
.hmfp .hmfp__body h2 + p,
.hmfp .hmfp__body h3 + p,
.hmfp .hmfp__body h4 + p {
	position: relative;
	padding: 14px 20px 14px 22px;
	background: linear-gradient(135deg, rgba(var(--hmfp-rgb), 0.07) 0%, rgba(var(--hmfp-rgb), 0.03) 100%);
	border: 1px solid rgba(var(--hmfp-rgb), 0.12);
	border-radius: 12px;
	overflow: hidden;
}

.hmfp .hmfp__body h2 + p::before,
.hmfp .hmfp__body h3 + p::before,
.hmfp .hmfp__body h4 + p::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: linear-gradient(180deg, var(--hmfp-accent), var(--hmfp-accent-dark));
}

.hmfp .hmfp__body h2 + p strong,
.hmfp .hmfp__body h3 + p strong,
.hmfp .hmfp__body h4 + p strong {
	color: var(--hmfp-accent-dark);
}

.hmfp .hmfp__body strong,
.hmfp .hmfp__body b {
	font-weight: 700;
	color: var(--hmfp-text);
}

/* Schlussgruß abgesetzt und zentriert */
.hmfp .hmfp__body > p:last-child:not(:first-child) {
	margin-top: 1.3em;
	padding-top: 1em;
	border-top: 1px solid var(--hmfp-line);
	text-align: center;
	color: var(--hmfp-muted);
}

.hmfp .hmfp__body > p:last-child:not(:first-child) strong:first-child {
	display: inline-block;
	margin-bottom: 2px;
	font-size: 1.12em;
	color: var(--hmfp-accent-dark);
}

.hmfp .hmfp__body a {
	color: var(--hmfp-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.hmfp .hmfp__body a:hover {
	color: var(--hmfp-accent-dark);
}

.hmfp .hmfp__body ul,
.hmfp .hmfp__body ol {
	margin: 0 0 1em 1.3em;
	padding: 0;
	text-align: left;
}

.hmfp .hmfp__body li {
	margin: 0 0 0.4em;
}

.hmfp .hmfp__body li::marker {
	color: var(--hmfp-accent);
}

.hmfp .hmfp__body img {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
}

.hmfp .hmfp__body blockquote {
	margin: 1.2em 0;
	padding: 16px 20px;
	border-left: 4px solid var(--hmfp-accent);
	background: rgba(var(--hmfp-rgb), 0.05);
	border-radius: 0 12px 12px 0;
	font-style: italic;
}

/* ---------- Fußbereich (bleibt beim Scrollen immer sichtbar) ---------- */

.hmfp__foot {
	position: sticky;
	bottom: 0;
	z-index: 2;
	display: flex;
	justify-content: center;
	padding: 18px 36px 24px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--hmfp-bg) 30%);
}

.hmfp .hmfp__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 50px;
	padding: 13px 36px;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--hmfp-accent) 0%, var(--hmfp-accent-dark) 100%);
	color: #fff;
	font-family: inherit;
	font-size: 1em;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: none;
	cursor: pointer;
	overflow: hidden;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.22),
		0 10px 24px -6px rgba(var(--hmfp-rgb), 0.55);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hmfp .hmfp__btn::after {
	content: "\2192";
	display: inline-block;
	font-weight: 400;
	transition: transform 0.25s ease;
}

/* feiner Glanz beim Überfahren */
.hmfp .hmfp__btn::before {
	content: "";
	position: absolute;
	top: 0;
	left: -60%;
	width: 40%;
	height: 100%;
	background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
	transform: skewX(-20deg);
	transition: left 0.6s ease;
}

.hmfp .hmfp__btn:hover {
	transform: translateY(-2px);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.22),
		0 16px 32px -8px rgba(var(--hmfp-rgb), 0.65);
}

.hmfp .hmfp__btn:hover::before {
	left: 120%;
}

.hmfp .hmfp__btn:hover::after {
	transform: translateX(4px);
}

.hmfp .hmfp__btn:focus-visible {
	outline: 3px solid rgba(var(--hmfp-rgb), 0.45);
	outline-offset: 3px;
}

.hmfp .hmfp__x:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.7);
	outline-offset: 2px;
}

/* Seite nicht scrollen, solange das Pop-up offen ist */
html.hmfp-lock,
html.hmfp-lock body {
	overflow: hidden;
}

/* ---------- Niedrige Bildschirme (z. B. Laptops) ---------- */

@media (max-height: 820px) and (min-width: 601px) {
	.hmfp__head {
		padding-top: 24px;
		padding-bottom: 22px;
	}

	.hmfp__body {
		padding-top: 20px;
	}

	.hmfp .hmfp__body h2,
	.hmfp .hmfp__body h3,
	.hmfp .hmfp__body h4 {
		margin-top: 1.2em;
	}

	.hmfp__foot {
		padding-top: 14px;
		padding-bottom: 18px;
	}
}

/* ---------- Mobil ---------- */

@media (max-width: 600px) {
	.hmfp {
		padding: 10px;
		align-items: flex-end;
	}

	.hmfp__dialog {
		max-height: calc(100vh - 20px);
		max-height: calc(100dvh - 20px);
		border-radius: 18px;
	}

	.hmfp__head {
		gap: 14px;
		padding: 24px 62px 22px 22px;
	}

	.hmfp__icon {
		width: 42px;
		height: 42px;
	}

	.hmfp__icon svg {
		width: 20px;
		height: 20px;
	}

	.hmfp .hmfp__title {
		font-size: 1.45em;
	}

	.hmfp__x {
		top: 12px;
		right: 12px;
	}

	.hmfp__body {
		padding: 20px 22px 4px;
	}

	.hmfp .hmfp__body h2 + p,
	.hmfp .hmfp__body h3 + p,
	.hmfp .hmfp__body h4 + p {
		padding: 12px 14px 12px 18px;
	}

	.hmfp__foot {
		padding: 14px 22px 20px;
	}

	.hmfp .hmfp__btn {
		width: 100%;
	}
}

/* ---------- Weniger Bewegung, wenn gewünscht ---------- */

@media (prefers-reduced-motion: reduce) {
	.hmfp__backdrop,
	.hmfp__dialog,
	.hmfp__x,
	.hmfp .hmfp__btn,
	.hmfp .hmfp__btn::before,
	.hmfp .hmfp__btn::after {
		transition: none;
	}
}

/* ---------- Vorschau-Leiste (nur für Admins) ---------- */

.hmfp-preview-bar {
	position: fixed;
	left: 50%;
	bottom: 16px;
	z-index: 1000000;
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	justify-content: center;
	max-width: calc(100% - 32px);
	padding: 10px 12px 10px 20px;
	transform: translateX(-50%);
	border-radius: 999px;
	background: #1d2327;
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 13px;
	line-height: 1.4;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.hmfp-preview-bar strong {
	color: #f0b849;
}

.hmfp-preview-bar__reopen {
	margin: 0;
	padding: 7px 14px;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: #1d2327;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.hmfp-preview-bar__reopen:hover {
	background: #f0f0f1;
}

/* ---------- Druck ---------- */

@media print {
	.hmfp {
		display: none !important;
	}
}
