/**
 * Quiz & Ads Manager - quiz overlay.
 */

.qam-quiz-wrap {
	--qam-primary: #0f5bd8;
	--qam-primary-dark: #0b46a6;
	--qam-primary-soft: #eef5ff;
	--qam-accent: #16a34a;
	--qam-text: #111827;
	--qam-border: #dbe3ee;
}

.qam-quiz-overlay {
	position: fixed;
	inset: 0;
	z-index: 999;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.62);
	-webkit-backdrop-filter: blur(7px);
	backdrop-filter: blur(7px);
}

.qam-quiz {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 1000;
	display: flex;
	box-sizing: border-box;
	flex-direction: column;
	width: calc(100vw - 24px);
	max-width: 430px;
	max-height: 92vh;
	padding: 26px 24px 22px;
	overflow-y: auto;
	transform: translate(-50%, -50%);
	background: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.9);
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25), 0 4px 15px rgba(0, 0, 0, 0.08);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	animation: qam-quiz-pop 0.35s ease-out;
}

.qam-quiz * {
	box-sizing: border-box;
}

@keyframes qam-quiz-pop {
	from {
		opacity: 0;
		transform: translate(-50%, calc(-50% + 20px)) scale(0.97);
	}

	to {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.qam-quiz {
		animation: none;
	}
}

.qam-quiz .qam-quiz-title {
	margin: 0;
	padding: 0 4px;
	color: var(--qam-text);
	font-size: 24px;
	font-weight: 750;
	line-height: 1.3;
	text-align: center;
}

/* ---------------------------------------------------------------
   Progress
   --------------------------------------------------------------- */

.qam-quiz .qam-progress-wrapper {
	position: relative;
	margin: 30px 5px 32px;
}

.qam-quiz .qam-progress-bg {
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 5px;
	transform: translateY(-50%);
	background: #e5eaf1;
	border-radius: 20px;
}

.qam-quiz .qam-progress-fill {
	position: absolute;
	top: 50%;
	left: 0;
	width: 0;
	height: 5px;
	transform: translateY(-50%);
	background: linear-gradient(90deg, #0f5bd8, #2878eb);
	border-radius: 20px;
	transition: width 0.4s ease;
}

.qam-quiz .qam-steps {
	position: relative;
	z-index: 2;
	display: flex;
	justify-content: space-between;
}

.qam-quiz .qam-step {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	background: #ffffff;
	border: 3px solid #dce3ed;
	border-radius: 50%;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
	color: transparent;
	font-size: 14px;
	font-weight: 700;
	transition: all 0.25s ease;
}

.qam-quiz .qam-step.is-active {
	background: var(--qam-primary);
	border-color: var(--qam-primary);
	box-shadow: 0 3px 9px rgba(15, 91, 216, 0.25);
	color: #ffffff;
}

/* ---------------------------------------------------------------
   Options
   --------------------------------------------------------------- */

.qam-quiz .qam-options {
	display: flex;
	flex-direction: column;
	gap: 13px;
}

.qam-quiz .qam-option {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	padding: 17px 46px 17px 18px;
	background: #ffffff;
	border: 1.5px solid var(--qam-border);
	border-radius: 12px;
	box-shadow: 0 3px 8px rgba(15, 23, 42, 0.04);
	color: #1f2937;
	font-family: inherit;
	font-size: 16px;
	font-weight: 650;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.qam-quiz .qam-option::after {
	content: "\203A";
	position: absolute;
	top: 50%;
	right: 18px;
	transform: translateY(-52%);
	color: #94a3b8;
	font-size: 27px;
	font-weight: 400;
	transition: all 0.18s ease;
}

.qam-quiz .qam-option:hover {
	background: var(--qam-primary-soft);
	border-color: var(--qam-primary);
	box-shadow: 0 5px 14px rgba(15, 91, 216, 0.1);
	transform: translateY(-1px);
}

.qam-quiz .qam-option:hover::after {
	right: 15px;
	color: var(--qam-primary);
}

.qam-quiz .qam-option.is-selected {
	background: var(--qam-primary-soft);
	border-color: var(--qam-primary);
	box-shadow: 0 0 0 2px rgba(15, 91, 216, 0.08), 0 5px 12px rgba(15, 91, 216, 0.1);
	color: var(--qam-primary-dark);
	transform: scale(0.99);
}

.qam-quiz .qam-option.is-selected::after {
	content: "\2713";
	display: flex;
	align-items: center;
	justify-content: center;
	right: 14px;
	width: 25px;
	height: 25px;
	background: var(--qam-primary);
	border-radius: 50%;
	color: #ffffff;
	font-size: 13px;
	font-weight: 700;
}

/* Final step: a single option becomes the call to action. */
.qam-quiz .qam-options.is-single .qam-option {
	padding: 17px 44px 17px 20px;
	background: var(--qam-accent);
	border-color: var(--qam-accent);
	box-shadow: 0 5px 14px rgba(22, 163, 74, 0.2);
	color: #ffffff;
	font-size: 17px;
	font-weight: 750;
	text-align: center;
}

.qam-quiz .qam-options.is-single .qam-option::after {
	content: "\2192";
	color: #ffffff;
	font-size: 20px;
	font-weight: 700;
}

.qam-quiz .qam-options.is-single .qam-option:hover {
	background: #15803d;
	border-color: #15803d;
	box-shadow: 0 7px 18px rgba(22, 163, 74, 0.25);
	transform: translateY(-2px);
}

.qam-quiz .qam-options.is-single .qam-option.is-selected {
	background: #15803d;
	border-color: #15803d;
}

.qam-quiz .qam-options.is-single .qam-option.is-selected::after {
	content: "\2713";
	background: rgba(255, 255, 255, 0.22);
	color: #ffffff;
}

/* ---------------------------------------------------------------
   Note and skip
   --------------------------------------------------------------- */

.qam-quiz .qam-adnote {
	display: none;
	width: fit-content;
	margin: 18px auto 0;
	padding: 8px 14px;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	border-radius: 30px;
	color: #9a3412;
	font-size: 12px;
	font-weight: 650;
	line-height: 1.4;
	text-align: center;
}

.qam-quiz .qam-skip {
	display: block;
	width: 100%;
	margin-top: 18px;
	padding: 8px 10px;
	background: transparent;
	border: 0;
	color: #64748b;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: color 0.2s ease;
}

.qam-quiz .qam-skip:hover {
	color: var(--qam-primary);
	text-decoration: underline;
}

/* ---------------------------------------------------------------
   Mobile
   --------------------------------------------------------------- */

@media screen and (max-width: 480px) {
	.qam-quiz {
		max-width: none;
		padding: 22px 16px 18px;
		border-radius: 16px;
	}

	.qam-quiz .qam-quiz-title {
		font-size: 21px;
	}

	.qam-quiz .qam-progress-wrapper {
		margin: 26px 5px 28px;
	}

	.qam-quiz .qam-step {
		width: 27px;
		height: 27px;
		border-width: 2px;
		font-size: 12px;
	}

	.qam-quiz .qam-options {
		gap: 11px;
	}

	.qam-quiz .qam-option {
		padding: 15px 42px 15px 15px;
		border-radius: 10px;
		font-size: 15px;
	}

	.qam-quiz .qam-option::after {
		right: 15px;
	}

	.qam-quiz .qam-options.is-single .qam-option {
		padding: 16px 42px 16px 16px;
		font-size: 16px;
	}

	.qam-quiz .qam-skip {
		margin-top: 15px;
		font-size: 12px;
	}
}
