/**
 * CEO Exchange lead quiz.
 *
 * Mobile-first and fully scoped to .ceoq: no element or global selectors, so
 * the component can sit on a bare Canvas landing page or be dropped into an
 * existing themed page without touching its surroundings.
 *
 * COLOURS ARE NOT INVENTED. Every value below is taken from the live site:
 * Elementor global kit #74 ("GrowthVibe") -- the only place ceoexchange.ai
 * defines colours, since hello-elementor's theme.json declares no palette and
 * the Default Kit is empty -- cross-checked against computed styles on the
 * rendered home, contact and business-brokers pages.
 *
 *   #000000  Black (Primary)            body background, site-wide
 *   #101010  Night (custom)             section / card background
 *   #FFFFFF  White (Accent)             headings
 *   #969696  Battleship Gray (Text)     body copy
 *   #FF8F34  Carrot Orange (Secondary)  primary CTA -- the kit's own
 *                                       .elementor-button background
 *   #69727D  rendered form-field border on the Contact page
 *   10px     kit button / field border radius
 *
 * Typography likewise comes from kit #74, confirmed against the rendered
 * Contact page:
 *
 *   Outfit  700   headings
 *   Manrope 500   body copy and inputs
 *   Manrope 800   buttons (the kit's "Accent" typography)
 *
 * The families are named with a sans-serif fallback and are NOT loaded here:
 * on an existing page the theme already serves them, and the standalone
 * landing page loads them via the separate 'ceoq-fonts' handle.
 *
 * The component paints its own dark background on purpose. That keeps it
 * readable on a bare Canvas page today and lets it blend into the black
 * Contact page later, with no per-page overrides.
 */

.ceoq {
	--ceoq-bg: #000000;
	--ceoq-surface: #101010;
	--ceoq-ink: #ffffff;
	--ceoq-muted: #969696;
	--ceoq-line: #69727d;
	--ceoq-accent: #ff8f34;
	--ceoq-accent-ink: #ffffff;
	/* Kit hover rule: .elementor-button:hover -> white bg, black text. */
	--ceoq-accent-hover-bg: #ffffff;
	--ceoq-accent-hover-ink: #000000;
	--ceoq-select-wash: rgba( 255, 143, 52, 0.12 );
	--ceoq-focus: #ffffff;
	/* Not a brand colour: the palette has no error state, and the previous
	   dark red was unreadable on black. Chosen for contrast on #000. */
	--ceoq-error: #ff6b6b;
	--ceoq-radius: 10px;
	--ceoq-font-head: 'Outfit', sans-serif;
	--ceoq-font-body: 'Manrope', sans-serif;

	box-sizing: border-box;
	width: 100%;
	max-width: 620px;
	margin-inline: auto;
	padding: 24px 16px 32px;
	background: var(--ceoq-bg);
	color: var(--ceoq-muted);
	font-family: var(--ceoq-font-body);
	font-weight: 500;
	font-size: 16px;
	line-height: 1.5;
}

.ceoq *,
.ceoq *::before,
.ceoq *::after {
	box-sizing: inherit;
}

/*
 * Copy-fidelity reset.
 *
 * The component is designed to be dropped into pages whose CSS it does not
 * control. The live Contact page styles every <button> with
 * text-transform: capitalize, which silently re-cased the question options --
 * "SEO & website traffic" rendered as "SEO & Website Traffic". The copy is
 * final and must render exactly as written, so the host page's text casing is
 * neutralised here rather than relying on it being absent.
 *
 * .ceoq-result-eyebrow is excluded: its uppercase is deliberate.
 */
.ceoq button,
.ceoq input,
.ceoq label,
.ceoq legend,
.ceoq h2,
.ceoq h3,
.ceoq p,
.ceoq-trigger,
.ceoq-modal-close {
	text-transform: none;
	font-style: normal;
}

.ceoq .ceoq-result-eyebrow {
	text-transform: uppercase;
}

