/* HUBB Quiz */
.hq-root *,
.hq-root *::before,
.hq-root *::after { box-sizing: border-box; }

.hq-root {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	background: var(--hq-page-bg);
	color: var(--hq-text);
	font-family: var(--hq-font);
	-webkit-font-smoothing: antialiased;
	overflow: hidden;
	padding: var(--hq-frame, 8px);
}

/* Header */
.hq-header {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 16px 24px;
	background: var(--hq-header-bg);
	border-bottom: 1px solid var(--hq-header-border);
	color: var(--hq-header-text);
	flex: 0 0 auto;
	z-index: 2;
}
.hq-header-left { display: flex; flex-direction: column; gap: 6px; }
.hq-header-center { text-align: center; }
.hq-progress-text { font-size: 13px; font-weight: 500; letter-spacing: 0.5px; }
.hq-progress-bar {
	height: var(--hq-progress-h);
	background: var(--hq-progress-track);
	width: 100%;
	border-radius: 0;
	overflow: hidden;
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
}
.hq-progress-fill {
	display: block;
	height: 100%;
	background: var(--hq-progress-color);
	transition: width 0.4s ease;
}
.hq-logo {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 2px;
}
.hq-logo img { display: block; max-height: 36px; width: auto; }

/* Stage */
.hq-stage {
	flex: 1 1 auto;
	position: relative;
	overflow: hidden;
}
.hq-screen {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: row;
	opacity: 0;
	visibility: hidden;
	transform: translateX(20px);
	transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
	overflow-y: auto;
}
.hq-screen.is-active {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
	transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0s;
}
.hq-screen.is-leaving { transform: translateX(-20px); }

/* Sides */
.hq-side {
	min-height: 100%;
	display: flex;
	flex-direction: column;
}
.hq-side-form {
	flex: 0 0 var(--hq-split);
	max-width: var(--hq-split);
	padding: var(--hq-form-p);
	justify-content: center;
	align-items: center;
}
.hq-side-image {
	flex: 1 1 auto;
	position: relative;
	overflow: hidden;
	background: #f4f4f4;
}
.hq-side-image .hq-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--hq-image-r);
}

/* Form inner */
.hq-form-inner {
	width: 100%;
	max-width: var(--hq-form-max);
	display: flex;
	flex-direction: column;
}
.hq-form-center { text-align: center; align-items: stretch; }
.hq-form-center .hq-options { text-align: left; }

/* Intro layout: vertical space-between (top group + bottom group) */
.hq-screen-intro .hq-side-form { align-items: center; justify-content: stretch; }
.hq-form-intro {
	flex: 1 1 auto;
	align-self: center;
	justify-content: space-between;
	min-height: 100%;
}
.hq-intro-top, .hq-intro-bottom { display: flex; flex-direction: column; }

/* Badge */
.hq-badge {
	display: inline-block;
	background: var(--hq-badge-bg);
	color: var(--hq-badge-text);
	border: 1px solid var(--hq-badge-border);
	padding: var(--hq-badge-p);
	border-radius: var(--hq-badge-r);
	font-size: var(--hq-badge-size);
	font-weight: var(--hq-badge-weight);
	letter-spacing: var(--hq-badge-ls);
	align-self: flex-start;
	margin-bottom: 18px;
}
.hq-badge-center { align-self: center; }
.hq-badge-small { font-size: 11px; padding: 4px 10px; }

/* Heading & body */
.hq-heading {
	font-size: var(--hq-h-size);
	font-weight: var(--hq-h-weight);
	line-height: var(--hq-h-lh);
	letter-spacing: var(--hq-h-ls);
	color: var(--hq-text);
	margin: 0 0 16px;
}
.hq-heading-center { text-align: center; }
.hq-desc {
	font-size: var(--hq-body-size);
	font-weight: var(--hq-body-weight);
	line-height: var(--hq-body-lh);
	color: var(--hq-text);
	margin: 0 0 28px;
}
.hq-desc-center { text-align: center; }

/* Options */
.hq-options {
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--hq-option-gap);
}
.hq-option {
	display: flex;
	flex-direction: column;
	gap: 4px;
	background: var(--hq-option-bg);
	border: var(--hq-option-bw) solid var(--hq-option-bd);
	border-radius: var(--hq-option-r);
	padding: var(--hq-option-p);
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
	outline: none;
}
.hq-option:hover {
	background: var(--hq-option-bg-h);
	border-color: var(--hq-option-bd-h);
}
.hq-option:focus-visible {
	border-color: var(--hq-option-bd-a);
	box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}
