/**
 * Geteilte Beratungs-Hero-Shell: eingebettet auf der Startseite, als Dialog
 * auf Unterseiten. Copy und Daniel-Foto bleiben getrennte, ruhig verbundene
 * Zonen; Zwischen-Viewports bekommen eine eigene, unverkrampfte Komposition.
 */

.fyh-bwd {
	color: var(--wp--preset--color--ink);
}

.fyh-bwd__anchor {
	display: block;
	width: 0;
	height: 0;
	scroll-margin-top: 5rem;
}

dialog.fyh-bwd {
	width: min( 94vw, 1040px );
	height: min( 90dvh, 43rem );
	max-height: none;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: var(--wp--custom--radius--lg, 28px);
	background: var(--wp--preset--color--surface);
	box-shadow: 0 40px 120px -40px color-mix( in srgb, var(--wp--preset--color--ink) 55%, transparent );
}

dialog.fyh-bwd[open] {
	display: flex;
}

dialog.fyh-bwd::backdrop {
	background: color-mix( in srgb, var(--wp--preset--color--ink) 58%, transparent );
	-webkit-backdrop-filter: blur( 6px );
	backdrop-filter: blur( 6px );
}

.fyh-bwd__shell {
	display: grid;
	grid-template-columns: minmax( 20rem, .9fr ) minmax( 0, 1.1fr );
	width: 100%;
	min-height: 0;
	flex: 1;
}

.fyh-bwd--embedded .fyh-bwd__shell {
	grid-template-columns: minmax( 20rem, .82fr ) minmax( 0, 1.18fr );
	width: min( 100%, 1248px );
	height: clamp( 38.75rem, 42.5vw, 40rem );
	min-height: 0;
	margin-inline: auto;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 26px;
	background: var(--wp--preset--color--base);
	box-shadow: 0 30px 80px -54px color-mix( in srgb, var(--wp--preset--color--ink) 42%, transparent );
}

.fyh-bwd__intro {
	display: flex;
	position: relative;
	flex-direction: column;
	padding: 0;
	overflow: hidden;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--on-dark);
}

.fyh-bwd__introcopy {
	position: relative;
	z-index: 2;
	padding: clamp( 1.6rem, 3vw, 2.35rem );
	border-bottom-right-radius: clamp( 1.75rem, 3vw, 2.25rem );
	background: var(--wp--preset--color--ink);
	box-shadow: 0 24px 48px -36px rgba( 0, 0, 0, .86 );
}

.fyh-bwd--embedded .fyh-bwd__introcopy {
	display: flex;
	height: auto;
	flex: 0 0 auto;
	flex-direction: column;
	justify-content: flex-start;
	min-height: 0;
	padding: clamp( 1.7rem, 2.6vw, 2.25rem );
	border-bottom-right-radius: clamp( 2rem, 3.4vw, 2.75rem );
	background:
		radial-gradient( circle at 100% 0%, rgba( 255, 255, 255, .07 ), transparent 42% ),
		var(--wp--preset--color--ink);
}

.fyh-bwd--embedded .fyh-bwd__heading {
	max-width: 15ch;
	font-size: clamp( 2rem, 2.65vw, 2.4rem );
}

.fyh-bwd--embedded .fyh-bwd__text {
	font-size: .88rem;
	line-height: 1.52;
}

.fyh-bwd__eyebrow,
.fyh-bwd__kicker {
	margin: 0;
	font-size: .72rem;
	font-weight: 760;
	letter-spacing: .18em;
	text-transform: uppercase;
}

.fyh-bwd__eyebrow {
	color: var(--wp--preset--color--on-dark-soft);
}

.fyh-bwd__heading {
	max-width: 15ch;
	margin: .9rem 0 0;
	text-wrap: balance;
	color: var(--wp--preset--color--on-dark);
	font-size: clamp( 1.85rem, 3vw, 2.45rem );
	font-weight: 800;
	letter-spacing: -.035em;
	line-height: 1.06;
}

.fyh-bwd__text {
	max-width: 33ch;
	margin: 1rem 0 0;
	color: var(--wp--preset--color--on-dark-soft);
	font-size: .92rem;
	line-height: 1.58;
}

.fyh-bwd__trust {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: .55rem 1rem;
	margin: 1.15rem 0 0;
	padding: 0;
	list-style: none;
}

.fyh-bwd__trust li {
	position: relative;
	padding-left: 1.35rem;
	color: var(--wp--preset--color--on-dark-soft);
	font-size: .8rem;
	line-height: 1.4;
}