/*
 * Colour pinning.
 *
 * The live Contact page carries the kit's button hover rule --
 * .elementor-button:hover { background: white; color: black } -- which also
 * matches these <button> elements. Our background survived on specificity but
 * the colour did not, so hovering an option turned its label black on a black
 * card: the text vanished under the cursor on every option.
 *
 * The element selector (button.ceoq-option) is deliberate: it outweighs the
 * host's two-class rule instead of merely tying with it, which a later-loaded
 * host stylesheet would win.
 */
.ceoq button.ceoq-option,
.ceoq button.ceoq-option:hover,
.ceoq button.ceoq-option:focus,
.ceoq button.ceoq-option:active,
.ceoq button.ceoq-option.is-selected {
	color: var(--ceoq-ink);
}

.ceoq button.ceoq-submit {
	color: var(--ceoq-accent-ink);
	background: var(--ceoq-accent);
}

.ceoq button.ceoq-submit:hover,
.ceoq button.ceoq-submit:focus {
	color: var(--ceoq-accent-hover-ink);
	background: var(--ceoq-accent-hover-bg);
}

.ceoq button.ceoq-back,
.ceoq button.ceoq-back:focus {
	color: var(--ceoq-muted);
	background: none;
}

.ceoq button.ceoq-back:hover {
	color: var(--ceoq-accent);
	background: none;
}

/* ---------- progress ---------- */

.ceoq-progress {
	margin-bottom: 22px;
}

.ceoq-progress-track {
	height: 4px;
	background: #1a1a1a;
	border-radius: 999px;
	overflow: hidden;
}

.ceoq-progress-bar {
	height: 100%;
	width: 0;
	background: var(--ceoq-accent);
	border-radius: 999px;
	transition: width 260ms ease;
}

.ceoq-progress-label {
	margin: 8px 0 0;
	font-size: 13px;
	letter-spacing: 0.02em;
	color: var(--ceoq-muted);
}

/* ---------- headings ---------- */

.ceoq-heading {
	margin: 0 0 6px;
	font-family: var(--ceoq-font-head);
	font-weight: 700;
	font-size: 26px;
	line-height: 1.2;
	color: var(--ceoq-ink);
}

.ceoq-intro {
	margin: 0 0 22px;
	color: var(--ceoq-muted);
}

/* ---------- screens & transitions ---------- */

.ceoq-stage {
	position: relative;
}

.ceoq-screen {
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 200ms ease, transform 200ms ease;
}

.ceoq-screen.is-in {
	opacity: 1;
	transform: translateY(0);
}

.ceoq-screen.is-out {
	opacity: 0;
	transform: translateY(-8px);
}

@media (prefers-reduced-motion: reduce) {
	.ceoq-screen,
	.ceoq-progress-bar {
		transition: none;
	}

	.ceoq-screen {
		transform: none;
	}
}

/* ---------- question ---------- */

.ceoq-fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.ceoq-question {
	display: block;
	width: 100%;
	padding: 0;
	margin: 0 0 16px;
	font-family: var(--ceoq-font-head);
	font-size: 21px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--ceoq-ink);
}

.ceoq-options {
	display: grid;
	gap: 10px;
}

.ceoq-option {
	display: block;
	width: 100%;
	min-height: 52px;
	padding: 14px 16px;
	text-align: left;
	font: inherit;
	color: var(--ceoq-ink);
	background: var(--ceoq-surface);
	border: 1px solid var(--ceoq-line);
	border-radius: var(--ceoq-radius);
	cursor: pointer;
	transition: border-color 140ms ease, background-color 140ms ease,
		transform 140ms ease;
}

.ceoq-option:hover {
	border-color: var(--ceoq-accent);
	background: var(--ceoq-select-wash);
}

.ceoq-option:active {
	transform: scale(0.99);
}

.ceoq-option.is-selected {
	border-color: var(--ceoq-accent);
	background: var(--ceoq-select-wash);
}

.ceoq-option:focus-visible,
.ceoq-submit:focus-visible,
.ceoq-back:focus-visible,
.ceoq-input:focus-visible {
	outline: 2px solid var(--ceoq-focus);
	outline-offset: 2px;
}

