/* ECFB Dynamic Wizard – steps (questions), results, choice cards */

.ecfb-dynamic-wizard {
	position: relative;
}

.ecfb-dw-steps,
.ecfb-dw-results {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ecfb-dw-step,
.ecfb-dw-result {
	display: block;
}

/* סדר: כותרת → תוכן → אופציות */
.ecfb-dw-step {
	display: flex;
	flex-direction: column;
}
.ecfb-dw-step__title {
	order: 1;
}
.ecfb-dw-step__content {
	order: 2;
	margin-bottom: 0.5em;
}
.ecfb-dw-choices {
	order: 3;
}

.ecfb-dw-result__slot {
	margin-top: 0.5em;
	margin-bottom: 1em;
}

.ecfb-dw-step.ecfb-dw-hidden,
.ecfb-dw-result.ecfb-dw-hidden,
.ecfb-dw-choices.ecfb-dw-hidden {
	display: none !important;
}

.ecfb-dw-step__title {
	margin: 0 0 0.5em;
	font-size: 1.25em;
}

.ecfb-dw-choices {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 0.75em;
	margin-top: 0.5em; /* fallback; overridden by "Space between content and options" in widget */
}

.ecfb-dw-choice {
	position: relative;
	display: block;
	cursor: pointer;
}

.ecfb-dw-choice input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.ecfb-dw-choice__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.35em;
	min-height: 4em;
	padding: 0.75em 1em;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #f8f8f8;
	transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

/* Icon/image position: below / left / right (above = default column) */
.ecfb-dw-icon--below .ecfb-dw-choice__card {
	flex-direction: column-reverse;
}
.ecfb-dw-icon--left .ecfb-dw-choice__card {
	flex-direction: row;
}
.ecfb-dw-icon--right .ecfb-dw-choice__card {
	flex-direction: row-reverse;
}
.ecfb-dw-icon--left .ecfb-dw-choice__text,
.ecfb-dw-icon--right .ecfb-dw-choice__text {
	text-align: start;
}

.ecfb-dw-choice:hover .ecfb-dw-choice__card {
	border-color: #999;
	background: #eee;
}

.ecfb-dw-choice input:checked + .ecfb-dw-choice__card {
	border-color: #2271b1;
	background: #f0f6fc;
}

.ecfb-dw-choice__icon {
	font-size: 1.5em;
	line-height: 1;
}

.ecfb-dw-choice__img-wrap {
	display: block;
	line-height: 0;
}

.ecfb-dw-choice__img {
	display: block;
	width: 48px;
	height: 48px;
	object-fit: contain;
}

.ecfb-dw-choice__text {
	font-size: 0.9em;
	text-align: center;
	transition: color 0.2s;
}

/* Back + Reset */
.ecfb-dw-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	margin-top: 1em;
}

.ecfb-dw-back {
	display: inline-block;
	padding: 0.5em 1em;
	font-size: 0.95em;
	font-weight: 600;
	color: #555;
	background-color: #eee;
	border: 1px solid #ccc;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s;
}
.ecfb-dw-back:hover {
	background-color: #e0e0e0;
	border-color: #999;
}

.ecfb-dw-reset {
	display: inline-block;
	padding: 0.5em 1em;
	font-size: 0.95em;
	font-weight: 600;
	color: #fff;
	background-color: #2271b1;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s;
}

.ecfb-dw-reset:hover {
	background-color: #135e96;
}
