/*
 * Hinweis-Karten unten rechts: Einwilligungs-Banner und Erstinformation,
 * dazu Platzhalter für noch nicht geladene externe Inhalte.
 */

/* Stapel unten rechts: Cookie-Banner oben, Erstinformation darunter */
.fm-notices {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 100001; /* über Avadas "Nach oben"-Button (100000) */
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 340px;
	max-width: calc(100vw - 32px);
	pointer-events: none;
}

/* Karte */
.fm-notice {
	box-sizing: border-box;
	padding: 16px 18px 18px;
	background: var(--fm-paper);
	border: 0;
	border-top: 3px solid var(--fm-blue);
	border-radius: 4px;
	box-shadow: 0 8px 28px var(--fm-shadow);
	font-family: var(--fm-font);
	font-size: 13px;
	line-height: 1.55;
	color: var(--fm-text);
	pointer-events: auto;
	animation: fm-notice-in .25s ease;
}

.fm-notice[hidden] {
	display: none;
}

@keyframes fm-notice-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

.fm-notice__title {
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--fm-blue);
}

.fm-notice__text {
	margin: 0 0 14px;
}

.fm-notice a {
	color: var(--fm-blue);
	text-decoration: underline;
}

.fm-notice__actions {
	display: flex;
	gap: 8px;
}

.fm-notice__actions[hidden] {
	display: none;
}

/* Alle Entscheidungs-Buttons sehen gleich aus */
.fm-notice__btn {
	flex: 1 1 0;
	margin: 0;
	min-height: 44px;
	padding: 8px 10px;
	background: var(--fm-blue);
	border: 1px solid var(--fm-blue);
	border-radius: 3px;
	font: 600 12px/1.3 var(--fm-font);
	color: var(--fm-ink);
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: background-color .15s;
}

.fm-notice__btn:hover,
.fm-notice__btn:focus-visible {
	background: var(--fm-blue-dark);
}

.fm-notice__btn:active {
	transform: translateY(1px);
}

.fm-notice__btn:focus-visible,
.fm-consent__link:focus-visible,
.fm-consent__option input:focus-visible {
	outline: 2px solid var(--fm-focus);
	outline-offset: 2px;
}

/* ---------- Einwilligungs-Banner ---------- */

.fm-consent__notice {
	margin: 0 0 8px;
	padding: 6px 8px;
	background: var(--fm-tint);
	border-left: 2px solid var(--fm-blue);
	color: var(--fm-blue);
}

.fm-consent__notice[hidden],
.fm-consent__settings[hidden],
.fm-consent__link[hidden] {
	display: none;
}

/* Text-Button "Individuelle Einstellungen" */
.fm-consent__link {
	display: block;
	white-space: nowrap;
	width: 100%;
	margin: 10px 0 0;
	padding: 4px 0;
	background: none;
	border: 0;
	font: 12px/1.4 var(--fm-font);
	color: var(--fm-blue);
	text-decoration: underline;
	text-transform: none;
	cursor: pointer;
}

/* Einstellungen je Dienst */
.fm-consent__settings {
	margin: 0 0 14px;
	border-top: 1px solid var(--fm-line);
}

.fm-consent__option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 9px 0;
	border-bottom: 1px solid var(--fm-line);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.45;
	color: var(--fm-text-soft);
	cursor: pointer;
}

.fm-consent__option strong {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--fm-text-strong);
}

/* Schalter */
.fm-consent__option input {
	flex: none;
	position: relative;
	width: 30px;
	height: 17px;
	margin: 1px 0 0;
	appearance: none;
	-webkit-appearance: none;
	background: var(--fm-switch-off);
	border: 0;
	border-radius: 9px;
	cursor: pointer;
	transition: background-color .15s;
}

.fm-consent__option input::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 13px;
	height: 13px;
	background: var(--fm-paper);
	border-radius: 50%;
	transition: transform .15s;
}

.fm-consent__option input:checked {
	background: var(--fm-blue);
}

.fm-consent__option input:checked::after {
	transform: translateX(13px);
}

.fm-consent__option input:disabled {
	opacity: .55;
	background: var(--fm-blue);
	cursor: not-allowed;
}

/* ---------- Platzhalter anstelle eines noch nicht geladenen iframes ---------- */

.fm-consent-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	padding: 24px;
	background: var(--fm-tint) center / cover no-repeat;
	border: 1px solid var(--fm-line);
	text-align: center;
	white-space: normal;
	font-size: 13px;
	line-height: 1.55;
	color: var(--fm-text);
}

.fm-consent-placeholder__box {
	max-width: 420px;
	padding: 14px 18px;
	background: var(--fm-veil);
	border-radius: 4px;
}

.fm-consent-placeholder .fm-notice__btn {
	margin-top: 10px;
	padding: 8px 18px;
}

@media (prefers-reduced-motion: reduce) {
	.fm-notice {
		animation: none;
	}
}

/* Beim Drucken keine Hinweis-Karten */
@media print {
	.fm-notices {
		display: none;
	}
}

/* Auf dem Handy nicht beide Karten gleichzeitig: erst die Einwilligung, danach die Erstinformation */
@media (max-width: 600px) {
	.fm-consent:not([hidden]) ~ .fm-erstinfo {
		display: none;
	}
}
