/**
 * Digifom Lead Funnel v3 — theme-isolated frontend styles.
 * Scoped entirely to .dlf-funnel. No color-mix(), no hardcoded orange.
 * Brand colour is injected server-side via inline style on .dlf-funnel.
 */

/* ─────────────────────────────────────────── design tokens
   --dlf-brand and --dlf-brand-hover are set via inline style="" on
   the root element by PHP, so they always match the admin setting
   with zero flash and zero JS dependency.                          */
.dlf-funnel {
	--dlf-brand:       #e8430a; /* fallback only — overridden inline */
	--dlf-brand-hover: #c93a08; /* fallback only */
	--dlf-brand-a14:   rgba(232,67,10,0.14); /* fallback focus ring */
	--dlf-brand-a42:   rgba(232,67,10,0.42); /* fallback hover border */
	--dlf-text:        #181512;
	--dlf-muted:       #6c625b;
	--dlf-line:        #ebe6e2;
	--dlf-bg:          #faf8f6;
	--dlf-soft:        #fff3ef; /* fallback — overridden inline */
	--dlf-white:       #fff;
	--dlf-radius-sm:   12px;
	--dlf-radius-md:   14px;
	--dlf-radius-lg:   18px;
}

/* ─────────────────────────────────────────── local reset */
.dlf-funnel,
.dlf-funnel *,
.dlf-funnel *::before,
.dlf-funnel *::after { box-sizing: border-box; }

.dlf-funnel {
	display: block; width: 100%; max-width: 100%;
	margin: 0; padding: 0;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 16px; line-height: 1.5; font-weight: 400;
	color: var(--dlf-text); text-align: left;
	background: transparent; border: 0;
	float: none; position: relative; overflow: visible;
}

.dlf-funnel h1,.dlf-funnel h2,.dlf-funnel h3,.dlf-funnel h4,
.dlf-funnel p,.dlf-funnel ul,.dlf-funnel ol,.dlf-funnel li,
.dlf-funnel label,.dlf-funnel form,.dlf-funnel section {
	margin: 0; padding: 0; border: 0;
	background: transparent; color: inherit; font: inherit;
	letter-spacing: normal; text-transform: none;
	text-decoration: none; list-style: none;
}

.dlf-funnel button,.dlf-funnel input,.dlf-funnel select,.dlf-funnel textarea {
	appearance: none; -webkit-appearance: none;
	margin: 0; padding: 0; border: 0; border-radius: 0;
	background: transparent; color: inherit; font: inherit;
	line-height: inherit; letter-spacing: normal;
	text-transform: none; text-decoration: none;
	box-shadow: none; outline: none;
	min-height: 0; width: auto; max-width: none;
}
.dlf-funnel button { cursor: pointer; }
.dlf-funnel img,.dlf-funnel svg { display: block; max-width: 100%; height: auto; }
.dlf-funnel [hidden] { display: none !important; }

/* ─────────────────────────────────────────── progress header */
.dlf-funnel .dlf-funnel__top {
	display: flex; justify-content: space-between; align-items: center;
	gap: 12px; margin-bottom: 10px;
	text-transform: uppercase; letter-spacing: 0.11em;
	font-size: 11px; font-weight: 700; color: var(--dlf-muted);
}
.dlf-funnel .dlf-percent {
	letter-spacing: 0; font-size: 13px; font-weight: 700; color: var(--dlf-muted);
}
.dlf-funnel .dlf-progress {
	display: block; height: 5px; background: #efe9e4;
	border-radius: 999px; overflow: hidden; margin-bottom: 16px;
}
.dlf-funnel .dlf-progress span {
	display: block; height: 100%; width: 25%;
	background: var(--dlf-brand); border-radius: 999px;
	transition: width 0.3s ease;
}

/* ─────────────────────────────────────────── card (no border/shadow) */
.dlf-funnel .dlf-card {
	display: block; width: 100%;
	background: transparent; border: none; padding: 0; overflow: visible;
}

/* ─────────────────────────────────────────── step */
.dlf-funnel .dlf-step { display: block; width: 100%; }

