/* Realtor Bot Quiz. Scoped under #rbq-root / #rbq-launcher so it cannot affect the theme.
   Colours, radius and sizes follow the live WPResidence variables, with fallbacks. */
#rbq-root,
#rbq-launcher,
.rbq-inline-btn {
	--rbq-main: var(--wp-estate-main-color-option, #2a4b40);
	--rbq-hover: var(--wp-estate-hover-button-color-option, #213b32);
	--rbq-text: var(--wp-estate-font-color, #5c727d);
	--rbq-heading: #222;
	--rbq-bg: var(--wp-estate-background-color, #f8f8f8);
	--rbq-line: #e6eaec;
	--rbq-tint: #eef2f0;
	--rbq-radius: var(--wp-estate-border-radius-corner-option, 10px);
	--rbq-shadow: var(--wp-estate-cssbox-shadow-elementor-option, 0 10px 27px 0 rgba(7, 152, 255, .08));
	font-size: 14px;
	line-height: 1.65;
	box-sizing: border-box;
}
#rbq-root *,
#rbq-root *::before,
#rbq-root *::after { box-sizing: border-box; }

#rbq-root {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	color: var(--rbq-text);
	background: rgba(24, 28, 35, .55);
	animation: rbq-fade .2s ease;
}
#rbq-root[hidden] { display: none; }

#rbq-root .rbq-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 640px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	background: #fff;
	border-radius: var(--rbq-radius);
	box-shadow: 0 5px 70px 0 rgba(38, 42, 76, .25);
	overflow: hidden;
	animation: rbq-rise .28s ease;
}
#rbq-root .rbq-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 28px; }
#rbq-root .rbq-screen { animation: rbq-slide .25s ease; }

#rbq-root button { font-family: inherit; text-transform: none; letter-spacing: normal; margin: 0; }
#rbq-root .rbq-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	color: var(--rbq-text);
	background: rgba(255, 255, 255, .9);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
}
#rbq-root .rbq-close:hover { color: var(--rbq-heading); background: var(--rbq-tint); }

#rbq-root .rbq-progress { height: 4px; flex: none; background: var(--rbq-tint); }
#rbq-root .rbq-progress span { display: block; height: 100%; background: var(--rbq-main); transition: width .3s ease; }

#rbq-root .rbq-step { margin: 0 0 4px; padding-right: 32px; font-size: 13px; font-weight: 500; color: var(--rbq-text); }
#rbq-root .rbq-title {
	margin: 0 0 20px;
	padding: 0 32px 0 0;
	font-family: inherit;
	font-size: 24px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--rbq-heading);
	background: none;
	text-transform: none;
}

/* Robot */
#rbq-root .rbq-robot { display: block; width: 104px; height: 104px; margin: 0 auto 12px; }
#rbq-root .rbq-robot--small { width: 76px; height: 76px; margin-bottom: 6px; }
.rbq-robot svg { display: block; width: 100%; height: 100%; }
.rbq-arm { transform-box: fill-box; transform-origin: 50% 100%; animation: rbq-wave 1.5s ease-in-out infinite; }
.rbq-eye { transform-box: fill-box; transform-origin: center; animation: rbq-blink 4s infinite; }
.rbq-robot--calm { animation: rbq-bob 2.8s ease-in-out infinite; }
.rbq-robot--calm .rbq-arm { animation: rbq-wave 1.5s ease-in-out 2; }

/* Welcome */
#rbq-root .rbq-welcome { text-align: center; padding-top: 4px; }
#rbq-root .rbq-welcome p { margin: 0 auto 22px; max-width: 460px; font-size: 18px; font-weight: 500; line-height: 1.5; color: var(--rbq-heading); }

/* Buttons */
#rbq-root .rbq-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
#rbq-root .rbq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 34px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	color: #fff;
	text-align: center;
	text-decoration: none;
	background: var(--rbq-main);
	border: 1px solid var(--rbq-main);
	border-radius: var(--rbq-radius);
	box-shadow: none;
	cursor: pointer;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}
#rbq-root .rbq-btn:hover { color: #fff; background: var(--rbq-hover); border-color: var(--rbq-hover); }
#rbq-root .rbq-btn--ghost { color: var(--rbq-main); background: #fff; }
#rbq-root .rbq-btn--ghost:hover { color: var(--rbq-main); background: var(--rbq-tint); border-color: var(--rbq-main); }
#rbq-root .rbq-back {
	display: inline-block;
	margin-top: 18px;
	padding: 6px 0;
	font-size: 14px;
	font-weight: 500;
	color: var(--rbq-text);
	background: none;
	border: 0;
	box-shadow: none;
	cursor: pointer;
}
#rbq-root .rbq-back:hover { color: var(--rbq-main); background: none; }
#rbq-root .rbq-btn:focus-visible,
#rbq-root .rbq-back:focus-visible,
#rbq-root .rbq-card:focus-visible,
#rbq-root .rbq-close:focus-visible,
#rbq-root .rbq-seg button:focus-visible,
#rbq-root input:focus-visible,
#rbq-launcher:focus-visible { outline: 2px solid var(--rbq-main); outline-offset: 2px; }

