/*
 * Spöckl Preisrechner: Frontend.
 * Farben kommen aus dem Elementor-Kit (--e-global-color-*), mit Spöckl-Werten als Fallback.
 * Selektoren für Buttons sind mindestens .spr button.x (0,2,1) bzw. :hover (0,3,1),
 * weil das Kit alle Buttons global stylt (.elementor-kit-13 button:hover = 0,2,1).
 */

.spr {
	--spr-primary: var(--e-global-color-primary, #0648c7);
	--spr-primary-dark: #0539a3;
	--spr-primary-dark: color-mix(in srgb, var(--spr-primary) 80%, #000);
	--spr-tint: #eef3fc;
	--spr-tint: color-mix(in srgb, var(--spr-primary) 6%, #fff);
	--spr-text: var(--e-global-color-text, #333);
	--spr-muted: #666;
	--spr-bg: #fff;
	--spr-field: #f4f5f7;
	--spr-line: #e2e4e8;
	--spr-call: #ffa500;
	--spr-error: #c0392b;
	--spr-btn-radius: 2px;

	container-type: inline-size;
	position: relative;
	box-sizing: border-box;
	width: 100%;
	margin: 0 auto;
	padding: 24px;
	background: var(--spr-bg);
	border: 1px solid var(--spr-line);
	border-top: 3px solid var(--spr-primary);
	color: var(--spr-text);
	font-family: inherit;
	font-size: 15px;
	font-variant-numeric: lining-nums; /* greift nur, wenn die Webfont das Feature mitliefert (Google-Fonts-Raleway der Seite: nein) */
	line-height: 1.5;
	text-align: left;
}
.spr *, .spr *::before, .spr *::after { box-sizing: border-box; }
.spr--voll { max-width: 820px; }
.spr [hidden] { display: none !important; }
.spr p { margin: 0; }

/* ---------- Kopf ---------- */
.spr .spr-head { margin-bottom: 20px; }
.spr .spr-eyebrow { margin-bottom: 8px; color: var(--spr-primary); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.spr .spr-title { margin-bottom: 6px; color: var(--spr-text); font-size: 22px; font-weight: 700; line-height: 1.25; }
.spr--voll .spr-title { font-size: clamp(24px, 4cqi, 32px); }
.spr .spr-intro { margin-bottom: 4px; color: var(--spr-muted); font-size: 15px; }
.spr .spr-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--spr-line); color: var(--spr-muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.spr .spr-head > .spr-progress:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.spr .spr-progress-bar { flex: 1; height: 3px; background: var(--spr-line); }
.spr .spr-progress-bar > span { display: block; height: 100%; background: var(--spr-primary); transition: width .3s ease; }

/* ---------- Felder ---------- */
.spr .spr-step { display: block; margin: 0; }
.spr .spr-field { margin-bottom: 18px; }
.spr .spr-label { display: block; margin: 0 0 7px; color: var(--spr-text); font-size: 14px; font-weight: 600; line-height: 1.3; }
.spr .spr-req { color: var(--spr-primary); }
.spr .spr-opt { color: var(--spr-muted); font-weight: 400; }

.spr .spr-input {
	display: block;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 14px;
	background: var(--spr-field);
	border: 1px solid var(--spr-field);
	border-radius: 0;
	box-shadow: none;
	color: var(--spr-text);
	font: inherit;
	font-size: 16px; /* verhindert Zoom auf iOS */
	line-height: 1.2;
	transition: border-color .15s, background-color .15s, box-shadow .15s;
	-webkit-appearance: none;
	appearance: none;
}
.spr .spr-input:hover { border-color: #c9cdd4; }
.spr .spr-input:focus { outline: none; background: #fff; border-color: var(--spr-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--spr-primary) 18%, transparent); }
.spr .spr-input[aria-invalid="true"] { border-color: var(--spr-error); background: #fff; }
.spr .spr-input::placeholder { color: #9aa0a8; opacity: 1; }

/* Fläche mit Einheit */
.spr .spr-qm-box { position: relative; }
.spr .spr-qm-box .spr-input--qm { padding-right: 46px; font-weight: 700; font-variant-numeric: tabular-nums; }
.spr .spr-unit { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--spr-muted); font-size: 15px; font-weight: 600; pointer-events: none; }
.spr .spr-input--qm::-webkit-outer-spin-button,
.spr .spr-input--qm::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.spr .spr-input--qm { -moz-appearance: textfield; }

/* Schieberegler (voller Rechner) */
.spr .spr-qm { display: grid; grid-template-columns: 1fr 140px; gap: 20px; align-items: center; }
.spr .spr-range {
	--spr-fill: 30%;
	width: 100%;
	height: 28px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.spr .spr-range:focus { outline: none; }
.spr .spr-range::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, var(--spr-primary) var(--spr-fill), var(--spr-line) var(--spr-fill)); }
.spr .spr-range::-moz-range-track { height: 4px; background: var(--spr-line); }
.spr .spr-range::-moz-range-progress { height: 4px; background: var(--spr-primary); }
.spr .spr-range::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -9px; background: var(--spr-primary); border: 3px solid #fff; border-radius: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); -webkit-appearance: none; appearance: none; }
.spr .spr-range::-moz-range-thumb { width: 16px; height: 16px; background: var(--spr-primary); border: 3px solid #fff; border-radius: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.spr .spr-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--spr-primary) 25%, transparent); }
.spr .spr-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--spr-primary) 25%, transparent); }
.spr .spr-range-scale { display: flex; justify-content: space-between; width: calc(100% - 160px); margin-top: 2px; color: var(--spr-muted); font-size: 12px; }

/* Turnus als Segmente */
.spr .spr-seg { display: grid; grid-template-columns: repeat(var(--spr-cols, 4), 1fr); }
.spr button.spr-seg-btn,
.spr button.spr-seg-btn:hover,
.spr button.spr-seg-btn:focus {
	display: block;
	width: 100%;
	min-height: 46px;
	margin: 0 0 0 -1px;
	padding: 8px 6px;
	background: #fff;
	border: 1px solid var(--spr-line);
	border-radius: 0;
	box-shadow: none;
	color: var(--spr-text);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-transform: none;
	white-space: normal;
	cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}
.spr button.spr-seg-btn:first-child { margin-left: 0; }
.spr button.spr-seg-btn:hover { position: relative; z-index: 1; border-color: var(--spr-primary); color: var(--spr-primary); }
.spr button.spr-seg-btn:focus-visible { position: relative; z-index: 2; outline: 2px solid var(--spr-primary); outline-offset: 2px; }
.spr button.spr-seg-btn.is-active,
.spr button.spr-seg-btn.is-active:hover,
.spr button.spr-seg-btn.is-active:focus { position: relative; z-index: 1; background: var(--spr-primary); border-color: var(--spr-primary); color: #fff; }

/* ---------- Buttons ---------- */
.spr button.spr-btn,
.spr a.spr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 52px;
	margin: 4px 0 0;
	padding: 14px 26px;
	border: 1px solid var(--spr-primary);
	border-radius: var(--spr-btn-radius);
	box-shadow: none;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	white-space: normal;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.spr button.spr-btn--primary,
.spr button.spr-btn--primary:focus { background: var(--spr-primary); border-color: var(--spr-primary); color: #fff; }
.spr button.spr-btn--primary:hover,
.spr button.spr-btn--primary:active { background: var(--spr-primary-dark); border-color: var(--spr-primary-dark); color: #fff; }
.spr button.spr-btn:focus-visible,
.spr a.spr-btn:focus-visible { outline: 2px solid var(--spr-primary); outline-offset: 3px; }
.spr button.spr-btn:disabled { opacity: .7; cursor: progress; }
.spr .spr-ico { width: 18px; height: 18px; flex: none; }
.spr button.spr-btn--primary:hover .spr-ico { transform: translateX(3px); }
.spr button.spr-btn .spr-ico { transition: transform .15s; }

.spr a.spr-btn--call,
.spr a.spr-btn--call:focus { width: auto; background: var(--spr-call); border-color: var(--spr-call); color: #fff; }
.spr a.spr-btn--call:hover { background: #ec9800; border-color: #ec9800; color: #fff; }
.spr .spr-nowrap { white-space: nowrap; }

/* Text-Links (Zurück, Kontakt) im Stil der Seite: unterstrichen */
.spr button.spr-link,
.spr button.spr-link:hover,
.spr button.spr-link:focus,
.spr a.spr-link {
	display: inline;
	width: auto;
	margin: 0;
	padding: 2px 0;
	background: none;
	border: 0;
	border-bottom: 1px solid currentColor;
	border-radius: 0;
	box-shadow: none;
	color: var(--spr-text);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
}
.spr button.spr-link:hover,
.spr a.spr-link:hover { color: var(--spr-primary); }
.spr button.spr-link:focus-visible,
.spr a.spr-link:focus-visible { outline: 2px solid var(--spr-primary); outline-offset: 3px; }

.spr .spr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.spr .spr-actions .spr-btn { margin-top: 0; }

/* Ladezustand */
.spr.is-loading button.spr-btn--primary::after {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spr-spin .7s linear infinite;
}
.spr.is-loading button.spr-btn--primary .spr-ico { display: none; }
@keyframes spr-spin { to { transform: rotate(360deg); } }

/* ---------- Kontakt-Schritt ---------- */
.spr .spr-step-title { margin-bottom: 4px; color: var(--spr-text); font-size: 20px; font-weight: 700; line-height: 1.3; outline: none; }
.spr .spr-step-text { margin-bottom: 18px; color: var(--spr-muted); font-size: 15px; }
.spr .spr-grid { display: grid; grid-template-columns: 1fr; column-gap: 16px; }

.spr .spr-consent { display: flex; gap: 10px; align-items: flex-start; margin: 0; color: var(--spr-muted); font-size: 13px; font-weight: 400; line-height: 1.5; cursor: pointer; }
.spr .spr-consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--spr-primary); cursor: pointer; }
.spr .spr-consent a { color: var(--spr-primary); text-decoration: underline; }

.spr .spr-error { margin-top: 6px; color: var(--spr-error); font-size: 13px; font-weight: 600; line-height: 1.4; }
.spr .spr-error--form { margin: 0 0 14px; padding: 10px 12px; background: #fdf0ee; border-left: 3px solid var(--spr-error); }

.spr .spr-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Ergebnis ---------- */
.spr .spr-result { outline: none; }
.spr .spr-result-label { margin-bottom: 10px; color: var(--spr-primary); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; outline: none; }
.spr .spr-price { color: var(--spr-primary); font-size: clamp(36px, 12cqi, 52px); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.spr .spr-price--text { font-size: 18px; line-height: 1.45; color: var(--spr-text); font-weight: 600; }
.spr .spr-price-sub { margin-top: 6px; color: var(--spr-muted); font-size: 14px; }
.spr .spr-summary { margin: 18px 0 14px; padding: 12px 14px; background: var(--spr-tint); border-left: 3px solid var(--spr-primary); color: var(--spr-text); font-size: 14px; font-weight: 600; }
.spr .spr-summary:empty { display: none; }
.spr .spr-result-text { color: var(--spr-muted); font-size: 14px; }
.spr .spr-cta { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--spr-line); }
.spr .spr-cta-text { margin-bottom: 12px; font-size: 14px; font-weight: 600; }

/* ---------- Breiter Container ---------- */
@container (min-width: 520px) {
	.spr .spr-grid { grid-template-columns: 1fr 1fr; }
	.spr .spr-field--firma { grid-column: 1 / -1; }
	.spr button.spr-btn { width: auto; min-width: 240px; }
}
@container (min-width: 640px) {
	.spr--voll { padding: 40px 44px; }
}
@container (max-width: 300px) {
	.spr .spr-seg { grid-template-columns: repeat(2, 1fr); }
	.spr button.spr-seg-btn { margin: -1px 0 0 -1px; }
}
@container (max-width: 460px) {
	.spr .spr-qm { grid-template-columns: 1fr; gap: 10px; }
	.spr .spr-qm-box { order: -1; }
	.spr .spr-range-scale { width: 100%; }
}
@media (min-width: 768px) {
	.spr--voll { padding: 40px 44px; }
}

@media (prefers-reduced-motion: reduce) {
	.spr *, .spr *::before, .spr *::after { transition: none !important; animation-duration: 1ms !important; }
}

/* ---------- Preistabelle [spoeckl_preistabelle] ---------- */
.spr-table-wrap { --spr-primary: var(--e-global-color-primary, #0648c7); width: 100%; overflow-x: auto; font-family: inherit; font-variant-numeric: lining-nums tabular-nums; }
.spr-table-wrap .spr-table { width: 100%; min-width: 520px; margin: 0; border: 0; border-collapse: collapse; font-size: 15px; }
.spr-table-wrap .spr-table thead th { padding: 14px 16px; background: var(--spr-primary); border: 0; color: #fff; font-weight: 700; text-align: left; white-space: nowrap; }
.spr-table-wrap .spr-table tbody th,
.spr-table-wrap .spr-table tbody td { padding: 12px 16px; border: 0; border-bottom: 1px solid #e2e4e8; color: var(--e-global-color-text, #333); text-align: left; font-variant-numeric: tabular-nums; }
.spr-table-wrap .spr-table tbody th { font-weight: 700; white-space: nowrap; }
/* Hello Elementor färbt ungerade Zeilen grau ein, deshalb alle Zeilen explizit setzen. */
.spr-table-wrap .spr-table tbody tr th,
.spr-table-wrap .spr-table tbody tr td { background: #fff; }
.spr-table-wrap .spr-table tbody tr:nth-child(even) th,
.spr-table-wrap .spr-table tbody tr:nth-child(even) td { background: #fafafa; }
.spr-table-wrap .spr-table-note { margin: 10px 0 0; color: #666; font-size: 13px; }
