/* Freiluft Newsletter Popup – Farben kommen als CSS-Variablen aus den Einstellungen. */

.fnp {
	--fnp-accent: #916eb0;
	--fnp-button: #ffb140;
	--fnp-button-text: #3b2a50;
	--fnp-text: #676767;
	--fnp-bg: #ffffff;
	--fnp-heading-font: inherit;
	--fnp-heading-weight: 700;
	--fnp-button-radius: 6px;
	--fnp-button-size: 20px;
	--fnp-error: #c62828;
	--fnp-radius: 10px;
}

/* Hintergrund nur sperren, wenn das Popup modal (mobil) offen ist. */
html:has(.fnp-dialog:modal) {
	overflow: hidden;
}

/* ---------- Desktop: unten rechts, Seite bleibt bedienbar ---------- */

.fnp .fnp-dialog {
	position: fixed;
	inset: auto 24px 24px auto;
	z-index: 99999;
	width: 380px;
	max-width: calc(100vw - 48px);
	height: auto;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--fnp-radius);
	background: var(--fnp-bg);
	color: var(--fnp-text);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
	overflow: auto;
	overscroll-behavior: contain;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	text-align: center;
}

.fnp .fnp-dialog[open] {
	animation: fnp-slide-in 0.35s ease-out both;
}

.fnp .fnp-dialog:focus,
.fnp .fnp-dialog:focus-visible {
	outline: none;
}

.fnp .fnp-dialog::backdrop {
	background: rgba(20, 16, 24, 0.6);
}

/* ---------- Mobil: mittig, abgedunkelter Hintergrund ---------- */

@media (max-width: 767px) {
	.fnp .fnp-dialog {
		inset: 0;
		width: calc(100vw - 32px);
		max-width: 440px;
		height: fit-content;
		max-height: calc(100vh - 32px);
		max-height: calc(100dvh - 32px);
		margin: auto;
	}

	.fnp .fnp-dialog[open] {
		animation-name: fnp-pop-in;
	}
}

@keyframes fnp-slide-in {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes fnp-pop-in {
	from {
		opacity: 0;
		transform: scale(0.96);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fnp .fnp-dialog[open] {
		animation: none;
	}
}

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

.fnp .fnp-dialog [hidden] {
	display: none !important;
}

/* ---------- Bild mit Überschrift (randlos) ---------- */

.fnp .fnp-hero {
	position: relative;
	margin: 0;
	background: #222222;
}

.fnp .fnp-hero .fnp-hero-img {
	display: block;
	width: 100%;
	max-width: none;
	height: auto;
	aspect-ratio: 16 / 9;
	margin: 0;
	border-radius: 0;
	object-fit: cover;
}

.fnp .fnp-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.3) 45%, rgba(0, 0, 0, 0) 75%);
	pointer-events: none;
}

/* Überschrift: Schrift, Größe und Stil kommen aus dem Theme (h2/h3). */
.fnp .fnp-title {
	margin: 0 0 10px;
	padding: 0;
	color: var(--fnp-accent);
}

/* Eigene Überschriftengröße (Einstellung „Größe“); 0 = Größe aus dem Theme. */
.fnp .fnp-title.fnp-title-sized {
	font-size: var(--fnp-title-size) !important;
	line-height: 1.05 !important;
}

@media (max-width: 767px) {
	.fnp .fnp-title.fnp-title-sized {
		font-size: calc(var(--fnp-title-size) * 0.85) !important;
	}
}