.fyh-bwd__trust li::before {
	position: absolute;
	top: .45em;
	left: .15rem;
	width: 5px;
	height: 5px;
	border-radius: var(--wp--custom--radius--pill, 9999px);
	background: var(--wp--preset--color--on-dark);
	content: '';
}

.fyh-bwd__portraitvisual {
	position: relative;
	z-index: 1;
	flex: 1 1 auto;
	min-height: clamp( 17rem, 25vw, 20rem );
	margin-top: -1.75rem;
	isolation: isolate;
	background: var(--fyh-bwd-img) center 38% / cover no-repeat var(--wp--preset--color--ink);
}

.fyh-bwd--embedded .fyh-bwd__portraitvisual {
	min-height: clamp( 18rem, 22vw, 20rem );
	background-position: center 42%;
}

.fyh-bwd__portraitvisual::before {
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(
			180deg,
			rgba( 26, 36, 52, .72 ) 0%,
			rgba( 26, 36, 52, .4 ) 8%,
			rgba( 26, 36, 52, .12 ) 17%,
			transparent 30%
		),
		linear-gradient( 180deg, transparent 48%, rgba( 18, 27, 40, .82 ) 100% );
	content: '';
}

.fyh-bwd__portraitfoot {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2;
	padding: 1.35rem clamp( 1.4rem, 3vw, 2.35rem );
}

.fyh-bwd__person {
	display: flex;
	position: relative;
	flex-direction: column;
	gap: .1rem;
	margin: 0;
	filter: var(--wp--custom--glow--soft);
}

.fyh-bwd__person strong {
	font-size: .9rem;
}

.fyh-bwd__person span {
	color: var(--wp--preset--color--on-dark-soft);
	font-size: .75rem;
}

.fyh-bwd__actions {
	display: flex;
	flex-wrap: wrap;
	gap: .65rem;
	position: relative;
	margin-top: .8rem;
	padding-top: 0;
}

.fyh-bwd__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	gap: .55rem;
	padding: .62rem .9rem;
	border-radius: var(--wp--custom--button--radius, 8px);
	font: inherit;
	font-size: .9rem;
	font-weight: 720;
	text-decoration: none;
	cursor: pointer;
	transition: transform .18s ease, background .18s ease;
}

.fyh-bwd__action svg {
	width: 18px;
	height: 18px;
}

.fyh-bwd__action:hover {
	transform: translateY( -1px );
}

.fyh-bwd__action:focus-visible,
.fyh-bwd__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.fyh-bwd__action--light {
	border: 1px solid var(--wp--preset--color--base);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
}

.fyh-bwd__action--ghost {
	border: 1px solid color-mix( in srgb, var(--wp--preset--color--base) 35%, transparent );
	background: color-mix( in srgb, var(--wp--preset--color--base) 8%, transparent );
	color: var(--wp--preset--color--on-dark);
}

.fyh-bwd__action--ghost:hover {
	background: color-mix( in srgb, var(--wp--preset--color--base) 16%, transparent );
}

.fyh-bwd__main {
	display: flex;
	min-width: 0;
	min-height: 0;
	flex-direction: column;
	overflow: auto;
	scrollbar-gutter: stable;
	background: var(--wp--preset--color--base);
}

.fyh-bwd--embedded .fyh-bwd__main {
	height: 100%;
	overflow: hidden;
}

.fyh-bwd--embedded .fyh-bwd__mode:not([hidden]) {
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
}

.fyh-bwd__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.35rem 1.6rem 0;
}

.fyh-bwd__kicker {
	color: var(--wp--preset--color--muted);
}

.fyh-bwd__title {
	margin: .25rem 0 0;
	text-wrap: balance;
	color: var(--wp--preset--color--ink);
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: -.01em;
}

.fyh-bwd__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	padding: 0;
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: var(--wp--custom--radius--pill, 9999px);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	cursor: pointer;
	transition: background .18s ease;
}

.fyh-bwd__close:hover {
	background: var(--wp--preset--color--hairline);
}

.fyh-bwd__close svg {
	width: 16px;
	height: 16px;
}

.fyh-bwd__modes {
	position: relative;
	display: inline-flex;
	align-self: flex-start;
	gap: .25rem;
	margin: 1rem 1.6rem 0;
	padding: .25rem;
	border: 0;
	border-radius: calc( var(--wp--custom--button--radius, 8px) + 2px );
	background: var(--wp--preset--color--surface);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--hairline);
}

/* Gleitender Indikator: JS misst den aktiven Tab (--fyh-tab-x/-w) und setzt
   has-indicator — ohne JS bleibt der is-active-Pill-Fallback unten stehen. */
