/* Quiz Builder — Frontend Styles (v3)
   All colors & fonts are CSS variables, set inline from plugin Settings.
------------------------------------------------------------------ */

.qb-quiz-wrap {
	--qb-primary: #16294F;
	--qb-accent: #16A34A;
	--qb-panel-bg: #F3F5FB;
	--qb-card-bg: #FFFFFF;
	--qb-line: #E5E7EB;
	--qb-muted: #6B7280;
	--qb-button-text: #FFFFFF;
	--qb-heading-font: 'Poppins', sans-serif;
	--qb-body-font: 'Inter', sans-serif;

	font-family: var(--qb-body-font);
	max-width: 1180px;
	margin: 40px auto;
	padding: 0 16px;
	box-sizing: border-box;
}
.qb-quiz-wrap *,
.qb-quiz-wrap *::before,
.qb-quiz-wrap *::after {
	box-sizing: border-box;
}

.qb-quiz-shell {
	position: relative;
	display: grid;
	grid-template-columns: 0.82fr 1.18fr;
	min-height: 580px;
	background: var(--qb-card-bg);
	border-radius: 26px;
	overflow: hidden;
	box-shadow: 0 40px 90px -35px rgba(22, 41, 79, 0.35), 0 4px 14px rgba(22, 41, 79, 0.08);
}

/* Floating close button */
.qb-close-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 5;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--qb-card-bg);
	border: 1px solid var(--qb-line);
	box-shadow: 0 8px 20px -8px rgba(22, 41, 79, 0.35);
	color: var(--qb-primary);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, transform 0.15s ease;
}
.qb-close-btn:hover {
	background: var(--qb-panel-bg);
	transform: scale(1.05);
}

/* ---------------- Left Branding Panel ---------------- */
.qb-brand-panel {
	background: var(--qb-panel-bg);
	padding: 48px 40px;
	display: flex;
	align-items: center;
}

.qb-brand-inner {
	width: 100%;
}

.qb-brand-logo {
	max-height: 38px;
	max-width: 200px;
	margin-bottom: 26px;
	display: block;
}

.qb-brand-logo-text {
	font-family: var(--qb-heading-font);
	font-weight: 800;
	font-size: 19px;
	color: var(--qb-primary);
	margin-bottom: 26px;
}

.qb-brand-title {
	font-family: var(--qb-heading-font);
	font-size: 26px;
	line-height: 1.32;
	font-weight: 700;
	color: var(--qb-primary);
	margin: 0 0 14px;
}

.qb-brand-subtitle {
	font-size: 14.5px;
	line-height: 1.7;
	color: var(--qb-muted);
	margin: 0 0 30px;
	max-width: 310px;
}

.qb-illustration {
	width: 210px;
	max-width: 70%;
	margin: 8px auto 30px;
	color: var(--qb-primary);
}
.qb-illustration img {
	width: 100%;
	height: auto;
	display: block;
}
.qb-default-illustration {
	width: 100%;
	height: auto;
	color: var(--qb-accent);
}

.qb-trust-list {
	list-style: none;
	margin: 0;
	padding: 18px 18px;
	background: var(--qb-card-bg);
	border-radius: 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.qb-trust-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.qb-trust-icon {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	color: var(--qb-primary);
	margin-top: 2px;
}
.qb-trust-icon svg {
	width: 100%;
	height: 100%;
}

.qb-trust-item strong {
	display: block;
	font-family: var(--qb-heading-font);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--qb-primary);
}

.qb-trust-item small {
	display: block;
	font-size: 12.5px;
	color: var(--qb-muted);
	margin-top: 2px;
}

/* ---------------- Right Card Panel ---------------- */
.qb-card-panel {
	background: var(--qb-card-bg);
	display: flex;
	align-items: stretch;
}

.qb-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 48px 46px;
}

/* Progress bar */
.qb-progress {
	margin-bottom: 30px;
}

.qb-progress-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.qb-progress-label {
	font-family: var(--qb-heading-font);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--qb-primary);
}

.qb-progress-pct {
	font-size: 13px;
	font-weight: 700;
	color: var(--qb-accent);
}

.qb-progress-track {
	height: 7px;
	background: var(--qb-line);
	border-radius: 999px;
	overflow: hidden;
}

.qb-progress-fill {
	height: 100%;
	width: 0%;
	background: var(--qb-accent);
	border-radius: 999px;
	transition: width 0.45s cubic-bezier(.65,0,.35,1);
}

/* Question area */
.qb-question-area {
	flex: 1;
}

.qb-question-block {
	animation: qbFadeIn 0.35s ease;
}

@keyframes qbFadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