/* ---------- result ---------- */

.ceoq-result-eyebrow {
	margin: 0 0 4px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ceoq-accent);
}

.ceoq-tier {
	margin: 0 0 8px;
	font-family: var(--ceoq-font-head);
	font-weight: 700;
	font-size: 30px;
	line-height: 1.15;
	color: var(--ceoq-ink);
}

.ceoq-benefit {
	margin: 0 0 22px;
	color: var(--ceoq-muted);
}

/* ---------- form ---------- */

.ceoq-form-intro {
	margin: 0 0 14px;
	font-weight: 600;
	color: var(--ceoq-ink);
}

.ceoq-form {
	display: grid;
	gap: 14px;
}

.ceoq-field {
	display: grid;
	gap: 6px;
}

.ceoq-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--ceoq-ink);
}

.ceoq-optional {
	font-weight: 400;
	color: var(--ceoq-muted);
}

.ceoq-input {
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	font: inherit;
	color: var(--ceoq-ink);
	background: var(--ceoq-bg);
	border: 1px solid var(--ceoq-line);
	border-radius: var(--ceoq-radius);
	/* 16px keeps iOS Safari from zooming the viewport on focus. */
	font-size: 16px;
}

.ceoq-input::placeholder {
	color: #5d5d5d;
}

.ceoq-input:focus {
	border-color: var(--ceoq-accent);
}

/* Honeypot: hidden from people, still reachable for bots that fill inputs. */
.ceoq-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.ceoq-error {
	margin: 0;
	color: var(--ceoq-error);
	font-size: 14px;
}

.ceoq-submit {
	min-height: 52px;
	padding: 14px 20px;
	font: inherit;
	font-family: var(--ceoq-font-body);
	font-weight: 800;
	color: var(--ceoq-accent-ink);
	background: var(--ceoq-accent);
	border: 1px solid var(--ceoq-accent);
	border-radius: var(--ceoq-radius);
	cursor: pointer;
	transition: background-color 140ms ease, color 140ms ease;
}

.ceoq-submit:hover {
	background: var(--ceoq-accent-hover-bg);
	color: var(--ceoq-accent-hover-ink);
	border-color: var(--ceoq-accent-hover-bg);
}

.ceoq-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.ceoq-back {
	justify-self: start;
	margin-top: 16px;
	padding: 8px 0;
	font: inherit;
	font-size: 14px;
	color: var(--ceoq-muted);
	background: none;
	border: 0;
	text-decoration: underline;
	cursor: pointer;
}

.ceoq-back:hover {
	color: var(--ceoq-accent);
}

.ceoq-noscript {
	margin: 0;
	color: var(--ceoq-muted);
}

.ceoq-noscript a {
	color: var(--ceoq-accent);
}

/* ---------- larger screens ---------- */

@media (min-width: 640px) {
	.ceoq {
		padding: 32px 24px 40px;
	}

	.ceoq-heading {
		font-size: 30px;
	}

	.ceoq-question {
		font-size: 24px;
	}

	.ceoq-tier {
		font-size: 36px;
	}
}

/* ---------- injected wrapper ---------- */

/*
 * Container for the quiz when it is appended to an existing page by
 * CEOQ_Injector. The append lands after the page's own Elementor content, so
 * it sits outside that content's container and would otherwise run flush to
 * the viewport edge.
 *
 * Mirrors production's Elementor container: min(100%, 1280px), centred, with
 * the same 20px side gutter. Measured on the live Contact page.
 *
 * Lives here rather than in modal.css because quiz.css is loaded in every
 * mode, so the wrapper is styled whichever presentation the injected
 * shortcode uses.
 */
.ceoq-injected {
	box-sizing: border-box;
	width: 100%;
	max-width: 1280px;
	margin-inline: auto;
	padding: 48px 20px 56px;
	text-align: center;
}

@media (max-width: 480px) {
	.ceoq-injected {
		padding: 32px 16px 40px;
	}
}
