/**
 * IEW WEG-Konfigurator, Darstellung.
 * Farben über Variablen anpassbar, Schrift vom Theme.
 *
 * Copyright (C) 2026 Elke Wirtz, IEW Immobilien Elke Wirtz
 * License: GPL-2.0-or-later
 */
.iewk,
.iewk-faq {
	--iewk-akzent: #007a7a;
	--iewk-akzent-dunkel: #005c5c;
	--iewk-akzent-hell: #e6f4f4;
	--iewk-text: #1f2a2a;
	--iewk-grau: #5b6666;
	--iewk-linie: #cfd8d8;
	--iewk-flaeche: #ffffff;
	--iewk-fehler: #b3261e;
	--iewk-radius: 8px;
	color: var(--iewk-text);
	font-size: 1rem;
	line-height: 1.5;
	box-sizing: border-box;
}

.iewk *,
.iewk *::before,
.iewk *::after {
	box-sizing: inherit;
}

.iewk {
	max-width: 860px;
	margin-inline: auto;
}

.iewk__laden {
	padding: 1.5rem;
	color: var(--iewk-grau);
}

.iewk__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Fortschritt */
.iewk__schritte {
	display: flex;
	gap: 0.25rem;
	list-style: none;
	margin: 0 0 1.25rem;
	padding: 0;
	counter-reset: none;
}

.iewk__schritt {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.8rem;
	color: var(--iewk-grau);
	text-align: center;
	border-top: 4px solid var(--iewk-linie);
	padding-top: 0.4rem;
}

.iewk__schritt.ist-erledigt {
	border-top-color: var(--iewk-akzent);
}

.iewk__schritt.ist-aktiv {
	border-top-color: var(--iewk-akzent);
	color: var(--iewk-text);
	font-weight: 600;
}

.iewk__schritt-nr {
	font-weight: 700;
}

@media (max-width: 600px) {
	.iewk__schritt-text {
		display: none;
	}

	.iewk__schritt.ist-aktiv .iewk__schritt-text {
		display: block;
	}
}

.iewk__inhalt {
	background: var(--iewk-flaeche);
	border: 1px solid var(--iewk-linie);
	border-radius: var(--iewk-radius);
	padding: clamp(1rem, 3vw, 2rem);
}

.iewk__titel {
	margin: 0 0 0.75rem;
	font-size: 1.35rem;
	line-height: 1.3;
}

.iewk__titel:focus {
	outline: none;
}

.iewk__einleitung {
	margin: 0 0 1rem;
}

.iewk__klein {
	font-size: 0.875rem;
	color: var(--iewk-grau);
}

/* Felder */
.iewk__feld {
	margin: 0 0 1rem;
}

.iewk__feld > label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3rem;
}

.iewk__eingabe {
	width: 100%;
	min-height: 44px;
	padding: 0.55rem 0.7rem;
	font: inherit;
	color: inherit;
	background: #fff;
	border: 1px solid #8a9696;
	border-radius: 6px;
}

textarea.iewk__eingabe {
	min-height: 5.5rem;
	resize: vertical;
}

.iewk__eingabe:focus-visible,
.iewk input[type="radio"]:focus-visible,
.iewk input[type="checkbox"]:focus-visible,
.iewk button:focus-visible,
.iewk a:focus-visible,
.iewk summary:focus-visible {
	outline: 3px solid var(--iewk-akzent);
	outline-offset: 2px;
}

.iewk__eingabe[aria-invalid="true"] {
	border-color: var(--iewk-fehler);
}

.iewk__pflicht,
.iewk__feldfehler {
	color: var(--iewk-fehler);
}

.iewk__feldfehler {
	margin: 0.3rem 0 0;
	font-size: 0.9rem;
}

.iewk__reihe {
	display: grid;
	gap: 0 1rem;
	grid-template-columns: 1fr;
}

@media (min-width: 600px) {
	.iewk__reihe {
		grid-template-columns: 1fr 1fr;
	}

	.iewk__reihe--plz {
		grid-template-columns: 10rem 1fr;
	}
}

.iewk__gruppe {
	border: 0;
	margin: 0 0 1.25rem;
	padding: 0;
}

.iewk__gruppe legend {
	font-weight: 600;
	margin-bottom: 0.5rem;
	padding: 0;
}

.iewk__option {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	padding: 0.55rem 0.2rem;
	cursor: pointer;
}

.iewk__option input {
	width: 1.25rem;
	height: 1.25rem;
	margin: 0.15rem 0 0;
	flex: 0 0 auto;
	accent-color: var(--iewk-akzent);
}

.iewk__option > span {
	display: flex;
	flex-direction: column;
}

.iewk__hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Pakete */
.iewk__pakete {
	border: 0;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.9rem;
}