.dlf-funnel .dlf-step h2 {
	font-size: clamp(17px, 2.2vw, 21px); line-height: 1.3;
	font-weight: 700; letter-spacing: -0.02em;
	color: var(--dlf-text); margin-bottom: 6px;
}
.dlf-funnel .dlf-sub {
	font-size: 14px; line-height: 1.5; color: var(--dlf-muted); margin-bottom: 18px;
}
.dlf-funnel .dlf-step-note {
	margin: -10px 0 14px; font-size: 13px; font-weight: 600; color: var(--dlf-muted);
}
.dlf-funnel .dlf-req { color: var(--dlf-brand); font-weight: 700; }

/* ─────────────────────────────────────────── radio options (steps 1 & 3) */
.dlf-funnel .dlf-options { display: grid; gap: 10px; }

.dlf-funnel .dlf-option {
	display: flex; align-items: center; gap: 12px;
	width: 100%; border: 1.5px solid var(--dlf-line);
	border-radius: var(--dlf-radius-md);
	padding: 14px 16px; background: var(--dlf-white); cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}
.dlf-funnel .dlf-option:hover {
	border-color: var(--dlf-brand-a42);
}
.dlf-funnel .dlf-option input {
	flex: 0 0 auto; width: 18px; height: 18px;
	border: 2px solid #c8c0b8; border-radius: 50%; background: var(--dlf-white);
	transition: border-color 0.15s ease;
}
.dlf-funnel .dlf-option.is-selected { border-color: var(--dlf-brand); background: var(--dlf-soft); }
.dlf-funnel .dlf-option input:checked { border: 5px solid var(--dlf-brand); background: var(--dlf-white); }
.dlf-funnel .dlf-option strong {
	display: block; font-size: 15px; line-height: 1.3; font-weight: 600; color: var(--dlf-text);
}
.dlf-funnel .dlf-option small {
	display: block; color: var(--dlf-muted); font-size: 13px; line-height: 1.4;
	margin-top: 3px; font-weight: 400;
}

/* ─────────────────────────────────────────── checkbox options (step 2) */
.dlf-funnel .dlf-checkgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.dlf-funnel .dlf-check {
	display: flex; align-items: center; gap: 10px;
	width: 100%; border: 1.5px solid var(--dlf-line);
	border-radius: var(--dlf-radius-md);
	padding: 13px 14px; background: var(--dlf-white); cursor: pointer;
	font-size: 14px; font-weight: 600; line-height: 1.3;
	transition: border-color 0.15s ease, background 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}
.dlf-funnel .dlf-check:hover { border-color: var(--dlf-brand-a42); }
.dlf-funnel .dlf-check input {
	flex: 0 0 auto; width: 18px; height: 18px;
	border: 2px solid #c8c0b8; border-radius: 5px; background: var(--dlf-white);
}
.dlf-funnel .dlf-check.is-selected { border-color: var(--dlf-brand); background: var(--dlf-soft); }
.dlf-funnel .dlf-check input:checked {
	background: var(--dlf-brand); border-color: var(--dlf-brand);
	box-shadow: inset 0 0 0 3px var(--dlf-white);
}

/* ─────────────────────────────────────────── contact grid (step 4) */
.dlf-funnel .dlf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.dlf-funnel .dlf-grid label {
	display: grid; gap: 6px; font-size: 13px; font-weight: 650; color: var(--dlf-text);
}
.dlf-funnel .dlf-grid label > span {
	display: inline-flex; align-items: baseline; gap: 3px;
}
.dlf-funnel .dlf-grid input {
	display: block; width: 100%;
	border: 1.5px solid var(--dlf-line); border-radius: var(--dlf-radius-md);
	padding: 12px 14px;
	font-size: 16px; /* 16px prevents iOS auto-zoom */
	font-weight: 400; line-height: 1.4;
	background: var(--dlf-white); color: var(--dlf-text); min-height: 48px;
	transition: border-color 0.15s ease;
}
.dlf-funnel .dlf-grid input:focus { border-color: var(--dlf-brand); outline: none; }