.qb-question-icon {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--qb-primary) 10%, white 90%);
	color: var(--qb-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	margin-bottom: 20px;
}
.qb-question-icon svg {
	width: 26px;
	height: 26px;
}

.qb-question-title {
	font-family: var(--qb-heading-font);
	font-size: 22px;
	font-weight: 700;
	color: var(--qb-primary);
	margin: 0 0 8px;
	line-height: 1.35;
}

.qb-question-description {
	font-size: 14px;
	color: var(--qb-muted);
	line-height: 1.6;
	margin: 0 0 24px;
}

.qb-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.qb-option {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	text-align: left;
	padding: 14px 18px;
	background: var(--qb-card-bg);
	border: 1.5px solid var(--qb-line);
	border-radius: 14px;
	font-family: var(--qb-body-font);
	cursor: pointer;
	transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.qb-option:hover {
	border-color: color-mix(in srgb, var(--qb-accent) 45%, var(--qb-line) 55%);
	transform: translateY(-1px);
}

.qb-option-dot {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid var(--qb-line);
	position: relative;
	transition: border-color 0.18s ease;
}

.qb-option-icon {
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--qb-accent) 12%, white 88%);
	color: var(--qb-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	transition: background 0.18s ease;
}
.qb-option-icon svg {
	width: 19px;
	height: 19px;
}

.qb-option-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.qb-option-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--qb-primary);
}

.qb-option-subtitle {
	font-size: 12.5px;
	color: var(--qb-muted);
}

.qb-option.is-selected {
	border-color: var(--qb-accent);
	background: color-mix(in srgb, var(--qb-accent) 8%, white 92%);
	box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--qb-accent) 45%, transparent 55%);
}

.qb-option.is-selected .qb-option-dot {
	border-color: var(--qb-accent);
	background: var(--qb-accent);
}

.qb-option.is-selected .qb-option-dot::after {
	content: '';
	position: absolute;
	inset: 4px;
	border-radius: 50%;
	background: var(--qb-card-bg);
}

/* Checkbox variant (multi-select) */
.qb-option-checkbox .qb-option-dot {
	border-radius: 6px;
}
.qb-option-checkbox.is-selected .qb-option-dot {
	border-radius: 6px;
}
.qb-option-checkbox.is-selected .qb-option-dot::after {
	inset: unset;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 5px;
	border-left: 2px solid var(--qb-card-bg);
	border-bottom: 2px solid var(--qb-card-bg);
	background: none;
	border-radius: 0;
	transform: translate(-50%, -60%) rotate(-45deg);
}

/* Text input step (e.g. Zip Code) */
.qb-text-field {
	margin-top: 4px;
}

.qb-text-input {
	width: 100%;
	padding: 16px 18px;
	font-size: 17px;
	font-family: var(--qb-body-font);
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--qb-primary);
	background: var(--qb-card-bg);
	border: 1.5px solid var(--qb-line);
	border-radius: 14px;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.qb-text-input:focus {
	outline: none;
	border-color: var(--qb-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--qb-accent) 15%, transparent 85%);
}

/* Contact form step */
.qb-contact-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.qb-contact-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.qb-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.qb-field label {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--qb-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.qb-field input {
	padding: 13px 15px;
	font-size: 15px;
	font-family: var(--qb-body-font);
	color: var(--qb-primary);
	background: var(--qb-card-bg);
	border: 1.5px solid var(--qb-line);
	border-radius: 12px;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.qb-field input:focus {
	outline: none;
	border-color: var(--qb-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--qb-accent) 15%, transparent 85%);
}

.qb-tcpa-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	margin-top: 4px;
}

.qb-tcpa-row input[type="checkbox"] {
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	margin-top: 2px;
	accent-color: var(--qb-accent);
}

.qb-tcpa-text {
	font-size: 12px;
	line-height: 1.55;
	color: var(--qb-muted);
}

/* Review (final) screen */
.qb-review-list {
	border: 1.5px solid var(--qb-line);
	border-radius: 14px;
	overflow: hidden;
	margin-bottom: 26px;
}

.qb-review-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--qb-line);
	font-size: 13px;
}
.qb-review-row:last-child {
	border-bottom: none;
}
.qb-review-row:nth-child(odd) {
	background: color-mix(in srgb, var(--qb-panel-bg) 60%, transparent 40%);
}

.qb-review-label {
	color: var(--qb-muted);
	flex: 0 0 48%;
	line-height: 1.5;
}

.qb-review-value {
	color: var(--qb-primary);
	font-weight: 600;
	text-align: right;
	line-height: 1.5;
	word-break: break-word;
}