.hq-option.is-selected {
	background: var(--hq-option-bg-a);
	border-color: var(--hq-option-bd-a);
}
.hq-option-title {
	font-size: var(--hq-opt-title-size);
	font-weight: var(--hq-opt-title-weight);
	color: var(--hq-option-title);
}
.hq-option-desc {
	font-size: var(--hq-opt-desc-size);
	font-weight: var(--hq-opt-desc-weight);
	color: var(--hq-option-desc);
}

/* Buttons */
.hq-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.hq-actions-row { flex-direction: row; align-items: stretch; }
.hq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-family: inherit;
	font-size: var(--hq-btn-size);
	font-weight: var(--hq-btn-weight);
	letter-spacing: var(--hq-btn-ls);
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
	text-decoration: none;
	line-height: 1;
	user-select: none;
}
.hq-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.hq-btn-block { width: 100%; }
.hq-btn-flex { flex: 1 1 auto; }
.hq-btn-primary {
	background: var(--hq-btn-bg) !important;
	color: var(--hq-btn-text) !important;
	border-color: var(--hq-btn-bd) !important;
	border-radius: var(--hq-btn-r) !important;
	padding: var(--hq-btn-p) !important;
}
.hq-btn-primary:hover:not(:disabled) {
	background: var(--hq-btn-bg-h) !important;
	color: var(--hq-btn-text-h) !important;
}
.hq-btn-secondary {
	background: var(--hq-btn2-bg) !important;
	color: var(--hq-btn2-text) !important;
	border-color: var(--hq-btn2-bd) !important;
	border-radius: var(--hq-btn2-r) !important;
	padding: var(--hq-btn2-p) !important;
	flex: 0 0 auto;
	min-width: 140px;
}
.hq-btn-secondary:hover {
	background: var(--hq-btn2-bg-h) !important;
	color: var(--hq-btn2-text-h) !important;
}
.hq-btn-arrow svg { width: 18px; height: 18px; }

/* Email input */
.hq-email-form { display: flex; flex-direction: column; gap: 14px; }
.hq-input-wrap {
	position: relative;
	display: flex;
	align-items: center;
	background: var(--hq-input-bg);
	border: 1px solid var(--hq-input-bd);
	border-radius: var(--hq-btn-r);
	padding: 0 16px;
	transition: border-color 0.2s ease;
}
.hq-input-wrap:focus-within { border-color: var(--hq-text); }
.hq-input-icon { width: 20px; height: 20px; color: var(--hq-text-muted); flex-shrink: 0; }
.hq-input {
	flex: 1 1 auto;
	background: transparent;
	border: 0;
	outline: none;
	padding: 18px 14px;
	font-size: 16px;
	font-family: inherit;
	color: var(--hq-input-text);
	width: 100%;
}
.hq-input::placeholder { color: var(--hq-input-ph); }

/* Spinner */
.hq-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255,255,255,0.4);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: hq-spin 0.7s linear infinite;
}
.hq-btn.is-loading .hq-btn-label { opacity: 0.6; }
.hq-btn.is-loading .hq-spinner { display: inline-block; }
.hq-btn.is-loading { pointer-events: none; }
@keyframes hq-spin { to { transform: rotate(360deg); } }

/* Disclaimer & error */
.hq-disclaimer {
	font-size: var(--hq-disc-size);
	line-height: var(--hq-disc-lh);
	color: var(--hq-text-muted);
	margin: 16px 0 0;
}
.hq-disclaimer-center { text-align: center; }
.hq-disclaimer a { color: inherit; text-decoration: underline; }
.hq-error {
	color: #c0392b;
	font-size: 13px;
	margin: 0;
	min-height: 18px;
}

/* Overlay text on image */
.hq-overlay {
	position: absolute;
	color: var(--hq-overlay);
	font-size: var(--hq-overlay-size);
	font-weight: var(--hq-overlay-weight);
	line-height: 1.05;
	letter-spacing: -0.01em;
	max-width: 90%;
	pointer-events: none;
	z-index: 2;
}
.hq-overlay-bottom-left { left: 6%; bottom: 6%; }
.hq-overlay-bottom-right { right: 6%; bottom: 6%; text-align: right; }
.hq-overlay-top-left { left: 6%; top: 6%; }
.hq-overlay-top-right { right: 6%; top: 6%; text-align: right; }
.hq-overlay-center {
	left: 50%; top: 50%;
	transform: translate(-50%,-50%);
	text-align: center;
}

