/**
 * Nendosplit DSGVO: Frontend-Styles.
 */

:root {
	--ndg-accent: #0a8a8e;
	--ndg-accent-text: #ffffff;
	--ndg-bg: #ffffff;
	--ndg-text: #1f2933;
	--ndg-muted: #5a6b74;
	--ndg-border: #e2e8ea;
	--ndg-overlay: rgba(15, 32, 36, 0.55);
	--ndg-radius: 16px;
	--ndg-font-size: 15px;
}

html.ndg-open {
	overflow: hidden;
}

.ndg-root {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--ndg-font-size);
	line-height: 1.55;
	color: var(--ndg-text);
	-webkit-font-smoothing: antialiased;
}

.ndg-root[hidden] {
	display: none;
}

.ndg-overlay {
	position: absolute;
	inset: 0;
	background: var(--ndg-overlay);
	backdrop-filter: blur(2px);
	animation: ndg-fade 0.25s ease;
}

@keyframes ndg-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes ndg-up {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------
 * Banner-Container
 * ------------------------------------------------------------ */

.ndg-banner {
	position: relative;
	width: min(560px, calc(100vw - 32px));
	max-height: min(86vh, 760px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--ndg-bg);
	border-radius: var(--ndg-radius);
	box-shadow: 0 24px 60px rgba(12, 27, 31, 0.24), 0 2px 8px rgba(12, 27, 31, 0.08);
	padding: 28px;
	animation: ndg-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.ndg-layout-box_left .ndg-banner,
.ndg-layout-box_right .ndg-banner {
	position: absolute;
	bottom: 20px;
	width: min(430px, calc(100vw - 32px));
}

.ndg-layout-box_left .ndg-banner { left: 20px; }
.ndg-layout-box_right .ndg-banner { right: 20px; }

.ndg-layout-bar_bottom .ndg-banner {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: none;
	border-radius: var(--ndg-radius) var(--ndg-radius) 0 0;
}

.ndg-layout-bar_bottom .ndg-view--intro {
	max-width: 1100px;
	margin: 0 auto;
}

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

.ndg-banner__logo {
	margin-bottom: 14px;
}

.ndg-banner__logo img,
.ndg-logo {
	max-height: 40px;
	width: auto;
	display: block;
}

.ndg-banner__title {
	margin: 0 0 10px;
	font-size: 1.35em;
	line-height: 1.25;
	font-weight: 700;
	color: var(--ndg-text);
}

.ndg-banner__text {
	margin: 0 0 14px;
	color: var(--ndg-muted);
}

.ndg-banner__text p {
	margin: 0 0 10px;
}

.ndg-banner__text--small {
	font-size: 0.94em;
}

.ndg-banner__age {
	margin: 0 0 16px;
	font-size: 0.86em;
	color: var(--ndg-muted);
	padding: 10px 12px;
	background: color-mix(in srgb, var(--ndg-accent) 7%, transparent);
	border-radius: calc(var(--ndg-radius) / 2);
}

/* ---------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------ */

.ndg-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 18px 0 14px;
}

.ndg-btn {
	flex: 1 1 auto;
	min-width: 150px;
	appearance: none;
	border: 2px solid transparent;
	border-radius: calc(var(--ndg-radius) / 1.6);
	padding: 13px 18px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
	text-align: center;
}

.ndg-btn:active {
	transform: translateY(1px);
}

.ndg-btn:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--ndg-accent) 45%, transparent);
	outline-offset: 2px;
}

/* Akzeptieren und Ablehnen sind bewusst gleichwertig gestaltet. */
.ndg-btn--primary {
	background: var(--ndg-accent);
	color: var(--ndg-accent-text);
	border-color: var(--ndg-accent);
}

.ndg-btn--primary:hover {
	background: color-mix(in srgb, var(--ndg-accent) 86%, #000);
	border-color: color-mix(in srgb, var(--ndg-accent) 86%, #000);
}

.ndg-btn--ghost {
	background: transparent;
	color: var(--ndg-accent);
}

.ndg-btn--ghost:hover {
	background: color-mix(in srgb, var(--ndg-accent) 8%, transparent);
	border-color: var(--ndg-accent);
}

.ndg-btn--link {
	flex: 0 0 auto;
	min-width: 0;
	background: none;
	border: none;
	color: var(--ndg-muted);
	text-decoration: underline;
	padding: 13px 8px;
	font-weight: 500;
}

.ndg-btn--link:hover {
	color: var(--ndg-text);
}

.ndg-legal {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	padding-top: 12px;
	border-top: 1px solid var(--ndg-border);
	font-size: 0.86em;
}

.ndg-legal a {
	color: var(--ndg-muted);
	text-decoration: underline;
}

.ndg-legal a:hover {
	color: var(--ndg-accent);
}

/* ---------------------------------------------------------------
 * Einstellungsebene
 * ------------------------------------------------------------ */

.ndg-settings__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.ndg-back {
	appearance: none;
	border: 1px solid var(--ndg-border);
	background: transparent;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--ndg-text);
	flex: 0 0 auto;
}

.ndg-back:hover {
	border-color: var(--ndg-accent);
	color: var(--ndg-accent);
}

.ndg-settings__head .ndg-banner__title {
	margin: 0;
	font-size: 1.15em;
}

.ndg-categories {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 16px 0;
}

.ndg-cat {
	border: 1px solid var(--ndg-border);
	border-radius: calc(var(--ndg-radius) / 1.4);
	overflow: hidden;
	transition: border-color 0.15s ease;
}

.ndg-cat.is-open {
	border-color: color-mix(in srgb, var(--ndg-accent) 40%, var(--ndg-border));
}

.ndg-cat__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px 6px 4px;
}

