/* SwiPay Vergleichsrechner — Frontend-Styles (gescoped unter .swipay-kalk)
   - Fluid: volle Spaltenbreite, kein fixer Kasten, Felder brechen um.
   - Typografie: erbt die Seiten-Basis (em statt fester px), zurückhaltend. */

.swipay-kalk {
	/* SwiPay CI (2026_SwiPay_Colors) — Hues fix, nur Helligkeit variiert */
	--swipay-bordeaux: #8E312B;        /* Brand-Rot (CI) */
	--swipay-bordeaux-dark: #6F2620;   /* dunklere Luminanz für Hover */
	--swipay-orange: #EC6604;          /* CI-Orange, Aktion/CTA */
	--swipay-green: #5F6B2E;           /* dunklere Luminanz von Oliv #949F50 (lesbar) */
	--swipay-ink: inherit;
	--swipay-muted: #6E797A;           /* hellere Luminanz von Slate #3E4B4C */
	--swipay-line: #D7DCDB;            /* helle Luminanz von Slate (Trennlinie) */
	--swipay-soft: #f6f7f8;
	--swipay-result: #F2F4EA;          /* helle Luminanz von Oliv (Ergebnis-Panel) */

	width: 100%;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	color: var(--swipay-ink);
	font-size: inherit;
	line-height: 1.5;
	box-sizing: border-box;
	/* Der Rechner passt sich an die Breite SEINER SPALTE an, nicht ans Fenster. */
	container-type: inline-size;
	container-name: swipaykalk;
}

.swipay-kalk *,
.swipay-kalk *::before,
.swipay-kalk *::after {
	box-sizing: border-box;
}

.swipay-kalk__titel {
	margin: 0 0 0.75em;
	font-size: 1.25em;
	line-height: 1.25;
	color: var(--swipay-bordeaux);
}

.swipay-kalk__field {
	margin-bottom: 0.9em;
}

.swipay-kalk__field label {
	display: block;
	margin-bottom: 0.3em;
	font-weight: 600;
	font-size: 0.9em;
}

.swipay-kalk__field select,
.swipay-kalk__field input {
	width: 100%;
	padding: 0.6em 0.75em;
	font-size: 0.95em;
	font-family: inherit;
	color: inherit;
	background: #fff;
	border: 1px solid var(--swipay-bordeaux);
	border-radius: 8px;
	appearance: none;
}

.swipay-kalk__field select:focus,
.swipay-kalk__field input:focus {
	outline: none;
	border-color: var(--swipay-bordeaux);
	box-shadow: 0 0 0 3px rgba(142, 49, 43, 0.18);
}

/* Zeile mit Umbruch — passt sich der Spaltenbreite an (nicht nur Viewport). */
.swipay-kalk__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1em;
}

.swipay-kalk__row .swipay-kalk__field {
	flex: 1 1 200px;
	min-width: 0;
}

.swipay-kalk__hint {
	margin: 0.35em 0 0;
	font-size: 0.82em;
	color: var(--swipay-bordeaux);
}

.swipay-kalk__optional {
	margin: 0.25em 0 1em;
	border: 1px dashed var(--swipay-line);
	border-radius: 8px;
	background: var(--swipay-soft);
}

.swipay-kalk__optional summary {
	cursor: pointer;
	padding: 0.6em 0.8em;
	font-weight: 600;
	font-size: 0.88em;
	color: var(--swipay-muted);
}

.swipay-kalk__optional-body {
	padding: 0 0.8em 0.8em;
}

.swipay-kalk__choice {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 1.25em;
	margin-bottom: 0.7em;
	font-size: 0.9em;
}

.swipay-kalk__choice label {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	font-weight: 500;
}

.swipay-kalk__submit {
	width: 100%;
	padding: 0.75em 1em;
	font-size: 1em;
	font-weight: 700;
	font-family: inherit;
	color: #fff;
	background: var(--swipay-bordeaux);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.swipay-kalk__submit:hover {
	background: var(--swipay-bordeaux-dark);
}

.swipay-kalk__submit:disabled {
	opacity: 0.7;
	cursor: default;
}

.swipay-kalk__result {
	margin-top: 1.1em;
	padding: 1.1em 1.2em;
	background: var(--swipay-result);
	border-radius: 10px;
	text-align: center;
}

.swipay-kalk__result-lead {
	margin: 0;
	font-size: 0.85em;
	color: var(--swipay-muted);
}

.swipay-kalk__result-amount {
	margin: 0.2em 0 0;
	font-size: 1.35em;
	font-weight: 800;
	line-height: 1.2;
	color: var(--swipay-green);
}

.swipay-kalk__result-year {
	margin: 0.1em 0 0;
	font-size: 0.9em;
	color: var(--swipay-muted);
}

.swipay-kalk__result-note {
	margin: 0.8em 0 0;
	font-size: 0.85em;
	color: var(--swipay-bordeaux);
}

.swipay-kalk__disclaimer {
	margin: 0.9em 0 0;
	font-size: 0.78em;
	line-height: 1.45;
	color: var(--swipay-muted);
}

.swipay-kalk__nudge {
	margin: 0.9em 0 0;
	font-size: 0.9em;
	font-weight: 600;
	color: var(--swipay-ink);
}

/* Optionaler CTA-Button (nur wenn cta_anchor gesetzt ist) */
.swipay-kalk__cta {
	display: inline-block;
	margin-top: 1em;
	padding: 0.65em 1.3em;
	font-size: 0.95em;
	font-weight: 700;
	color: #fff !important;
	text-decoration: none;
	background: var(--swipay-bordeaux); /* Orange nur auf grau/schwarz — hier heller Grund -> Rot */
	border-radius: 8px;
}

.swipay-kalk__cta:hover {
	filter: brightness(0.94);
}

.swipay-kalk__error {
	margin-top: 0.9em;
	padding: 0.65em 0.8em;
	font-size: 0.88em;
	color: #7a1c1c;
	background: #fbeaea;
	border: 1px solid #f1c8c8;
	border-radius: 8px;
}

/* --- Anpassung an die Spaltenbreite (Container Queries) --- */

/* Schmale Spalte (z. B. Sidebar): kompakter, Ergebniszahl kleiner. */
@container swipaykalk (max-width: 420px) {
	.swipay-kalk__titel { font-size: 1.1em; }
	.swipay-kalk__field label { font-size: 0.85em; }
	.swipay-kalk__optional summary { font-size: 0.82em; }
	.swipay-kalk__result { padding: 0.9em; }
	.swipay-kalk__result-amount { font-size: 1.15em; }
	.swipay-kalk__submit { padding: 0.7em; font-size: 0.95em; }
}

/* Sehr schmal: Ergebniszahl darf umbrechen, Abstände noch enger. */
@container swipaykalk (max-width: 300px) {
	.swipay-kalk__result-amount { font-size: 1.05em; line-height: 1.3; }
	.swipay-kalk__choice { gap: 0.35em 0.9em; font-size: 0.85em; }
}

/* Fallback für sehr alte Browser ohne Container-Query-Support: an Viewport koppeln. */
@supports not (container-type: inline-size) {
	@media (max-width: 480px) {
		.swipay-kalk__result-amount { font-size: 1.15em; }
	}
}