.fnp .fnp-hero .fnp-title {
	position: absolute;
	right: 20px;
	bottom: 14px;
	left: 20px;
	z-index: 1;
	margin: 0 !important;
	color: #ffffff !important;
	text-align: left;
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

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

.fnp .fnp-inner {
	position: relative;
	padding: 22px 24px 24px;
}

.fnp .fnp-dialog:not(.fnp-has-hero) .fnp-inner {
	padding-top: 40px;
}

/* Schließen-× in den Farben des Anmelde-Buttons, rund, Symbol exakt mittig. */
.fnp .fnp-dialog .fnp-close {
	-webkit-appearance: none !important;
	appearance: none !important;
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 40px !important;
	height: 40px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--fnp-button) !important;
	color: var(--fnp-button-text) !important;
	font-family: var(--fnp-heading-font, inherit) !important;
	font-style: normal !important;
	font-weight: var(--fnp-heading-weight, 700) !important;
	font-size: 26px !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-shadow: none !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.fnp .fnp-dialog .fnp-close svg {
	display: block !important;
	flex: 0 0 auto;
	width: 18px !important;
	height: 18px !important;
	margin: 0 !important;
	pointer-events: none;
}

.fnp .fnp-dialog .fnp-close:hover,
.fnp .fnp-dialog .fnp-close:focus,
.fnp .fnp-dialog .fnp-close:active {
	background: var(--fnp-button) !important;
	color: var(--fnp-button-text) !important;
}

.fnp .fnp-dialog .fnp-close:hover {
	filter: brightness(0.95);
}

.fnp .fnp-logo {
	display: block;
	width: 96px;
	height: auto;
	margin: 0 auto 16px;
}

.fnp .fnp-text {
	margin: 0 0 18px;
	padding: 0;
	color: inherit;
	font-size: 16px;
}

.fnp .fnp-form {
	margin: 0;
	text-align: left;
}

.fnp .fnp-field {
	margin: 0 0 12px;
}

/* Feld-Beschriftungen: Schrift, Größe und Stärke kommen aus dem Theme (wie in dessen Formularen). */
.fnp .fnp-label {
	display: block;
	margin: 0 0 6px;
	color: inherit;
	line-height: 1.3;
}

.fnp .fnp-label small {
	font: inherit;
	opacity: 0.75;
}

.fnp .fnp-input {
	display: block;
	width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid rgba(0, 0, 0, 0.28);
	border-radius: 6px;
	background: #ffffff;
	color: #222222;
	font-family: inherit;
	font-size: 16px;
	line-height: 46px;
	box-shadow: none;
}

.fnp .fnp-input:focus {
	border-color: var(--fnp-accent);
	outline: 2px solid var(--fnp-accent);
	outline-offset: 1px;
}

.fnp .fnp-input[aria-invalid="true"] {
	border-color: var(--fnp-error);
}

.fnp .fnp-consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 4px 0 16px;
	color: inherit;
	font-family: inherit !important;
	font-size: 13px !important;
	font-style: normal !important;
	font-weight: 400 !important;
	line-height: 1.45 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	cursor: pointer;
}

.fnp .fnp-consent span,
.fnp .fnp-consent a {
	font: inherit !important;
	letter-spacing: inherit !important;
	text-transform: inherit !important;
}

.fnp .fnp-consent input {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--fnp-accent);
}

.fnp .fnp-consent a {
	color: inherit;
	text-decoration: underline;
}

.fnp .fnp-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.fnp .fnp-msg {
	margin: 0 0 12px;
	font-size: 14px;
	text-align: center;
}

.fnp .fnp-msg:empty {
	display: none;
}

.fnp .fnp-msg.is-error {
	color: var(--fnp-error);
}

/* Buttons: „Jetzt anmelden“, „Schließen“ und Öffnen-Button sehen identisch aus.
   !important, weil viele Themes Buttons je nach Typ (submit/button) unterschiedlich überschreiben. */
.fnp .fnp-dialog .fnp-submit,
.fnp .fnp-trigger {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: block;
	width: 100%;
	min-height: 50px !important;
	height: auto !important;
	margin: 0 !important;
	padding: 12px 20px !important;
	border: 0 !important;
	border-radius: var(--fnp-button-radius, 6px) !important;
	background: var(--fnp-button) !important;
	color: var(--fnp-button-text) !important;
	font-family: var(--fnp-heading-font, inherit) !important;
	font-style: normal !important;
	font-weight: var(--fnp-heading-weight, 700) !important;
	font-size: var(--fnp-button-size, 20px) !important;
	line-height: 1.2 !important;
	letter-spacing: normal !important;
	text-transform: uppercase !important;
	text-align: center !important;
	text-decoration: none !important;
	text-shadow: none !important;
	box-shadow: none !important;
	opacity: 1;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.fnp .fnp-trigger {
	display: inline-block;
	width: auto;
}

.fnp .fnp-dialog .fnp-submit:hover,
.fnp .fnp-dialog .fnp-submit:focus,
.fnp .fnp-dialog .fnp-submit:active,
.fnp .fnp-trigger:hover,
.fnp .fnp-trigger:focus,
.fnp .fnp-trigger:active {
	background: var(--fnp-button) !important;
	color: var(--fnp-button-text) !important;
}

.fnp .fnp-dialog .fnp-submit:hover,
.fnp .fnp-trigger:hover {
	filter: brightness(0.95);
}

.fnp .fnp-dialog .fnp-submit:focus-visible,
.fnp .fnp-trigger:focus-visible,
.fnp .fnp-close:focus-visible {
	outline: 3px solid var(--fnp-accent);
	outline-offset: 2px;
}

.fnp .fnp-dialog .fnp-submit[disabled] {
	opacity: 0.7;
	cursor: progress;
}

.fnp .fnp-admin-notice {
	margin: 0 0 12px;
	padding: 10px 14px;
	border-left: 4px solid #d63638;
	background: #fcf0f1;
	color: #1d2327;
	font-size: 14px;
}