/* ─────────────────────────────────────────── focus (keyboard nav) */
.dlf-funnel *:focus-visible { outline: none; }
.dlf-funnel input:focus,
.dlf-funnel input:focus-visible { outline: none; box-shadow: none; }
.dlf-funnel .dlf-option:focus-within:not(.is-selected),
.dlf-funnel .dlf-check:focus-within:not(.is-selected) {
	border-color: var(--dlf-brand-a42);
}
.dlf-funnel .dlf-btn:focus-visible {
	outline: 2px solid var(--dlf-brand); outline-offset: 3px;
}

/* ─────────────────────────────────────────── turnstile */
.dlf-funnel .dlf-turnstile {
	display: flex; justify-content: flex-start; margin-top: 18px; min-height: 65px;
}
.dlf-funnel .dlf-turnstile[hidden] { display: none !important; }

/* ─────────────────────────────────────────── action buttons
   Layout: mobile = stacked (primary on top)
           desktop = side by side: Zurück LEFT, Weiter/Submit RIGHT        */
.dlf-funnel .dlf-actions {
	display: flex;
	flex-direction: column-reverse; /* primary on top on mobile */
	gap: 10px;
	margin-top: 20px;
}
.dlf-funnel .dlf-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 100%; min-height: 52px; padding: 14px 20px;
	border-radius: var(--dlf-radius-sm);
	font-size: 15px; font-weight: 700; line-height: 1.2; text-align: center;
	transition: opacity 0.15s ease, transform 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}
.dlf-funnel .dlf-btn:hover:not(:disabled) { opacity: 0.88; transform: translateY(-1px); }
.dlf-funnel .dlf-btn:active:not(:disabled) { transform: translateY(0); }

.dlf-funnel .dlf-btn--primary {
	background: var(--dlf-brand); color: #fff;
	border: none;
	box-shadow: 0 8px 20px var(--dlf-brand-a42);
}
.dlf-funnel .dlf-btn--primary:disabled {
	opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none;
}
.dlf-funnel .dlf-btn--secondary {
	background: var(--dlf-white); color: var(--dlf-text);
	border: 1.5px solid var(--dlf-line);
}
.dlf-funnel .dlf-btn--secondary:hover:not(:disabled) {
	background: var(--dlf-bg); border-color: #d0cac4;
}

/* Desktop: Zurück left, Weiter/Submit right */
@media (min-width: 640px) {
	.dlf-funnel .dlf-actions {
		flex-direction: row;
		align-items: center;
	}
	.dlf-funnel .dlf-actions .dlf-btn--secondary { flex: 0 0 auto; width: auto; min-width: 130px; }
	.dlf-funnel .dlf-actions .dlf-btn--primary   { flex: 1; }
}

/* ─────────────────────────────────────────── footer text */
.dlf-funnel .dlf-privacy {
	margin: 14px 0 0; text-align: center;
	font-size: 12px; line-height: 1.55; color: var(--dlf-muted);
}
.dlf-funnel .dlf-privacy a { color: var(--dlf-brand); text-decoration: underline; text-underline-offset: 2px; }
.dlf-funnel .dlf-privacy a:hover { opacity: 0.8; }
.dlf-funnel .dlf-secure {
	margin: 8px 0 0; text-align: center;
	font-size: 13px; font-weight: 600; color: var(--dlf-muted);
}
.dlf-funnel .dlf-message {
	min-height: 20px; margin-top: 10px;
	color: var(--dlf-brand); font-size: 14px; font-weight: 700; text-align: center;
}

/* ─────────────────────────────────────────── honeypot */
.dlf-funnel .dlf-hp {
	position: absolute; left: -9999px; width: 1px; height: 1px;
	overflow: hidden; opacity: 0; pointer-events: none; tab-index: -1;
}

/* ─────────────────────────────────────────── responsive */
@media (max-width: 1023px) {
	.dlf-funnel .dlf-grid { grid-template-columns: 1fr; }
	.dlf-funnel .dlf-checkgrid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
	.dlf-funnel { font-size: 15px; }
	.dlf-funnel .dlf-step h2 { font-size: 18px; }
	.dlf-funnel .dlf-option { padding: 13px 14px; }
}
@media (max-width: 430px) {
	.dlf-funnel .dlf-option small { display: none; }
}