.qb-review-headline {
	font-family: var(--qb-heading-font);
	font-size: 22px;
	font-weight: 700;
	color: var(--qb-primary);
	margin: 0 0 8px;
	line-height: 1.35;
}

.qb-review-subheadline {
	font-size: 14.5px;
	font-weight: 600;
	color: var(--qb-primary);
	margin: 0 0 10px;
	line-height: 1.55;
}

.qb-review-paragraph {
	font-size: 14px;
	color: var(--qb-muted);
	line-height: 1.65;
	margin: 0 0 22px;
}

@media (max-width: 480px) {
	.qb-contact-row {
		grid-template-columns: 1fr;
	}
	.qb-review-row {
		flex-direction: column;
		gap: 4px;
	}
	.qb-review-value {
		text-align: left;
	}
}

/* Nav buttons */
.qb-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-top: 30px;
	padding-top: 22px;
	border-top: 1px solid var(--qb-line);
}

.qb-btn {
	font-family: var(--qb-heading-font);
	font-size: 14px;
	font-weight: 600;
	border-radius: 12px;
	padding: 13px 22px;
	cursor: pointer;
	border: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: opacity 0.18s ease, transform 0.12s ease, background 0.18s ease;
}

.qb-btn-secondary {
	background: var(--qb-card-bg);
	border: 1.5px solid var(--qb-line);
	color: var(--qb-primary);
}

.qb-btn-primary {
	background: var(--qb-primary);
	color: var(--qb-button-text);
	margin-left: auto;
}

.qb-btn-primary:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.qb-btn:not(:disabled):hover {
	transform: translateY(-1px);
}

/* Footer trust line */
.qb-footer-trust {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 18px;
	font-size: 12.5px;
	color: var(--qb-muted);
}
.qb-trust-icon-sm {
	width: 15px;
	height: 15px;
	flex: 0 0 15px;
	color: var(--qb-primary);
}

/* Thank you state */
.qb-thankyou {
	text-align: left;
	padding: 30px 6px;
	animation: qbFadeIn 0.4s ease;
}

.qb-thankyou-icon {
	width: 56px;
	height: 56px;
	line-height: 56px;
	text-align: center;
	border-radius: 50%;
	background: color-mix(in srgb, var(--qb-accent) 12%, white 88%);
	color: var(--qb-accent);
	font-size: 26px;
	margin: 0 0 20px;
}

.qb-thankyou-headline {
	font-family: var(--qb-heading-font);
	font-size: 24px;
	font-weight: 700;
	color: var(--qb-primary);
	margin: 0 0 10px;
}

.qb-thankyou-intro {
	font-size: 15px;
	font-weight: 600;
	color: var(--qb-primary);
	margin: 0 0 14px;
}

.qb-thankyou-para {
	font-size: 14.5px;
	line-height: 1.7;
	color: var(--qb-muted);
	margin: 0 0 14px;
}

.qb-thankyou-checklist {
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.qb-thankyou-checklist li {
	position: relative;
	padding-left: 26px;
	font-size: 14px;
	color: var(--qb-primary);
	font-weight: 500;
}

.qb-thankyou-checklist li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--qb-accent) 12%, white 88%);
	border: 1.5px solid var(--qb-accent);
}

.qb-thankyou-checklist li::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 7px;
	width: 6px;
	height: 3px;
	border-left: 1.5px solid var(--qb-accent);
	border-bottom: 1.5px solid var(--qb-accent);
	transform: rotate(-45deg);
}

/* Focus visibility for accessibility */
.qb-option:focus-visible,
.qb-btn:focus-visible,
.qb-close-btn:focus-visible {
	outline: 2px solid var(--qb-accent);
	outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.qb-question-block,
	.qb-thankyou,
	.qb-progress-fill,
	.qb-option {
		animation: none !important;
		transition: none !important;
	}
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
	.qb-quiz-shell {
		grid-template-columns: 1fr;
	}
	.qb-close-btn {
		top: 14px;
		right: 14px;
	}
	.qb-brand-panel {
		padding: 40px 28px 32px;
	}
	.qb-brand-title {
		font-size: 22px;
	}
	.qb-brand-subtitle {
		max-width: none;
	}
	.qb-illustration {
		margin: 6px auto 24px;
	}
	.qb-card {
		padding: 34px 24px;
	}
}

@media (max-width: 480px) {
	.qb-quiz-wrap {
		margin: 20px auto;
	}
	.qb-quiz-shell {
		border-radius: 20px;
	}
	.qb-question-title {
		font-size: 19px;
	}
	.qb-nav {
		flex-wrap: wrap;
	}
	.qb-btn {
		flex: 1 1 auto;
		justify-content: center;
	}
}