.fyh-bwd__modes::before {
	content: "";
	position: absolute;
	top: .25rem;
	bottom: .25rem;
	left: 0;
	width: var(--fyh-tab-w, 0px);
	border-radius: var(--wp--custom--button--radius, 8px);
	background: var(--wp--preset--color--base);
	box-shadow: 0 1px 2px rgba( 15, 42, 67, .12 ), inset 0 0 0 1px color-mix( in srgb, var(--wp--preset--color--ink) 8%, transparent );
	opacity: 0;
	transform: translateX( var(--fyh-tab-x, 0px) );
	transition: transform .38s cubic-bezier( .3, 1.25, .4, 1 ), width .38s cubic-bezier( .3, 1.25, .4, 1 );
	pointer-events: none;
}

.fyh-bwd__modes.has-indicator::before {
	opacity: 1;
}

.fyh-bwd__modes button {
	position: relative;
	z-index: 1;
	min-height: 40px;
	padding: .55rem .8rem;
	border: 0;
	border-radius: var(--wp--custom--button--radius, 8px);
	background: transparent;
	color: var(--wp--preset--color--muted);
	font: inherit;
	font-size: .85rem;
	font-weight: 600;
	cursor: pointer;
	transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

@media (hover: hover) {
	.fyh-bwd__modes button:not(.is-active):hover {
		color: var(--wp--preset--color--ink);
		background: color-mix( in srgb, var(--wp--preset--color--ink) 5%, transparent );
	}
}

.fyh-bwd__modes button.is-active {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
	box-shadow: 0 1px 2px rgba( 15, 42, 67, .12 ), inset 0 0 0 1px color-mix( in srgb, var(--wp--preset--color--ink) 8%, transparent );
}

.fyh-bwd__modes.has-indicator button.is-active {
	background: transparent;
	box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
	.fyh-bwd__modes::before {
		transition: none;
	}
}

.fyh-bwd__modes button:focus-visible {
	outline: 2px solid var(--wp--preset--color--ink);
	outline-offset: 2px;
}

.fyh-bwd__mode[hidden] {
	display: none;
}

.fyh-bwd__mode:not([hidden]) {
	display: flex;
	min-height: 0;
	flex: 1 1 auto;
}

@media ( max-width: 520px ) {
	.fyh-bwd__modes {
		display: grid;
		width: calc( 100% - 2rem );
		grid-template-columns: 1fr 1fr;
		margin-inline: 1rem;
	}
}

/* Der Wizard in der Dialog-Schale: randlos, Shell traegt die Karte. */
.fyh-bwd .fyh-wiz {
	display: flex;
	width: 100%;
	max-width: none;
	min-height: 0;
	flex: 1 1 auto;
	flex-direction: column;
	margin: 0;
	padding: clamp( 1.15rem, 2.2vw, 1.6rem );
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.fyh-bwd .fyh-wiz__stage {
	min-height: 13rem;
	flex: 1 1 auto;
}

.fyh-bwd .fyh-wiz__nav {
	margin-top: auto;
}

/* Die primäre Vor-/Zurück-Navigation bleibt bei langen Wizard-Schritten im
   sichtbaren Dialogbereich, statt unterhalb des Scrollports zu verschwinden. */
.fyh-bwd--dialog .fyh-wiz__nav {
	position: sticky;
	bottom: 0;
	z-index: 2;
	padding-bottom: 1rem;
	background: var(--wp--preset--color--base);
	box-shadow: 0 -12px 18px -18px color-mix( in srgb, var(--wp--preset--color--ink) 35%, transparent );
}

/* Rueckruf-Block im Dialog: dieselbe Form-/Submit-Seam, nur ohne seine
   seitenbreite Sektion und das zweite Bildpanel. */
.fyh-bwd .fyh-callback {
	display: flex;
	width: 100%;
	min-height: 0;
	flex: 1 1 auto;
	padding: 0;
	background: transparent;
}

.fyh-bwd .fyh-callback__grid {
	display: block;
	width: 100%;
}

.fyh-bwd .fyh-callback__panel,
.fyh-bwd .fyh-callback__cardhead {
	display: none;
}

.fyh-bwd .fyh-callback__card {
	display: flex;
	min-height: 100%;
	flex-direction: column;
	padding: 1.25rem 1.4rem 1.4rem;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.fyh-bwd .fyh-callback__fields {
	margin-top: 1rem;
}

/* Zwischenstufe: Die rechte Formularspalte darf nicht auf 380–460px
   zusammengedrückt werden. Der persönliche Einstieg bildet eine kompakte,
   horizontale Kopfzeile; der Wizard nutzt darunter die volle Kartenbreite. */
@media ( min-width: 761px ) and ( max-width: 900px ) {
	.fyh-bwd--embedded .fyh-bwd__shell {
		grid-template-columns: minmax( 0, 1fr );
		height: auto;
		min-height: 0;
		border-radius: 24px;
	}

	.fyh-bwd--embedded .fyh-bwd__intro {
		--fyh-bwd-photo-underlap: clamp( 2rem, 4vw, 2.75rem );

		display: grid;
		grid-template-columns: minmax( 0, 1.08fr ) minmax( 17rem, .92fr );
		min-height: clamp( 19rem, 34vw, 21rem );
	}

	.fyh-bwd--embedded .fyh-bwd__introcopy {
		min-height: 0;
		padding: clamp( 1.75rem, 5vw, 2.75rem );
		border-top-right-radius: clamp( 2.1rem, 4vw, 3rem );
		border-bottom-right-radius: clamp( 1.6rem, 3vw, 2.25rem );
	}

	.fyh-bwd--embedded .fyh-bwd__portraitvisual {
		min-height: 100%;
		margin-top: 0;
		margin-left: calc( -1 * var(--fyh-bwd-photo-underlap) );
		background-position: center 36%;
	}

	/* Nur das dekorative Foto darf die gerundete Navy-Kante unterfangen.
	   Name und Kontaktaktionen bleiben rechts davon in einer geschuetzten Zone. */
	.fyh-bwd--embedded .fyh-bwd__portraitfoot {
		padding-left: calc( clamp( 1.4rem, 3vw, 2.35rem ) + var(--fyh-bwd-photo-underlap) );
	}

	.fyh-bwd--embedded .fyh-bwd__main {
		height: auto;
		overflow: visible;
		border-top: 1px solid var(--wp--preset--color--hairline);
	}
}

@media ( max-width: 760px ) {
	dialog.fyh-bwd {
		width: min( 94vw, 620px );
		overflow: auto;
	}

	.fyh-bwd__shell {
		position: relative;
		grid-template-columns: minmax( 0, 1fr );
		min-height: 100%;
		flex: 0 0 auto;
	}

	.fyh-bwd--embedded .fyh-bwd__shell {
		grid-template-columns: minmax( 0, 1fr );
		height: auto;
		min-height: 0;
	}

	.fyh-bwd--embedded .fyh-bwd__main,
	.fyh-bwd--embedded .fyh-bwd__mode:not([hidden]) {
		height: auto;
		overflow: visible;
	}

	.fyh-bwd__close {
		position: absolute;
		top: .75rem;
		right: .75rem;
		z-index: 3;
	}

	.fyh-bwd__intro {
		padding: 0;
		border-top-right-radius: clamp( 2rem, 9vw, 2.5rem );
		border-bottom-right-radius: clamp( 1.5rem, 7vw, 2rem );
	}

	.fyh-bwd__introcopy {
		padding: clamp( 1.35rem, 6vw, 2rem );
		border-top-right-radius: clamp( 2rem, 9vw, 2.5rem );
		border-bottom-right-radius: clamp( 2.5rem, 12vw, 3.25rem );
	}

	.fyh-bwd--embedded .fyh-bwd__introcopy {
		min-height: 0;
		border-top-right-radius: clamp( 2rem, 9vw, 2.5rem );
		border-bottom-right-radius: clamp( 2.5rem, 12vw, 3.25rem );
	}

	.fyh-bwd__heading {
		max-width: 17ch;
		font-size: clamp( 1.75rem, 8vw, 2.25rem );
	}

	.fyh-bwd__trust {
		grid-template-columns: 1fr;
	}

	.fyh-bwd__portraitvisual {
		min-height: clamp( 15rem, 62vw, 19rem );
		margin-top: -1.5rem;
		background-position: center 38%;
	}

	.fyh-bwd__portraitfoot {
		padding: 1.2rem clamp( 1.35rem, 6vw, 2rem );
	}

	.fyh-bwd--dialog .fyh-bwd__main {
		overflow: visible;
	}
}

/* Auf niedrigen Desktop-Viewports bleibt die Trust-Copy erhalten; die Shell
	 scrollt bei Bedarf, statt conversion-relevante Signale auszublenden. */
@media ( min-width: 761px ) and ( max-height: 720px ) {
	.fyh-bwd__introcopy {
		padding-top: 1.25rem;
	}

	.fyh-bwd__text {
		margin-top: .7rem;
	}

	.fyh-bwd__portraitvisual {
		min-height: 14rem;
	}
}

@media ( max-width: 420px ) {
	.fyh-bwd__action {
		flex: 1 1 auto;
	}
}