.iewk__zwischentitel {
	margin: 0.75rem 0 0;
	font-weight: 600;
	color: var(--iewk-grau);
}

.iewk__paket {
	border: 2px solid var(--iewk-linie);
	border-radius: var(--iewk-radius);
	padding: 1rem;
	background: #fff;
}

.iewk__paket.ist-gewaehlt {
	border-color: var(--iewk-akzent);
	background: var(--iewk-akzent-hell);
}

.iewk__paket.ist-gesperrt {
	opacity: 0.65;
}

.iewk__paket-kopf {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.iewk__paket-kopf input {
	width: 1.35rem;
	height: 1.35rem;
	margin: 0;
	accent-color: var(--iewk-akzent);
	flex: 0 0 auto;
}

.iewk__paket-titel {
	font-weight: 700;
	font-size: 1.1rem;
	cursor: pointer;
	flex: 1 1 auto;
}

.iewk__paket-bild {
	display: block;
	width: calc(100% + 2rem);
	max-width: none;
	height: 220px;
	object-fit: contain;
	background: #f4f6f6;
	margin: -1rem -1rem 0.75rem;
	border-radius: calc(var(--iewk-radius) - 2px) calc(var(--iewk-radius) - 2px) 0 0;
}

.iewk__paket-kurz {
	margin: 0.5rem 0;
}

.iewk__preis {
	margin: 0.25rem 0;
	font-weight: 600;
	color: var(--iewk-akzent-dunkel);
}

.iewk__paket-details summary,
.iewk__markt summary,
.iewk__ki summary {
	cursor: pointer;
	font-weight: 600;
	min-height: 44px;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	list-style: none;
}

.iewk__paket-details summary::-webkit-details-marker,
.iewk__markt summary::-webkit-details-marker,
.iewk__ki summary::-webkit-details-marker {
	display: none;
}

.iewk__paket-details summary::before,
.iewk__markt summary::before,
.iewk__ki summary::before {
	content: "";
	width: 0.5rem;
	height: 0.5rem;
	border-right: 2px solid var(--iewk-akzent);
	border-bottom: 2px solid var(--iewk-akzent);
	transform: rotate(-45deg);
	transition: transform 0.15s;
	flex: 0 0 auto;
}

.iewk__paket-details[open] > summary::before,
.iewk__markt[open] > summary::before,
.iewk__ki[open] > summary::before {
	transform: rotate(45deg);
}

.iewk__liste {
	margin: 0.25rem 0 0.5rem;
	padding-left: 1.2rem;
}

.iewk__liste li {
	margin: 0.35rem 0;
}

.iewk__liste-titel {
	font-weight: 600;
}

.iewk__liste-kurz {
	display: block;
	color: var(--iewk-grau);
	font-size: 0.93rem;
	font-weight: 400;
}

/* Info-Bereich im Konfigurator */
.iewk__info-knopf {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -10px -6px -10px 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	vertical-align: middle;
}

.iewk__info-knopf > span[aria-hidden] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	border: 2px solid var(--iewk-akzent);
	color: var(--iewk-akzent);
	font-weight: 700;
	font-family: Georgia, serif;
	font-style: italic;
	font-size: 0.9rem;
	line-height: 1;
}

.iewk__info-knopf[aria-expanded="true"] > span[aria-hidden] {
	background: var(--iewk-akzent);
	color: #fff;
}

.iewk__info {
	margin: 0.6rem 0;
	padding: 0.85rem 1rem;
	background: #fff;
	border-left: 4px solid var(--iewk-akzent);
	border-radius: 0 6px 6px 0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	font-size: 0.95rem;
}

.iewk__info-eintrag + .iewk__info-eintrag {
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--iewk-linie);
}

.iewk__info-titel {
	margin: 0 0 0.25rem;
	font-size: 1rem;
}

.iewk__info-titel:empty {
	display: none;
}

.iewk__info-kurz {
	margin: 0 0 0.35rem;
	font-weight: 600;
}

.iewk__info-text p {
	margin: 0.3rem 0;
}

.iewk__zusatz {
	border-bottom: 1px solid var(--iewk-linie);
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
}

.iewk__zusatz .iewk__option {
	flex: 1 1 auto;
}

.iewk__zusatz .iewk__info {
	flex: 1 1 100%;
}

/* Zusammenfassung */
.iewk__tabelle-rahmen {
	overflow-x: auto;
	margin: 0 0 0.75rem;
}

