/**
 * Globaler Kontakt-Dialog (Butterling-Muster in ImmoExpert-Tokens).
 * Natives <dialog> — Brand-Panel (ink) links, Formular rechts. Wird per
 * data-fyh-kontakt-open oder <a href="#kontakt-dialog"> geöffnet, postet an
 * singulary/v1/lead (→ Lead-CPT + Resend-Mail + OpenImmo-kontakt.xml).
 */

.fyh-kd {
	width: min( 62rem, calc( 100vw - 2rem ) );
	max-width: none;
	max-height: min( 92vh, 100dvh );
	padding: 0;
	border: 0;
	border-radius: 22px;
	overflow: hidden;
	/* surface statt #fff: falls an einer gerundeten Ecke doch 1px durchscheint,
	   matcht es das Form-Panel statt reinweiß aufzublitzen. */
	background: var(--wp--preset--color--surface, #f5f5f7);
	box-shadow: 0 40px 100px -30px rgba( 14, 14, 14, .5 );
	color: var(--wp--preset--color--ink, #1A2434);
}
/* Im offenen Zustand FLEX (closed bleibt UA-display:none): das Grid füllt so IMMER
   die volle Dialog-Höhe → kein durchscheinender Hintergrund-Streifen unten mehr. */
.fyh-kd[open] { display: flex; }
.fyh-kd::backdrop { background: rgba( 14, 18, 26, .55 ); backdrop-filter: blur( 4px ); }
/* Öffnen-Animation (nur wo unterstützt; sonst einfach da). */
.fyh-kd[open] { animation: fyhKdIn .28s cubic-bezier( .22, 1, .36, 1 ); }
@keyframes fyhKdIn { from { opacity: 0; transform: translateY( 12px ) scale( .98 ); } to { opacity: 1; transform: none; } }

.fyh-kd__grid { flex: 1; display: grid; grid-template-columns: 0.85fr 1.15fr; width: 100%; min-width: 0; min-height: 0; }

/* --- Brand-Panel (ink) --- */
.fyh-kd__brand {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	padding: 2.25rem;
	background: var(--wp--preset--color--ink, #1A2434);
	color: #fff;
	overflow: hidden;
}
.fyh-kd__brand::after {
	content: "";
	position: absolute; right: -4rem; top: -4rem;
	width: 14rem; height: 14rem; border-radius: 999px;
	background: radial-gradient( circle, rgba( 255, 255, 255, .08 ) 0%, transparent 70% );
	pointer-events: none;
}
.fyh-kd__eyebrow { margin: 0; font-size: .66rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--wp--preset--color--on-dark-soft, #bdbdbd); }
.fyh-kd__title { margin: 0; font-size: 1.75rem; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.fyh-kd__title span { color: var(--wp--preset--color--on-dark-soft, #bdbdbd); }
.fyh-kd__desc { margin: 0; font-size: .9rem; line-height: 1.55; color: rgba( 255, 255, 255, .75 ); }

.fyh-kd__contacts { display: flex; flex-direction: column; gap: .6rem; margin-top: .25rem; }
.fyh-kd__contact { display: inline-flex; align-items: center; gap: .7rem; padding: .7rem .85rem; border: 1px solid rgba( 255, 255, 255, .12 ); border-radius: 12px; background: rgba( 255, 255, 255, .04 ); color: #fff; text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.fyh-kd__contact:hover { border-color: rgba( 255, 255, 255, .3 ); background: rgba( 255, 255, 255, .08 ); }
.fyh-kd__contact svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--wp--preset--color--on-dark-soft, #bdbdbd); }
.fyh-kd__contact-k { display: block; font-size: .56rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--wp--preset--color--on-dark-soft, #bdbdbd); }
.fyh-kd__contact-v { display: block; font-size: .88rem; font-weight: 600; }

.fyh-kd__trust { list-style: none; margin: auto 0 0; padding: 1rem 0 0; display: flex; flex-direction: column; gap: .5rem; }
.fyh-kd__trust li { display: flex; align-items: flex-start; gap: .5rem; font-size: .82rem; line-height: 1.4; color: rgba( 255, 255, 255, .8 ); }
.fyh-kd__trust svg { width: 14px; height: 14px; margin-top: .15rem; flex-shrink: 0; color: #7fd1a3; }

/* --- Form-Panel --- */
.fyh-kd__form { position: relative; display: flex; flex-direction: column; padding: 2.25rem; background: var(--wp--preset--color--surface, #f5f5f7); overflow-y: auto; }
.fyh-kd__close { position: absolute; right: 1rem; top: 1rem; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: rgba( 14, 18, 26, .05 ); color: var(--wp--preset--color--ink, #1A2434); cursor: pointer; transition: background .15s ease; }
.fyh-kd__close:hover { background: rgba( 14, 18, 26, .1 ); }
.fyh-kd__close svg { width: 17px; height: 17px; }

.fyh-kd__grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .8rem; }
.fyh-kd__field { display: flex; flex-direction: column; gap: 5px; margin-bottom: .9rem; }
.fyh-kd__grid2 .fyh-kd__field { margin-bottom: .5rem; }
.fyh-kd__field span { font-size: .74rem; font-weight: 600; letter-spacing: .03em; color: var(--wp--preset--color--muted, #808080); }
.fyh-kd__field input, .fyh-kd__field textarea, .fyh-kd__field select {
	border: 1px solid var(--wp--preset--color--hairline, #e4e4e2); border-radius: 11px; padding: .65rem .8rem;
	font: inherit; font-size: .92rem; color: var(--wp--preset--color--ink, #1A2434); background: #fff; width: 100%; box-sizing: border-box;
}
.fyh-kd__field textarea { resize: vertical; min-height: 84px; }
.fyh-kd__field input:focus, .fyh-kd__field textarea:focus, .fyh-kd__field select:focus { outline: 0; border-color: var(--wp--preset--color--ink, #1A2434); }

.fyh-kd__consent { display: flex; align-items: flex-start; gap: 10px; margin: .4rem 0 0; font-size: .8rem; line-height: 1.45; color: var(--wp--preset--color--muted, #808080); cursor: pointer; }
.fyh-kd__consent input { margin-top: 2px; width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--wp--preset--color--ink, #1A2434); }
.fyh-kd__consent a { color: var(--wp--preset--color--ink, #1A2434); font-weight: 600; }

.fyh-kd__submit { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; margin-top: 1.1rem; min-height: 50px; padding: 0 1.5rem; border: 0; border-radius: 999px; background: var(--wp--preset--color--ink, #1A2434); color: #fff; font: inherit; font-size: .98rem; font-weight: 600; cursor: pointer; transition: transform .2s ease, opacity .2s ease; }
.fyh-kd__submit:hover { transform: translateY( -1px ); opacity: .93; }
.fyh-kd__submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.fyh-kd__status { margin: .9rem 0 0; padding: .75rem .95rem; border-radius: 11px; font-size: .88rem; line-height: 1.5; }
.fyh-kd__status.is-ok { background: color-mix( in srgb, #1a7f37 12%, #fff ); color: #14692d; }
.fyh-kd__status.is-err { background: color-mix( in srgb, #d3232a 10%, #fff ); color: #b3161c; }

/* --- Erfolg (ersetzt das Formular) --- */
.fyh-kd__done { margin: auto; text-align: center; padding: 1.5rem 0; }
.fyh-kd__done svg { width: 54px; height: 54px; margin: 0 auto 1rem; padding: 12px; border-radius: 999px; color: #14692d; background: color-mix( in srgb, #1a7f37 14%, #fff ); box-sizing: content-box; }
.fyh-kd__done h3 { margin: 0 0 .5rem; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--wp--preset--color--ink, #1A2434); }
.fyh-kd__done p { margin: 0 auto; max-width: 34ch; color: var(--wp--preset--color--muted, #808080); line-height: 1.6; }

@media ( max-width: 760px ) {
	.fyh-kd { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
	.fyh-kd__grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: 100%; }
	.fyh-kd__brand { gap: .8rem; padding: 1.35rem 1.35rem 1.2rem; }
	.fyh-kd__title { font-size: 1.3rem; }
	.fyh-kd__desc, .fyh-kd__trust { display: none; }
	/* Kontakt-Pills untereinander (volle Breite) — 2-col war zu eng, die
	   Telefonnummer brach dreizeilig um. */
	.fyh-kd__contacts { flex-direction: column; }
	.fyh-kd__contact-v { white-space: nowrap; }
	/* Close löst sich vom Form-Panel und sitzt in der Dialog-Ecke (= dunkles
	   Brand-Panel oben) — vorher überlappte er das Nachname-Feld. */
	.fyh-kd__form { position: static; padding: 1.35rem; }
	.fyh-kd__close { top: 1rem; right: 1rem; background: rgba( 255, 255, 255, .14 ); color: #fff; }
	.fyh-kd__close:hover { background: rgba( 255, 255, 255, .26 ); }
	.fyh-kd__grid2 { grid-template-columns: 1fr 1fr; }
}