.ndg-cat__toggle {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: none;
	padding: 10px 8px;
	font: inherit;
	font-weight: 600;
	color: var(--ndg-text);
	cursor: pointer;
	text-align: left;
}

.ndg-chevron {
	transition: transform 0.2s ease;
	flex: 0 0 auto;
	color: var(--ndg-muted);
}

.ndg-cat.is-open .ndg-chevron {
	transform: rotate(180deg);
}

.ndg-cat__count {
	font-size: 0.76em;
	font-weight: 600;
	color: var(--ndg-muted);
	background: color-mix(in srgb, var(--ndg-border) 55%, transparent);
	border-radius: 999px;
	padding: 1px 8px;
}

.ndg-cat__body {
	padding: 0 16px 16px;
}

.ndg-cat__desc {
	margin: 0 0 12px;
	font-size: 0.9em;
	color: var(--ndg-muted);
}

/* Schalter */

.ndg-switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	flex: 0 0 auto;
}

.ndg-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.ndg-switch__track {
	display: block;
	width: 46px;
	height: 26px;
	border-radius: 999px;
	background: #cbd5d8;
	transition: background-color 0.2s ease;
	position: relative;
}

.ndg-switch__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.ndg-switch input:checked + .ndg-switch__track {
	background: var(--ndg-accent);
}

.ndg-switch input:checked + .ndg-switch__track .ndg-switch__thumb {
	transform: translateX(20px);
}

.ndg-switch input:focus-visible + .ndg-switch__track {
	outline: 3px solid color-mix(in srgb, var(--ndg-accent) 45%, transparent);
	outline-offset: 2px;
}

.ndg-switch.is-locked {
	cursor: not-allowed;
	opacity: 0.65;
}

.ndg-switch--small .ndg-switch__track {
	width: 38px;
	height: 22px;
}

.ndg-switch--small .ndg-switch__thumb {
	width: 16px;
	height: 16px;
}

.ndg-switch--small input:checked + .ndg-switch__track .ndg-switch__thumb {
	transform: translateX(16px);
}

/* Dienste */

.ndg-services {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
}

.ndg-service {
	border: 1px solid var(--ndg-border);
	border-radius: 10px;
	padding: 10px 12px;
	background: color-mix(in srgb, var(--ndg-border) 18%, transparent);
}

.ndg-service__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-size: 0.94em;
}

.ndg-service__meta {
	margin: 8px 0 0;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2px 10px;
	font-size: 0.8em;
	color: var(--ndg-muted);
}

.ndg-service__meta dt {
	font-weight: 600;
}

.ndg-service__meta dd {
	margin: 0;
}

/* Tabellen */

.ndg-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--ndg-border);
	border-radius: 10px;
}

.ndg-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.82em;
}

.ndg-table th,
.ndg-table td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid var(--ndg-border);
	vertical-align: top;
}

.ndg-table th {
	background: color-mix(in srgb, var(--ndg-border) 35%, transparent);
	font-weight: 600;
	white-space: nowrap;
}

.ndg-table tr:last-child td {
	border-bottom: none;
}

.ndg-table code {
	font-size: 0.94em;
	word-break: break-all;
}

.ndg-host {
	display: block;
	font-size: 0.9em;
	color: var(--ndg-muted);
}

/* ---------------------------------------------------------------
 * Widerruf-Button
 * ------------------------------------------------------------ */

.ndg-badge {
	position: fixed;
	bottom: 16px;
	z-index: 999990;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border: 1px solid var(--ndg-border);
	border-radius: 999px;
	background: var(--ndg-bg);
	color: var(--ndg-text);
	font: inherit;
	font-size: 0.84em;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(12, 27, 31, 0.14);
	transition: transform 0.15s ease, color 0.15s ease;
}

.ndg-badge:hover {
	color: var(--ndg-accent);
	transform: translateY(-2px);
}

.ndg-badge--bottom-left { left: 16px; }
.ndg-badge--bottom-right { right: 16px; }

/* ---------------------------------------------------------------
 * Platzhalter fuer blockierte Inhalte
 * ------------------------------------------------------------ */