/* Result screen */
.hq-screen-result { flex-direction: column; padding: 0; }
.hq-screen-result .hq-side { display: none; }
.hq-result-content { width: 100%; flex: 1 1 auto; overflow-y: auto; }
.hq-result {
	display: flex;
	flex-direction: column;
	min-height: 100%;
}
.hq-result-top {
	padding: 60px 24px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.hq-result-top .hq-heading { max-width: 720px; }
.hq-result-top .hq-desc { max-width: 560px; }

.hq-product-card {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	background: var(--hq-option-bg-a);
	border-radius: var(--hq-product-r);
	padding: var(--hq-card-p);
	max-width: 900px;
	width: 100%;
	margin-top: 24px;
	align-items: center;
}
.hq-product-image {
	border-radius: var(--hq-product-image-r);
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.hq-product-image img {
	max-width: 70%;
	max-height: 90%;
	object-fit: contain;
}
.hq-product-body {
	padding: 24px;
	background: var(--hq-page-bg);
	border-radius: var(--hq-product-image-r);
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
	text-align: left;
}
.hq-product-name { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: 1px; color: var(--hq-text); }
.hq-product-desc { font-size: 15px; line-height: 1.5; color: var(--hq-text); margin: 0 0 8px; }
.hq-product-price { font-size: 15px; margin: 0 0 14px; color: var(--hq-text); }
.hq-product-body .hq-btn-primary { align-self: stretch; }
.hq-link-learn {
	color: var(--hq-text);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	text-decoration: underline;
	margin-top: 10px;
	align-self: flex-start;
}

.hq-result-related {
	border-top: 1px solid var(--hq-header-border);
	padding: 60px 24px;
}
.hq-related-title {
	font-size: 32px;
	font-weight: 500;
	letter-spacing: 1px;
	text-transform: uppercase;
	margin: 12px 0 28px;
	color: var(--hq-text);
}
.hq-related-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}
.hq-related-card {
	display: flex;
	flex-direction: column;
}
.hq-related-image {
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--hq-product-r);
	aspect-ratio: 1 / 1;
	overflow: hidden;
	margin-bottom: 16px;
}
.hq-related-image img { max-width: 60%; max-height: 90%; object-fit: contain; }
.hq-related-body { display: flex; flex-direction: column; gap: 6px; }
.hq-related-name { font-size: 18px; font-weight: 700; letter-spacing: 1px; margin: 0; color: var(--hq-text); }
.hq-related-desc { font-size: 14px; color: var(--hq-text); margin: 0; }
.hq-related-price { font-size: 14px; margin: 4px 0 12px; color: var(--hq-text); }

/* Responsive */
@media (max-width: 1024px) {
	.hq-side-form { flex: 0 0 55%; max-width: 55%; }
	.hq-related-grid { grid-template-columns: repeat(2, 1fr); }
	.hq-product-card { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
	.hq-screen { flex-direction: column; }
	.hq-side-form { flex: 1 1 auto; max-width: 100%; padding: var(--hq-form-p); order: 2; }
	.hq-side-image {
		order: 1;
		flex: 0 0 auto;
		min-height: 0;
		height: auto;
	}
	.hq-side-image .hq-image {
		position: relative;
		height: var(--hq-mobile-image-h, 260px);
	}
	.hq-overlay { display: none; }
	.hq-header { padding: 12px 16px; }
	.hq-logo { font-size: 18px; }
	.hq-actions-row { flex-direction: column; }
	.hq-btn-secondary { width: 100%; }
	.hq-result-top { padding: 40px 16px; }
	.hq-product-card { padding: 12px; }
	.hq-product-body { padding: 16px; }
	.hq-related-grid { grid-template-columns: 1fr; gap: 16px; }
	.hq-result-related { padding: 40px 16px; }
}

/* Body lock when quiz is open */
body.hq-quiz-open { overflow: hidden; }

/* Custom overrides */
.hq-input {
	border: none !important;
}

button.hq-btn {
	font-weight: 600 !important;
	padding: 12px !important;
}

button.hq-btn:hover {
	border-color: #CFCFCF !important;
}

.hq-disclaimer a {
	color: #0B0B0B !important;
	transition: 0.3s ease-in-out;
}

.hq-disclaimer a:hover {
	color: #858585 !important;
}

.hq-intro-top {
	text-align: center !important;
}

span.hq-badge {
	margin: 0px auto 24px !important;
	padding: 2px 10px !important;
}

img.hq-image {
	height: calc(100% - 8px) !important;
	margin-top: 8px !important;
}

.hq-form-inner {
	max-width: 600px !important;
}

span.hq-progress-text {
	font-size: 16px !important;
}

.hq-image-overlay {
	position: absolute;
	top: 8px;
	left: 0;
	right: 0;
	bottom: 0;
	pointer-events: none;
	z-index: 1;
	border-radius: var(--hq-image-r);
}
.hq-overlay { z-index: 2; }