/* Answer cards */
#rbq-root .rbq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#rbq-root .rbq-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 128px;
	padding: 16px 10px;
	color: var(--rbq-heading);
	text-align: center;
	background: #fff;
	border: 1px solid var(--rbq-line);
	border-radius: var(--rbq-radius);
	box-shadow: var(--rbq-shadow);
	cursor: pointer;
	transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
#rbq-root .rbq-card:hover { color: var(--rbq-heading); background: #fff; border-color: var(--rbq-main); transform: translateY(-2px); }
#rbq-root .rbq-card.is-selected,
#rbq-root .rbq-card.is-selected:hover { color: #fff; background: var(--rbq-main); border-color: var(--rbq-main); transform: none; }
#rbq-root .rbq-card svg { display: block; width: 36px; height: 36px; color: var(--rbq-main); }
#rbq-root .rbq-card.is-selected svg,
#rbq-root .rbq-card.is-selected .rbq-count { color: #fff; }
#rbq-root .rbq-label { font-size: 14px; font-weight: 500; line-height: 1.3; color: inherit; }
#rbq-root .rbq-count { font-size: 12px; font-weight: 400; line-height: 1.2; color: var(--rbq-text); }
#rbq-root .rbq-grid--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#rbq-root .rbq-grid--compact .rbq-card { min-height: 92px; padding: 10px 8px; }
#rbq-root .rbq-grid--compact .rbq-card svg { width: 22px; height: 22px; }
#rbq-root .rbq-grid--compact .rbq-any { grid-column: 1 / -1; min-height: 52px; flex-direction: row; }

/* Price */
#rbq-root .rbq-seg { display: inline-flex; margin-bottom: 18px; background: var(--rbq-tint); border-radius: var(--rbq-radius); padding: 3px; }
#rbq-root .rbq-seg button {
	min-width: 72px;
	min-height: 36px;
	padding: 4px 14px;
	font-size: 14px;
	font-weight: 500;
	color: var(--rbq-text);
	background: none;
	border: 0;
	border-radius: 8px;
	box-shadow: none;
	cursor: pointer;
}
#rbq-root .rbq-seg button.is-on { color: #fff; background: var(--rbq-main); }
#rbq-root .rbq-slider { position: relative; height: 32px; margin: 0 2px 16px; }
#rbq-root .rbq-track,
#rbq-root .rbq-fill { position: absolute; top: 14px; height: 4px; border-radius: 2px; }
#rbq-root .rbq-track { left: 0; right: 0; background: var(--rbq-line); }
#rbq-root .rbq-fill { background: var(--rbq-main); }
#rbq-root .rbq-slider input[type="range"] {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 32px;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}
#rbq-root .rbq-slider input[type="range"]::-webkit-slider-runnable-track { background: none; border: 0; }
#rbq-root .rbq-slider input[type="range"]::-moz-range-track { background: none; border: 0; }
#rbq-root .rbq-slider input[type="range"]::-webkit-slider-thumb {
	width: 24px;
	height: 24px;
	background: #fff;
	border: 2px solid var(--rbq-main);
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
	cursor: grab;
	pointer-events: auto;
	-webkit-appearance: none;
	appearance: none;
}
#rbq-root .rbq-slider input[type="range"]::-moz-range-thumb {
	width: 20px;
	height: 20px;
	background: #fff;
	border: 2px solid var(--rbq-main);
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
	cursor: grab;
	pointer-events: auto;
}
#rbq-root .rbq-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#rbq-root .rbq-field span { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; color: var(--rbq-text); }
#rbq-root .rbq-field input {
	display: block;
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 0 12px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	color: var(--rbq-heading);
	background: #fff;
	border: 1px solid var(--rbq-line);
	border-radius: var(--rbq-radius);
	box-shadow: none;
}
#rbq-root .rbq-field input:focus { border-color: var(--rbq-main); }
#rbq-root .rbq-converted { margin: 10px 0 20px; font-size: 13px; color: var(--rbq-text); }
#rbq-root .rbq-price-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#rbq-root .rbq-price-actions .rbq-btn { padding-left: 12px; padding-right: 12px; }