.ndg-blocked {
	position: relative;
	border: 1px solid var(--ndg-border);
	border-radius: var(--ndg-radius);
	background: color-mix(in srgb, var(--ndg-border) 22%, #fff);
	overflow: hidden;
	min-height: 220px;
	display: flex;
	color: var(--ndg-text);
	font-size: var(--ndg-font-size);
}

.ndg-blocked__inner {
	position: relative;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ndg-blocked__thumb {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	filter: blur(6px) saturate(0.7);
	opacity: 0.4;
}

.ndg-blocked__body {
	position: relative;
	padding: 24px;
	text-align: center;
	max-width: 480px;
}

.ndg-blocked__badge {
	display: inline-block;
	font-size: 0.72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ndg-accent);
	background: color-mix(in srgb, var(--ndg-accent) 12%, transparent);
	border-radius: 999px;
	padding: 3px 10px;
	margin-bottom: 8px;
}

.ndg-blocked__title {
	margin: 0 0 6px;
	font-size: 1.05em;
	font-weight: 700;
}

.ndg-blocked__text,
.ndg-blocked__hint,
.ndg-blocked__provider,
.ndg-blocked__links {
	margin: 0 0 8px;
	font-size: 0.86em;
	color: var(--ndg-muted);
}

.ndg-blocked__provider {
	font-size: 0.76em;
	opacity: 0.8;
}

.ndg-blocked__btn {
	appearance: none;
	border: none;
	border-radius: calc(var(--ndg-radius) / 1.6);
	background: var(--ndg-accent);
	color: var(--ndg-accent-text);
	font: inherit;
	font-weight: 600;
	padding: 11px 22px;
	cursor: pointer;
	margin: 6px 0;
}

.ndg-blocked__btn:hover {
	background: color-mix(in srgb, var(--ndg-accent) 86%, #000);
}

.ndg-blocked__always {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 0.8em;
	color: var(--ndg-muted);
	cursor: pointer;
	margin-bottom: 6px;
}

.ndg-embed {
	position: relative;
}

/* ---------------------------------------------------------------
 * Shortcodes
 * ------------------------------------------------------------ */

.ndg-inline-btn {
	appearance: none;
	border: 2px solid var(--ndg-accent);
	background: transparent;
	color: var(--ndg-accent);
	border-radius: 10px;
	padding: 9px 16px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.ndg-inline-btn:hover {
	background: var(--ndg-accent);
	color: var(--ndg-accent-text);
}

.ndg-inline-btn--ghost {
	border-color: var(--ndg-border);
	color: var(--ndg-muted);
}

.ndg-inline-btn--ghost:hover {
	background: var(--ndg-muted);
	border-color: var(--ndg-muted);
	color: #fff;
}

.ndg-consent-status {
	border: 1px solid var(--ndg-border);
	border-radius: var(--ndg-radius);
	padding: 16px;
	margin: 20px 0;
}

.ndg-cookie-list h3 {
	margin-top: 26px;
}

/* Formular */

.ndg-form-wrap {
	max-width: 640px;
}

.ndg-form__row {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin-bottom: 16px;
}

.ndg-form__row--check {
	flex-direction: row;
}

.ndg-form label {
	font-weight: 600;
}

.ndg-form__row--check label {
	font-weight: 400;
	display: flex;
	gap: 8px;
	align-items: flex-start;
}

.ndg-form input[type='email'],
.ndg-form input[type='text'],
.ndg-form select,
.ndg-form textarea {
	width: 100%;
	border: 1px solid var(--ndg-border);
	border-radius: 10px;
	padding: 11px 12px;
	font: inherit;
	background: #fff;
	color: var(--ndg-text);
}

.ndg-form input:focus,
.ndg-form select:focus,
.ndg-form textarea:focus {
	outline: none;
	border-color: var(--ndg-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ndg-accent) 18%, transparent);
}

.ndg-form__hint {
	font-size: 0.84em;
	color: var(--ndg-muted);
	font-weight: 400;
}

.ndg-form__submit {
	appearance: none;
	border: none;
	background: var(--ndg-accent);
	color: var(--ndg-accent-text);
	border-radius: 10px;
	padding: 12px 24px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.ndg-notice {
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 18px;
	border-left: 4px solid var(--ndg-accent);
	background: color-mix(in srgb, var(--ndg-accent) 8%, transparent);
}

.ndg-notice--error {
	border-left-color: #c0392b;
	background: rgba(192, 57, 43, 0.08);
}

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

@media (max-width: 600px) {
	.ndg-root {
		align-items: flex-end;
	}

	.ndg-banner,
	.ndg-layout-box_left .ndg-banner,
	.ndg-layout-box_right .ndg-banner {
		position: relative;
		left: auto;
		right: auto;
		bottom: auto;
		width: 100%;
		max-width: none;
		max-height: 92vh;
		border-radius: var(--ndg-radius) var(--ndg-radius) 0 0;
		padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
	}

	.ndg-actions {
		flex-direction: column;
		gap: 8px;
	}

	.ndg-btn {
		width: 100%;
		min-width: 0;
	}

	.ndg-badge__label {
		display: none;
	}

	.ndg-badge {
		padding: 12px;
		bottom: 76px;
	}

	.ndg-service__meta {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ndg-banner,
	.ndg-overlay {
		animation: none;
	}

	.ndg-switch__thumb,
	.ndg-chevron {
		transition: none;
	}
}

/* Barrierefreiheit */

.ndg-root .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
