/**
 * Polar Forge — Product Questionnaire Styles
 */

:root {
	--pf-q-bg: #0d1117;
	--pf-q-surface: #161b22;
	--pf-q-border: rgba(48, 54, 61, 0.8);
	--pf-q-accent: #00c8ff;
	--pf-q-text: #e6edf3;
	--pf-q-muted: #8b949e;
	--pf-q-success: #3fb950;
	--pf-q-radius: 12px;
}

@media (prefers-color-scheme: light) {
	:root {
		--pf-q-bg: #ffffff;
		--pf-q-surface: #f6f8fa;
		--pf-q-border: rgba(208, 215, 222, 0.8);
		--pf-q-text: #1c2128;
		--pf-q-muted: #57606a;
	}
}

.pf-questionnaire {
	margin: 1.5rem 0;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding: 0;
}

/* Force label visibility regardless of theme */
.pf-q__label,
.pf-questionnaire .pf-q__label,
#pf-questionnaire .pf-q__label {
	font-size: 1rem !important;
	font-weight: 700 !important;
	color: #111111 !important;
	margin: 0 0 0.25rem !important;
	display: block !important;
	letter-spacing: 0.01em;
}

.pf-q__block,
.pf-questionnaire .pf-q__block {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1rem !important;
	background: #f0f4f8 !important;
	border: 1.5px solid #d0d7de !important;
	border-radius: 10px !important;
}

.pf-q__required {
	color: #e53e3e !important;
	margin-left: 3px !important;
	font-weight: 700 !important;
}

.pf-q__choices {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	gap: 0.625rem;
}

.pf-q__choice {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.75rem 0.5rem;
	min-height: 72px;
	border-radius: 10px;
	border: 1.5px solid var(--pf-q-border);
	background: var(--pf-q-surface);
	color: var(--pf-q-text);
	cursor: pointer;
	text-align: center;
	transition: border-color 0.18s, background 0.18s, transform 0.12s;
	font-size: 0.875rem;
	line-height: 1.3;
}

.pf-q__choice:hover {
	border-color: var(--pf-q-accent);
	background: rgba(0, 200, 255, 0.05);
	transform: translateY(-1px);
}

.pf-q__choice.selected {
	border-color: var(--pf-q-accent);
	background: rgba(0, 200, 255, 0.1);
	box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.2);
}

.pf-q__choice.selected::after {
	content: '✓';
	position: absolute;
	top: 5px;
	right: 7px;
	font-size: 0.7rem;
	color: var(--pf-q-accent);
	font-weight: 700;
}

.pf-q__choice-img {
	width: 100%;
	max-height: 60px;
	object-fit: contain;
	border-radius: 6px;
}

.pf-q__choice-label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--pf-q-text);
}

.pf-q__addon {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--pf-q-accent);
	background: rgba(0, 200, 255, 0.1);
	padding: 2px 7px;
	border-radius: 999px;
	white-space: nowrap;
}

.pf-q__addon--free {
	color: var(--pf-q-success);
	background: rgba(63, 185, 80, 0.1);
}

.pf-q__addon-total {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--pf-q-accent);
	margin: 0.5rem 0 0;
	padding: 0.5rem 0.75rem;
	background: rgba(0, 200, 255, 0.06);
	border-radius: 8px;
	border: 1px solid rgba(0, 200, 255, 0.2);
}

@media (prefers-color-scheme: dark) {
	.pf-q__choice {
		background: #161b22;
	}
}

/* ── Questionnaire collapsible header ────────────────────────────────────── */

.pf-q__toggle-header,
.pf-questionnaire .pf-q__toggle-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #1a1f2e !important;
	border: 1.5px solid #00c8ff !important;
	border-radius: 10px !important;
	padding: 0.875rem 1rem !important;
	cursor: pointer;
	user-select: none;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.15s, border-color 0.15s;
	margin-bottom: 0;
}

.pf-q__toggle-header:hover,
.pf-q__toggle-header:focus-visible {
	outline: none;
}

.pf-q__toggle-header .pf-q__toggle-title,
.pf-q__toggle-title {
	color: #ffffff !important;
}

.pf-q__toggle-arrow {
	font-size: 1rem;
	color: var(--pf-q-accent, #00c8ff);
	transition: transform 0.25s ease;
	flex-shrink: 0;
}

.pf-q__toggle-header[aria-expanded="true"] .pf-q__toggle-arrow {
	transform: rotate(180deg);
}

.pf-q__body {
	padding-top: 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.pf-q__body[hidden] {
	display: none !important;
}

@media (min-width: 769px) {
	.pf-q__toggle-arrow {
		display: none;
	}
	.pf-q__toggle-header {
		cursor: default;
		pointer-events: none;
	}
	.pf-q__body[hidden] {
		display: flex !important;
	}
}

/* ── Questionnaire: clear fixed CTA bar on mobile ────────────────────────── */

@media (max-width: 768px) {
	/* Ensure questionnaire has enough bottom margin to scroll above the CTA */
	#pf-questionnaire,
	.pf-questionnaire {
		margin-bottom: 80px !important;
		scroll-margin-bottom: 80px !important;
	}

	/* The error notice ("Please select an option") should appear ABOVE the
	questionnaire choices, not in the CTA bar area */
	#pf-cta-notice {
		position: fixed !important;
		bottom: 70px !important; /* above CTA bar */
		left: 1rem !important;
		right: 1rem !important;
		z-index: 99999 !important; /* above .pf-studio__cta-bar (99998) */
		border-radius: 10px !important;
		text-align: center !important;
		padding: 0.75rem 1rem !important;
		font-size: 0.9rem !important;
		background: rgba(248, 81, 73, 0.95) !important;
		color: #ffffff !important;
		box-shadow: 0 4px 20px rgba(248, 81, 73, 0.4) !important;
	}
}
