/*
 * DC Formulare — strukturelle, marken-neutrale Stile (Verhalten + A11y).
 * Das visuelle Aussehen kommt aus den .wd-cf-*-Klassen des aktiven Themes;
 * hier stehen nur Honeypot-Ausblendung, Fehlerzustände, Screenreader-Utilities.
 */

/* Honeypot: für Menschen unsichtbar; NICHT display:none (manche Bots meiden das). */
.dcf-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Nur für Screenreader. */
.dcf-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Fehler pro Feld (bleibt inline; rebrandbar über das Error-Preset). */
.dcf-field-error {
	display: block;
	margin-top: 0.35rem;
	color: var(--wp--preset--color--error, #b00020);
	font-size: 0.875rem;
	font-weight: 600;
}

.dcf-field [aria-invalid="true"] {
	border-color: var(--wp--preset--color--error, #b00020) !important;
	outline: 2px solid var(--wp--preset--color--error, #b00020);
	outline-offset: 1px;
}

/* Fehler-Zusammenfassung (Fokusziel; bleibt inline, kein Popup). */
.dcf-summary {
	margin-bottom: 1.25rem;
	padding: 1rem 1.25rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--error, #b00020) 45%, #ffffff);
	border-radius: 10px;
	background: color-mix(in srgb, var(--wp--preset--color--error, #b00020) 8%, #ffffff);
	/* Abgedunkeltes Error für sicheren AA-Kontrast auf heller Fläche (bleibt marken-abgeleitet). */
	color: color-mix(in srgb, var(--wp--preset--color--error, #7a0016) 78%, #000000);
}

.dcf-summary-title {
	margin: 0 0 0.5rem;
	font-weight: 700;
}

.dcf-summary ul {
	margin: 0;
	padding-left: 1.25rem;
}

.dcf-summary a {
	color: inherit;
	text-decoration: underline;
}

.dcf-summary:focus {
	outline: 3px solid var(--wp--preset--color--error, #7a0016);
	outline-offset: 2px;
}

.dcf-req {
	color: var(--wp--preset--color--error, #b00020);
}

/* Region-Rechts-Schicht — jede Aussage eine eigene Zeile (kein zusammengeklebter Absatz). */
.dcf-region-us .dcf-region-line {
	display: block;
}

.dcf-region-us .dcf-region-line + .dcf-region-line {
	margin-top: 0.4rem;
}

.dcf-region-us .dcf-do-not-sell {
	font-weight: 600;
	text-decoration: underline;
}

.dcf-region-us .dcf-gpc-ack {
	display: block;
}

/* EU-Opt-in-Häkchen. */
.dcf-consent .dcf-consent-label {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	cursor: pointer;
}

.dcf-consent .dcf-consent-check {
	flex: 0 0 auto;
	width: 1.15rem;
	height: 1.15rem;
	min-width: 24px;
	min-height: 24px;
	margin-top: 0.1rem;
	/* Häkchen in CI-Farbe statt Browser-Blau (rebrandbar über das Primary-Preset). */
	accent-color: var(--wp--preset--color--primary, #800020);
}

.dcf-consent .dcf-consent-text {
	flex: 1 1 auto;
}

.dcf-consent .dcf-consent-privacy {
	display: inline-block;
	margin-top: 0.35rem;
}

.dcf-consent .dcf-consent-check[aria-invalid="true"] {
	outline: 2px solid #b00020;
	outline-offset: 2px;
}

/* ============================================================================
 * Status-Meldung als Karte (Info/Erfolg/Fehler).
 * Ohne JS: ruhige Inline-Karte (Rückfall). Mit JS: von dc-form.js zum Modal
 * befördert (siehe Overlay-Block unten). Marken-/CI-neutral: Zustandsfarbe nur
 * über Preset-Vars mit Fallback; Karte selbst bleibt hell/ruhig.
 * ==========================================================================*/
.dcf-notice {
	--dcf-accent: var(--wp--preset--color--secondary, #003366); /* Info (Default) */
	position: relative;
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	margin: 0 0 1.25rem;
	padding: 1.5rem;
	background: #ffffff;
	border: 1px solid color-mix(in srgb, var(--dcf-accent) 22%, #e3e3e3);
	border-radius: 12px;
	box-shadow: 0 6px 22px rgba(20, 20, 25, 0.08);
	text-align: left;
	overflow: hidden;
}

.dcf-notice[data-dcf-notice="success"] {
	--dcf-accent: var(--wp--preset--color--success, #2d7d46);
}

.dcf-notice[data-dcf-notice="error"] {
	--dcf-accent: var(--wp--preset--color--error, #c72121);
}

.dcf-notice[data-dcf-notice="info"] {
	--dcf-accent: var(--wp--preset--color--secondary, #003366);
}

/* Feine Akzent-Oberlinie (einziger kräftiger Zustands-Farbträger neben dem Medaillon). */
.dcf-notice::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 4px;
	background: var(--dcf-accent);
}

.dcf-notice__medallion {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	color: var(--dcf-accent);
	background: color-mix(in srgb, var(--dcf-accent) 14%, #ffffff);
}

.dcf-notice__medallion svg {
	display: block;
	width: 1.5rem;
	height: 1.5rem;
}

.dcf-notice__body {
	flex: 1 1 auto;
	min-width: 0;
}

.dcf-notice__eyebrow {
	margin: 0 0 0.4rem;
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--text-secondary, #555555);
}

.dcf-notice__title {
	margin: 0 0 0.45rem;
	font-family: var(--wp--preset--font-family--serif, Georgia, "Times New Roman", serif);
	font-size: 1.6rem;
	line-height: 1.2;
	/* Theme-Serifen (z. B. EB Garamond) liefern oft NUR ein reguläres Face (400).
	   Ein höheres Gewicht (600) erzwang sonst synthetischen Fettdruck (faux-bold) —
	   sichtbar „falsch" und bei font-synthesis:none ein Fallback auf eine Fremd-Serife.
	   400 rendert das echte Serifen-Face; generischer Serifen-Fallback bleibt erhalten. */
	font-weight: 400;
	color: var(--wp--preset--color--ink, #1a1a1a);
}

.dcf-notice__text {
	margin: 0;
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	font-size: 1rem;
	line-height: 1.6;
	color: var(--wp--preset--color--text-secondary, #4a4a4a);
}

.dcf-notice:focus-visible {
	outline: 3px solid var(--dcf-accent);
	outline-offset: 3px;
}

/* --- Schließen-Elemente: existieren nur im Modal (von JS erzeugt). --- */
.dcf-notice__close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--text-secondary, #555555);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.dcf-notice__close:hover {
	background: rgba(20, 20, 25, 0.07);
}

.dcf-notice__close:focus-visible {
	outline: 3px solid var(--dcf-accent);
	outline-offset: 2px;
}

.dcf-notice__dismiss {
	display: inline-block;
	margin-top: 1.4rem;
	padding: 0.7rem 1.6rem;
	min-height: 44px;
	border: 0;
	border-radius: 6px;
	background: var(--dcf-accent);
	color: #ffffff;
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

.dcf-notice__dismiss:hover {
	filter: brightness(0.94);
}

.dcf-notice__dismiss:focus-visible {
	outline: 3px solid var(--dcf-accent);
	outline-offset: 2px;
}

/* ============================================================================
 * Modal-Overlay (nur mit JS; dc-form.js befördert die Karte hierher).
 * ==========================================================================*/
.dcf-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	background: rgba(18, 18, 24, 0.45);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.28s ease;
}

.dcf-modal-overlay.is-visible {
	opacity: 1;
}

.dcf-modal-overlay .dcf-notice {
	width: 100%;
	max-width: 30rem;
	margin: 0;
	padding: 2rem 2rem 1.75rem;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
	transform: translateY(8px) scale(0.98);
	transition: transform 0.28s ease;
}

.dcf-modal-overlay.is-visible .dcf-notice {
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.dcf-modal-overlay,
	.dcf-modal-overlay .dcf-notice {
		transition: none;
	}
}

/* Double-Opt-In OTP — Intro bleibt inline (kein Popup), als ruhige Info-Karte. */
.dcf-otp-intro {
	display: block;
	margin-bottom: 1.25rem;
	padding: 1rem 1.25rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--secondary, #003366) 22%, #e3e3e3);
	border-radius: 10px;
	background: color-mix(in srgb, var(--wp--preset--color--secondary, #003366) 7%, #ffffff);
	color: var(--wp--preset--color--ink, #23303e);
	font-weight: 600;
}

.dcf-otp-input {
	max-width: 12rem;
	letter-spacing: 0.4em;
	font-variant-numeric: tabular-nums;
}

/* ============================================================================
 * Sende-Ladezustand (nur mit JS; dc-form.js setzt aria-busy + disabled beim
 * Absenden). Ohne JS bleibt der Button unverändert.
 * ==========================================================================*/
.dcf-form .wd-cf-submit[aria-busy="true"] {
	cursor: progress;
	opacity: 0.85;
}

/* Kleiner Spinner vor dem Text (marken-neutral: nutzt currentColor). */
.dcf-form .wd-cf-submit[aria-busy="true"] .wd-cf-submit-text::before {
	content: "";
	display: inline-block;
	width: 0.9em;
	height: 0.9em;
	margin-right: 0.5em;
	vertical-align: -0.1em;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: dcf-spin 0.7s linear infinite;
}

/* Der Pfeil entfällt im Ladezustand (Spinner übernimmt die Bewegung). */
.dcf-form .wd-cf-submit[aria-busy="true"] .wd-cf-submit-arrow {
	display: none;
}

@keyframes dcf-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.dcf-form .wd-cf-submit[aria-busy="true"] .wd-cf-submit-text::before {
		animation: none;
	}
}