/* Result */
#rbq-root .rbq-result-head { text-align: center; margin-bottom: 16px; }
#rbq-root .rbq-result-head .rbq-title { margin: 0; padding: 0 20px; font-size: 18px; font-weight: 600; }
#rbq-root .rbq-property {
	background: #fff;
	border-radius: var(--rbq-radius);
	box-shadow: var(--rbq-shadow);
	border: 1px solid var(--rbq-line);
	overflow: hidden;
	animation: rbq-slide .28s ease;
}
#rbq-root .rbq-photo { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--rbq-tint); overflow: hidden; }
#rbq-root .rbq-photo img { display: block; width: 100%; height: 100%; margin: 0; max-width: none; object-fit: cover; border-radius: 0; }
#rbq-root .rbq-photo-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--rbq-main); }
#rbq-root .rbq-photo-empty svg { width: 56px; height: 56px; }
#rbq-root .rbq-tag {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 2px 10px;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.8;
	color: #fff;
	background: rgba(42, 75, 64, .85);
	border-radius: 2px;
}
#rbq-root .rbq-tag--similar { left: auto; right: 10px; background: rgba(24, 28, 35, .75); }
#rbq-root .rbq-body { padding: 16px 20px 20px; }
#rbq-root .rbq-property-title { margin: 0 0 6px; font-family: inherit; font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--rbq-heading); }
#rbq-root .rbq-price { font-size: 17px; font-weight: 500; line-height: 1.4; color: var(--rbq-main); }
#rbq-root .rbq-price small { margin-left: 6px; font-size: 14px; font-weight: 400; color: var(--rbq-text); }
#rbq-root .rbq-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 16px; padding: 0; list-style: none; }
#rbq-root .rbq-facts li { display: flex; align-items: center; gap: 5px; margin: 0; padding: 0; font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--rbq-text); }
#rbq-root .rbq-facts li::before { content: none; }
#rbq-root .rbq-facts svg { flex: none; width: 15px; height: 15px; color: var(--rbq-main); }
#rbq-root .rbq-body .rbq-btn { width: 100%; }
#rbq-root .rbq-result-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
#rbq-root .rbq-result-actions .rbq-counter { font-size: 13px; color: var(--rbq-text); }
#rbq-root .rbq-result-actions .rbq-back { margin: 0; }
#rbq-root .rbq-empty { margin: 0 0 18px; text-align: center; }

/* Loading */
#rbq-root .rbq-loading { display: flex; justify-content: center; padding: 56px 0; }
#rbq-root .rbq-spinner { width: 34px; height: 34px; border: 3px solid var(--rbq-tint); border-top-color: var(--rbq-main); border-radius: 50%; animation: rbq-spin .8s linear infinite; }

/* Launcher and shortcode button */
#rbq-launcher {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 6px 18px 6px 6px;
	font-family: inherit;
	font-weight: 500;
	line-height: 1.2;
	color: #fff;
	text-transform: none;
	background: var(--rbq-main);
	border: 0;
	border-radius: 30px;
	box-shadow: 0 8px 24px rgba(24, 28, 35, .28);
	cursor: pointer;
	transition: background .2s ease, transform .2s ease;
}
#rbq-launcher:hover { color: #fff; background: var(--rbq-hover); transform: translateY(-2px); }
#rbq-launcher[hidden] { display: none; }
#rbq-launcher .rbq-robot { display: block; width: 44px; height: 44px; padding: 3px; background: #fff; border-radius: 50%; }
.rbq-inline-btn {
	display: inline-block;
	min-height: 44px;
	padding: 8px 34px;
	font-family: inherit;
	font-weight: 500;
	color: #fff;
	background: var(--rbq-main);
	border: 1px solid var(--rbq-main);
	border-radius: var(--rbq-radius);
	cursor: pointer;
}
.rbq-inline-btn:hover { color: #fff; background: var(--rbq-hover); border-color: var(--rbq-hover); }
body.rbq-locked { overflow: hidden; }

@media (max-width: 560px) {
	#rbq-root { padding: 0; align-items: flex-end; }
	#rbq-root .rbq-dialog { max-height: 94vh; max-height: 94dvh; border-radius: var(--rbq-radius) var(--rbq-radius) 0 0; }
	#rbq-root .rbq-scroll { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
	#rbq-root .rbq-title { font-size: 20px; }
	#rbq-root .rbq-robot--small { width: 56px; height: 56px; }
	#rbq-root .rbq-result-head .rbq-title { font-size: 16px; }
	#rbq-root .rbq-welcome p { font-size: 16px; }
	#rbq-root .rbq-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	#rbq-root .rbq-card { min-height: 112px; }
	#rbq-root .rbq-actions .rbq-btn { flex: 1 1 100%; }
	#rbq-root .rbq-result-actions .rbq-btn { flex: 1 1 100%; order: -1; }
	#rbq-launcher { right: 12px; bottom: 12px; }
	#rbq-launcher .rbq-launcher-text { display: none; }
	#rbq-launcher { padding: 5px; }
}

@keyframes rbq-fade { from { opacity: 0; } }
@keyframes rbq-rise { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes rbq-slide { from { opacity: 0; transform: translateY(8px); } }
@keyframes rbq-spin { to { transform: rotate(360deg); } }
@keyframes rbq-bob { 50% { transform: translateY(-4px); } }
@keyframes rbq-wave {
	0%, 100% { transform: rotate(0); }
	20%, 60% { transform: rotate(22deg); }
	40%, 80% { transform: rotate(-12deg); }
}
@keyframes rbq-blink {
	0%, 94%, 100% { transform: scaleY(1); }
	97% { transform: scaleY(.1); }
}

@media (prefers-reduced-motion: reduce) {
	#rbq-root *,
	#rbq-root,
	#rbq-launcher,
	#rbq-launcher * { animation: none !important; transition: none !important; }
}