.iewk__tabelle {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.iewk__tabelle th,
.iewk__tabelle td {
	text-align: left;
	padding: 0.55rem 0.5rem;
	border-bottom: 1px solid var(--iewk-linie);
	vertical-align: top;
}

.iewk__tabelle thead th {
	background: var(--iewk-akzent-hell);
}

.iewk__tabelle .ist-zahl {
	text-align: right;
	white-space: nowrap;
}

.iewk__tabelle tfoot th,
.iewk__tabelle tfoot td {
	font-weight: 700;
	border-bottom: 0;
}

.iewk__tabelle tfoot .ist-klein th,
.iewk__tabelle tfoot .ist-klein td {
	font-weight: 400;
	color: var(--iewk-grau);
}

@media (max-width: 520px) {
	.iewk__tabelle thead {
		display: none;
	}

	.iewk__tabelle,
	.iewk__tabelle tbody,
	.iewk__tabelle tfoot {
		display: block;
		width: 100%;
	}

	.iewk__tabelle tfoot tr {
		display: flex;
		justify-content: space-between;
		gap: 1rem;
	}

	.iewk__tabelle tbody tr {
		display: grid;
		grid-template-columns: 1fr auto;
		width: 100%;
		border-bottom: 1px solid var(--iewk-linie);
		padding: 0.4rem 0;
	}

	.iewk__tabelle tbody th,
	.iewk__tabelle tbody td {
		border: 0;
		padding: 0.15rem 0.25rem;
	}

	.iewk__tabelle tbody td:nth-child(2) {
		grid-column: 1 / -1;
		grid-row: 2;
		color: var(--iewk-grau);
		font-size: 0.9rem;
	}
}

.iewk__hinweis {
	padding: 0.75rem 1rem;
	background: var(--iewk-akzent-hell);
	border-radius: 6px;
}

.iewk__hinweis--fehler {
	background: #fdecea;
	border-left: 4px solid var(--iewk-fehler);
	margin-bottom: 1rem;
}

.iewk__hinweis--fehler p,
.iewk__hinweis--fehler ul {
	margin: 0.2rem 0;
}

.iewk__markt,
.iewk__paket-details {
	margin: 0.75rem 0;
}

.iewk__markt {
	border: 1px solid var(--iewk-linie);
	border-radius: 6px;
	padding: 0 1rem;
}

.iewk__daten {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.15rem 1rem;
	margin: 1rem 0 0;
}

@media (min-width: 600px) {
	.iewk__daten {
		grid-template-columns: 11rem 1fr;
	}
}

.iewk__daten dt {
	font-weight: 600;
}

.iewk__daten dd {
	margin: 0 0 0.4rem;
}

.iewk__link {
	background: none;
	border: 0;
	padding: 0.25rem;
	color: var(--iewk-akzent-dunkel);
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
	font-size: 0.9rem;
}

/* Navigation */
.iewk__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: space-between;
	margin-top: 1.5rem;
}

.iewk__knopf {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0.6rem 1.4rem;
	font: inherit;
	font-weight: 600;
	border-radius: 6px;
	border: 2px solid var(--iewk-akzent);
	background: #fff;
	color: var(--iewk-akzent-dunkel);
	cursor: pointer;
	text-decoration: none;
}

.iewk__knopf--weiter {
	background: var(--iewk-akzent);
	color: #fff;
	margin-left: auto;
}

.iewk__knopf--weiter:hover {
	background: var(--iewk-akzent-dunkel);
	border-color: var(--iewk-akzent-dunkel);
	color: #fff;
}

.iewk__knopf[disabled] {
	opacity: 0.6;
	cursor: wait;
}

@media (max-width: 480px) {
	.iewk__nav .iewk__knopf {
		flex: 1 1 100%;
		margin-left: 0;
	}

	.iewk__nav .iewk__knopf--weiter {
		order: -1;
	}
}

.iewk__bestaetigung {
	background: var(--iewk-flaeche);
	border: 2px solid var(--iewk-akzent);
	border-radius: var(--iewk-radius);
	padding: clamp(1rem, 3vw, 2rem);
}

.iewk__fehler {
	color: var(--iewk-fehler);
}

/* KI-Assistent */
.iewk__ki {
	margin-top: 1rem;
	border: 1px solid var(--iewk-linie);
	border-radius: var(--iewk-radius);
	padding: 0 1rem 0.75rem;
	background: #fff;
}

.iewk__ki label {
	display: block;
	font-weight: 600;
	margin: 0.5rem 0 0.25rem;
}

.iewk__ki .iewk__knopf {
	margin-top: 0.5rem;
}

.iewk__ki-ausgabe {
	margin-top: 0.75rem;
}

/* FAQ-Block */
.iewk-faq__eintrag {
	border-bottom: 1px solid var(--iewk-linie);
}

.iewk-faq__eintrag summary {
	cursor: pointer;
	font-weight: 600;
	padding: 0.8rem 0;
	min-height: 44px;
}

.iewk-faq__antwort {
	padding: 0 0 0.8rem;
}

@media (prefers-reduced-motion: reduce) {
	.iewk * {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
