/* IMMOBRA Bewertungsassistent (Gravity-Formular mit Klasse immobra-bewertung-form).
   Eine Frage pro Schritt, eigene Symbole in den Hausfarben, Kacheln, Schieberegler. Wird nur mit dem Formular geladen. */

.immobra-bewertung-form {
	--bw-gold: var(--immobra-gold, #CDA73A);
	--bw-ink: var(--immobra-schiefer, #2B3137);
	--bw-muted: var(--immobra-muted, #687080);
	--bw-line: var(--immobra-line, #DDE0E7);
	--bw-soft: #FBF6E6;
	max-width: 46rem;
	margin-inline: auto;
}

/* Schrittanzeige (bewertung.js) statt der Gravity-Fortschrittsleiste */
.immobra-bewertung-form .gf_progressbar_wrapper { display: none; }
.bw-steps { margin: 0 0 1.75rem; }
.bw-steps__text { margin: 0 0 0.45rem; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; color: var(--bw-muted); font-variant-numeric: tabular-nums; }
.bw-steps__track { height: 6px; overflow: hidden; border-radius: 3px; background: var(--immobra-nebel, #F0F1F6); }
.bw-steps__fill { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--bw-gold); transition: width 0.3s ease; }

/* Fragen */
/* Eine Frage je Schritt nutzt immer die volle Breite, auch wenn das Feld in Gravity Forms auf halbe Breite steht
   (Schritt 9 „Ausstattung“ hatte nur 53 px breite Kacheln, gemeldet 14.09.2026). */
.gform_wrapper .immobra-bewertung-form .gform_fields > .gfield.bw-q,
.gform_wrapper .immobra-bewertung-form .gform_fields > .gfield.bw-choice-tiles { grid-column: 1 / -1; }
.immobra-bewertung-form .bw-q > .gfield_label,
.immobra-bewertung-form .bw-q > legend.gfield_label,
.immobra-bewertung-form .bw-question {
	display: block;
	width: 100%;
	margin: 0 0 1.25rem;
	padding: 0;
	font-family: var(--wp--preset--font-family--display, Georgia, serif);
	font-size: clamp(1.3rem, 3.2vw, 1.7rem);
	font-weight: 400;
	line-height: 1.25;
	text-align: center;
	text-wrap: balance;
	text-transform: none;
	letter-spacing: 0;
	color: var(--bw-ink);
}
.immobra-bewertung-form .bw-q .gfield_required { display: none; }
.immobra-bewertung-form .bw-q > .gfield_description,
.immobra-bewertung-form .bw-lead { margin: -0.75rem 0 1.25rem; text-align: center; font-size: 0.92rem; color: var(--bw-muted); }
.immobra-bewertung-form .bw-intro { margin-bottom: 0.25rem; }

/* Symbol über der Frage */
/* Nur Einzelangaben: die Kurzform „background“ würde das Bild aus den (weniger spezifischen) Symbolregeln zurücksetzen. */
.immobra-bewertung-form .bw-icon::before {
	content: "";
	display: block;
	width: 8.5rem;
	height: 6.375rem;
	margin: 0 auto 0.5rem;
	background-position: center;
	background-size: contain;
	background-repeat: no-repeat;
}
.bw-icon--schritt-wohneinheiten::before { background-image: url(../img/bewertung/schritt-wohneinheiten.svg); }
.bw-icon--schritt-wohnflaeche::before { background-image: url(../img/bewertung/schritt-wohnflaeche.svg); }
.bw-icon--schritt-grundstuecksflaeche::before { background-image: url(../img/bewertung/schritt-grundstuecksflaeche.svg); }
.bw-icon--schritt-zimmer::before { background-image: url(../img/bewertung/schritt-zimmer.svg); }
.bw-icon--schritt-baujahr::before { background-image: url(../img/bewertung/schritt-baujahr.svg); }
.bw-icon--schritt-vermietung::before { background-image: url(../img/bewertung/schritt-vermietung.svg); }
.bw-icon--schritt-energieausweis::before { background-image: url(../img/bewertung/schritt-energieausweis.svg); }
.bw-icon--schritt-adresse::before { background-image: url(../img/bewertung/schritt-adresse.svg); }
.bw-icon--schritt-zeitpunkt::before { background-image: url(../img/bewertung/schritt-zeitpunkt.svg); }
.bw-icon--schritt-kontakt::before { background-image: url(../img/bewertung/schritt-kontakt.svg); }
.bw-icon--leistung-handwerker::before { background-image: url(../img/bewertung/leistung-handwerker.svg); }
.bw-icon--hm-treppenhaus::before { background-image: url(../img/bewertung/hm-treppenhaus.svg); }

/* Bildkacheln (Gravity Forms Image Choices). Spalten richten sich nach der Breite des Formulars, nicht des Fensters. */
.immobra-bewertung-form { container-type: inline-size; }
/* Mit .gform_wrapper davor, damit das Gravity-Theme-Framework (setzt .gfield_radio auf display:flex) nicht gewinnt,
   egal in welcher Reihenfolge die Stylesheets geladen werden (Fehler auf der Kontaktseite, 13.09.2026). */
.gform_wrapper .immobra-bewertung-form .bw-tiles .gfield_radio,
.gform_wrapper .immobra-bewertung-form .bw-tiles .gfield_checkbox {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
}
.gform_wrapper .immobra-bewertung-form .bw-tiles--3 .gchoice:last-child,
.gform_wrapper .immobra-bewertung-form .bw-tiles--5 .gchoice:last-child { grid-column: 1 / -1; }
@container (min-width: 24rem) {
	.gform_wrapper .immobra-bewertung-form .bw-tiles--3 .gfield_radio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.gform_wrapper .immobra-bewertung-form .bw-tiles--3 .gchoice:last-child { grid-column: auto; }
}
@container (min-width: 30rem) {
	.gform_wrapper .immobra-bewertung-form .bw-tiles--5 .gfield_radio,
	.gform_wrapper .immobra-bewertung-form .bw-tiles--6 .gfield_radio,
	.gform_wrapper .immobra-bewertung-form .bw-tiles--6 .gfield_checkbox { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.gform_wrapper .immobra-bewertung-form .bw-tiles--5 .gchoice:last-child { grid-column: auto; }
}
@container (min-width: 36rem) {
	.gform_wrapper .immobra-bewertung-form .bw-tiles--4 .gfield_radio,
	.gform_wrapper .immobra-bewertung-form .bw-tiles--4 .gfield_checkbox { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container (min-width: 42rem) {
	.gform_wrapper .immobra-bewertung-form .bw-tiles--5 .gfield_radio { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.immobra-bewertung-form .bw-tiles .image-choices-choice-text { hyphens: auto; overflow-wrap: anywhere; }
.immobra-bewertung-form .bw-tiles .gchoice,
.immobra-bewertung-form .bw-choice-tiles .gchoice { position: relative; margin: 0; }
.immobra-bewertung-form .bw-tiles .gchoice input,
.immobra-bewertung-form .bw-choice-tiles .gchoice input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}
.immobra-bewertung-form .bw-tiles .gchoice label,
.immobra-bewertung-form .bw-choice-tiles .gchoice label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	padding: 0.6rem 0.6rem 0.85rem;
	border: 2px solid var(--bw-line);
	border-radius: 8px;
	background: #FFFFFF;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.25;
	text-align: center;
	color: var(--bw-ink);
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.immobra-bewertung-form .bw-choice-tiles .gchoice label { padding: 0.85rem 1rem; }
.immobra-bewertung-form .bw-tiles .gchoice label:hover,
.immobra-bewertung-form .bw-choice-tiles .gchoice label:hover {
	border-color: var(--bw-gold);
	box-shadow: 0 12px 24px -18px rgba(43, 49, 55, 0.5);
	transform: translateY(-2px);
}
.immobra-bewertung-form .bw-tiles .gchoice input:focus-visible + label,
.immobra-bewertung-form .bw-choice-tiles .gchoice input:focus-visible + label { outline: 3px solid var(--bw-gold); outline-offset: 2px; }
.immobra-bewertung-form .bw-tiles .gchoice input:checked + label,
.immobra-bewertung-form .bw-choice-tiles .gchoice input:checked + label { border-color: var(--bw-gold); background: var(--bw-soft); }
.immobra-bewertung-form .bw-tiles .gfield_checkbox .gchoice input:checked + label::after {
	content: "";
	position: absolute;
	top: 0.45rem;
	right: 0.45rem;
	width: 1.3rem;
	height: 1.3rem;
	border-radius: 50%;
	background: var(--bw-gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}
/* Image Choices setzt feste 100 × 100 px und background-size: cover; Kacheln sollen mit der Spalte wachsen. */
.immobra-bewertung-form .bw-tiles .image-choices-choice-image-wrap {
	display: block !important;
	width: 100% !important;
	max-width: 11rem !important;
	height: auto !important;
	margin-inline: auto;
	aspect-ratio: 4 / 3;
	background-position: center !important;
	background-size: contain !important;
	background-repeat: no-repeat !important;
}
.immobra-bewertung-form .bw-tiles .gchoice { display: block; width: auto; min-width: 0; }
.immobra-bewertung-form .bw-tiles .gfield_radio,
.immobra-bewertung-form .bw-tiles .gfield_checkbox { width: 100%; }
.immobra-bewertung-form .image-choices-choice-image { display: none; }
.immobra-bewertung-form .bw-choice-tiles .gfield_radio {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	gap: 0.6rem;
}
.immobra-bewertung-form .bw-choice-tiles--inline .gfield_radio { grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); }
.immobra-bewertung-form .bw-choice-tiles:not(.bw-q) > .gfield_label { font-weight: 700; }

/* Schieberegler */
.immobra-bewertung-form .bw-range__ui { display: grid; gap: 0.35rem; margin: 0 0 1rem; }
.immobra-bewertung-form .bw-range__value {
	display: block;
	font-family: var(--wp--preset--font-family--display, Georgia, serif);
	font-size: clamp(2rem, 6vw, 2.6rem);
	line-height: 1.1;
	text-align: center;
	color: var(--bw-ink);
	font-variant-numeric: tabular-nums;
}
.immobra-bewertung-form .bw-range__slider { width: 100%; height: 2.25rem; margin: 0; accent-color: var(--bw-gold); cursor: pointer; }
.immobra-bewertung-form .bw-range__scale { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--bw-muted); font-variant-numeric: tabular-nums; }
.immobra-bewertung-form .bw-range .ginput_container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.35rem 0.75rem; }
.immobra-bewertung-form .bw-range__exact { font-size: 0.85rem; color: var(--bw-muted); }
.immobra-bewertung-form .bw-range .ginput_container input { max-width: 9rem; text-align: center; }
/* Der Regler zeigt die Grenzen schon; den Gravity-Hinweis „Bitte gib eine Zahl von … ein“ nur bei einem Fehler zeigen. */
.immobra-bewertung-form .bw-range:not(.gfield_error) .gfield_description.instruction { display: none; }

/* Navigation */
.immobra-bewertung-form .gform_page_footer {
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 1.75rem;
	padding-top: 1.1rem;
	border-top: 1px solid var(--bw-line);
}
.immobra-bewertung-form .gform_page_footer .gform_previous_button {
	padding-inline: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--bw-ink) !important;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Abschluss */
#gform_confirmation_message_9::before {
	content: "";
	display: block;
	width: 7rem;
	height: 5.25rem;
	margin: 0 auto 1rem;
	background: url(../img/bewertung/fertig.svg) center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
	.bw-steps__fill,
	.immobra-bewertung-form .bw-tiles .gchoice label,
	.immobra-bewertung-form .bw-choice-tiles .gchoice label { transition: none; }
	.immobra-bewertung-form .bw-tiles .gchoice label:hover,
	.immobra-bewertung-form .bw-choice-tiles .gchoice label:hover { transform: none; }
}

/* Dankesmeldung der Formularstrecken ohne eigene Auswertung (z. B. Gewerbeimmobilie anbieten, 15.09.2026) */
.bw-danke { padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--immobra-line, #DDE0E7); border-top: 2px solid var(--immobra-gold, #CDA73A); border-radius: 4px; background: #FFFFFF; }
.bw-danke h2 { margin: 0 0 0.6rem; font-family: var(--wp--preset--font-family--display, Georgia, serif); font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 400; letter-spacing: 0.01em; text-transform: none; color: var(--immobra-schiefer, #2B3137); }
.bw-danke p { margin: 0.5rem 0 0; max-width: 62ch; }
.bw-danke a { color: var(--immobra-gold-text, #86660F); }
