/* WGK Mitgliedsantrag – nutzt die Elementor-Globalfarben der Seite */
.wgkm { --c: var(--e-global-color-primary, #13509C); --c-ok: #2e9e5b; --c-err: #d9534f; --bg: #f5f7fa; --br: 6px;
	max-width: 780px; margin: 0 auto; font-size: 16px; line-height: 1.5; color: #333; }
.wgkm *, .wgkm *::before, .wgkm *::after { box-sizing: border-box; }
.wgkm [hidden] { display: none !important; }
.wgkm h3 { color: var(--c); margin: 0 0 14px; font-size: 1.5em; }
.wgkm h4 { margin: 26px 0 10px; font-size: 1.1em; color: #444; }
.wgkm p { margin: 0 0 14px; }
.wgkm a { color: var(--c); }
.wgkm-hint { font-size: .9em; color: #666; }

/* Fortschritt */
.wgkm-progress { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0 0 28px; counter-reset: s; }
.wgkm-progress li { flex: 1; text-align: center; font-size: .78em; color: #999; position: relative; padding-top: 34px; }
.wgkm-progress li span { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: #e3e7ee; color: #777; line-height: 28px; font-weight: 700; }
.wgkm-progress li::after { content: ""; position: absolute; top: 14px; left: 50%; width: 100%; height: 2px; background: #e3e7ee; z-index: -1; }
.wgkm-progress li:last-child::after { display: none; }
.wgkm-progress li.is-active { color: var(--c); font-weight: 700; }
.wgkm-progress li.is-active span { background: var(--c); color: #fff; }
.wgkm-progress li.is-done span { background: var(--c-ok); color: #fff; }
.wgkm-progress li.is-done span::before { content: "✓"; }
.wgkm-progress li.is-done span { font-size: 0; } .wgkm-progress li.is-done span::before { font-size: 15px; }
.wgkm-progress li.is-done::after { background: var(--c-ok); }
@media (max-width: 640px) { .wgkm-progress li { font-size: 0; } .wgkm-progress li span { font-size: 14px; } }

/* Schritt-Container */
.wgkm-step { background: #fff; border: 1px solid #e3e7ee; border-radius: var(--br); padding: 28px; }
@media (max-width: 640px) { .wgkm-step { padding: 18px; } }

/* Auswahlkarten */
.wgkm-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
@media (max-width: 640px) { .wgkm-choice { grid-template-columns: 1fr; } }
.wgkm-card { display: flex; flex-direction: column; gap: 6px; border: 2px solid #e3e7ee; border-radius: var(--br); padding: 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s; font-size: .95em; }
.wgkm-card:has(input:checked) { border-color: var(--c); box-shadow: 0 0 0 3px rgba(19,80,156,.12); }
.wgkm-card input { position: absolute; opacity: 0; }
.wgkm-card strong { font-size: 1.15em; color: var(--c); }
.wgkm-price { font-size: 1.5em; font-weight: 700; color: #222; }
.wgkm-price small { font-size: .55em; font-weight: 400; color: #777; }

/* Felder */
.wgkm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.wgkm-col-2 { grid-column: span 2; }
@media (max-width: 560px) { .wgkm-grid { grid-template-columns: 1fr; } .wgkm-col-2 { grid-column: auto; } }
.wgkm-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.wgkm-field label { font-size: .85em; font-weight: 600; color: #555; }
.wgkm-field label small { font-weight: 400; color: #999; }
.wgkm input[type=text], .wgkm input[type=email], .wgkm input[type=tel], .wgkm input[type=date], .wgkm select, .wgkm textarea {
	width: 100%; padding: 10px 12px; border: 1px solid #cfd6e0; border-radius: 4px; font: inherit; background: #fff; }
.wgkm textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.wgkm-zaehler { color: #888; font-size: .82em; text-align: right; min-height: 1.1em; }
.wgkm input:focus, .wgkm select:focus, .wgkm textarea:focus { outline: none; border-color: var(--c); box-shadow: 0 0 0 3px rgba(19,80,156,.15); }
.wgkm-field--code input { font-size: 1.6em; letter-spacing: .3em; text-align: center; max-width: 240px; }
.wgkm-hp { position: absolute; left: -9999px; }
.wgkm-person { border: 1px solid #e3e7ee; border-radius: var(--br); padding: 16px; margin: 0 0 14px; background: var(--bg); }
.wgkm-person legend { font-weight: 700; color: var(--c); padding: 0 8px; display: flex; align-items: center; gap: 10px; }
.wgkm-remove { border: 0; background: #e3e7ee; color: #555; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; line-height: 1;
	/* padding: 0 ist Pflicht – siehe Hinweis bei .wgkm-dialog__close */
	padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.wgkm-familie { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }

/* Checkboxen */
.wgkm-check { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 16px; font-size: .93em; cursor: pointer; }
.wgkm-check input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--c); }
.wgkm-check em { display: block; color: #666; font-size: .93em; margin-top: 4px; }
.wgkm-check--optional { background: var(--bg); padding: 12px; border-radius: 4px; }

/* Buttons */
.wgkm-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.wgkm-nav > :only-child { margin-left: auto; }
.wgkm-btn { border: 2px solid var(--c); background: var(--c); color: #fff; font: inherit; font-weight: 600; padding: 11px 22px; border-radius: 4px; cursor: pointer; transition: opacity .15s; }
.wgkm-btn:hover { opacity: .9; }
.wgkm-btn--ghost { background: #fff; color: var(--c); }
.wgkm-btn--big { padding: 14px 30px; font-size: 1.05em; }
.wgkm-btn:disabled { opacity: .55; cursor: wait; }
.wgkm-btn.is-busy::after { content: "…"; }

/* Meldungen */
.wgkm-alert { border-radius: 4px; padding: 12px 16px; margin: 0 0 18px; font-size: .95em; }
.wgkm-alert--error { background: #fdecea; color: #a12622; border-left: 4px solid var(--c-err); }
.wgkm-alert--ok { background: #e7f6ec; color: #1f6f3f; border-left: 4px solid var(--c-ok); }
.wgkm-verify { margin-top: 26px; padding-top: 22px; border-top: 1px dashed #cfd6e0; }

/* Zusammenfassung */
.wgkm-summary dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0 0 22px; font-size: .95em; }
.wgkm-summary dt { font-weight: 600; color: #555; }
.wgkm-summary dd { margin: 0; }
@media (max-width: 560px) { .wgkm-summary dl { grid-template-columns: 1fr; gap: 2px 0; } .wgkm-summary dd { margin-bottom: 10px; } }

/* Abschluss */
.wgkm-done { text-align: center; }
.wgkm-done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--c-ok); color: #fff; font-size: 34px; line-height: 64px; margin: 0 auto 16px; }

/* ============================================================
   Dialog: ab Schritt 2 läuft der Antrag in einer Ebene über der
   Seite. Natives <dialog> – dadurch Fokusfalle, ESC und oberste
   Ebene vom Browser, ohne z-index-Streit mit Header oder Cookie-
   Banner. Ohne Unterstützung baut das JS alles wieder flach ein.
   ============================================================ */
.wgkm-dialog {
	display: none;                 /* auch für Browser ohne <dialog> */
	position: fixed; inset: 0; margin: auto;
	width: min(840px, 94vw);
	/* Feste Höhe: der Kasten wächst zwischen den Schritten nicht mehr,
	   deshalb springt nichts. Gescrollt wird nur innen. */
	height: min(88svh, 940px);
	max-width: none; max-height: none;
	padding: 0; border: 0; border-radius: 12px;
	background: #fff; color: #333;
	box-shadow: 0 24px 70px rgba(10, 20, 40, .35);
	overflow: hidden;
}
.wgkm-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.wgkm-dialog::backdrop {
	background: rgba(16, 26, 44, .45);
	backdrop-filter: blur(10px) saturate(115%);
	-webkit-backdrop-filter: blur(10px) saturate(115%);
}

.wgkm-dialog__head { position: relative; padding: 20px 26px 0; border-bottom: 1px solid #e9edf3; }
.wgkm-dialog__titel { margin: 0 0 16px; font-size: 1.05em; font-weight: 700; color: var(--c); }
/* Astra setzt per Customizer-CSS fuer JEDES <button> ein padding: 10px 40px.
   Ohne eigenes padding: 0 greift das hier durch, und weil ein Element nie schmaler
   wird als sein eigenes Innenmass, zieht es den runden Knopf auf 80px Breite
   auseinander – aus dem Kreis wird ein Ei. Das flex-Zentrieren setzt das Kreuz
   zuverlaessig in die Mitte, unabhaengig von der Zeilenhoehe des Themes. */
.wgkm-dialog__close {
	position: absolute; top: 12px; right: 14px; width: 36px; height: 36px;
	padding: 0; display: flex; align-items: center; justify-content: center;
	border: 0; border-radius: 50%; background: #eff3f8; color: #4a5568;
	font-size: 24px; line-height: 1; cursor: pointer; transition: background .15s;
}
.wgkm-dialog__close:hover { background: #e2e8f2; }
.wgkm-dialog__head .wgkm-progress { margin-bottom: 18px; }

.wgkm-dialog__body { overflow-y: auto; overscroll-behavior: contain; padding: 24px 26px 0; }
.wgkm-dialog__body:focus { outline: none; }
/* Im Dialog braucht der Schritt keinen eigenen Rahmen mehr – sonst Kasten im Kasten. */
.wgkm-dialog .wgkm-step { border: 0; padding: 0; background: transparent; }
/* Die Bedienknöpfe bleiben unten stehen, auch wenn der Schritt lang ist. */
.wgkm-dialog .wgkm-nav {
	position: sticky; bottom: 0; z-index: 2;
	margin-top: 26px; padding: 14px 0 18px; background: #fff;
	box-shadow: 0 -14px 18px -14px rgba(10, 20, 40, .2);
}

/* Seite hinter dem Dialog nicht mitscrollen lassen */
html.wgkm-locked, html.wgkm-locked body { overflow: hidden; }

@media (prefers-reduced-motion: no-preference) {
	.wgkm-dialog[open] { animation: wgkm-auf .22s cubic-bezier(.2, .8, .3, 1); }
	.wgkm-dialog[open]::backdrop { animation: wgkm-ein .22s ease-out; }
}
@keyframes wgkm-auf { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes wgkm-ein { from { opacity: 0; } }

@media (max-width: 640px) {
	.wgkm-dialog { width: 100vw; height: 100svh; border-radius: 0; }
	.wgkm-dialog__head { padding: 16px 16px 0; }
	.wgkm-dialog__titel { margin-bottom: 12px; font-size: 1em; }
	.wgkm-dialog__body { padding: 18px 16px 0; }
}
