/**
 * Entangle Quiz FE — ported from the anketa prototype (.ank-* → .eq-*).
 *
 * Colour strategy: NEUTRAL and theme-agnostic. Chrome (buttons, selected
 * states, progress) is derived from the site text colour, not the site
 * accent — a bright theme --color-primary (e.g. blue) clashed with editorial
 * light/beige backgrounds. Only content-configured colours (profile
 * dimension bars) bring hue. Muted greys are tuned for contrast on light and
 * cream backgrounds (mixed toward mid-grey, not white, which washed out).
 */

.entangle-quiz {
	--eq-text: var(--color-text, #1d2327);
	--eq-bg: #fff;
	--eq-bg-alt: #f4f5f6;
	--eq-border: #dcdfe3;
	/* Readable greys on light/beige (AA-ish on both white and cream). */
	--eq-muted: color-mix(in srgb, var(--eq-text) 72%, #808080);
	--eq-faint: color-mix(in srgb, var(--eq-text) 56%, #808080);
	/* Neutral action colour: the text colour, so buttons/selection stay
	   high-contrast and never adopt the site's accent hue. */
	--eq-action: var(--eq-text);
	--eq-action-text: #fff;
	--eq-action-soft: color-mix(in srgb, var(--eq-text) 6%, #fff);
	/* Kept for content-configured dimension bars that omit a colour. */
	--eq-accent: var(--color-primary, #1A5276);
	--eq-radius: 8px;

	max-width: 620px;
	color: var(--eq-text);
	transition: color 0.4s;
}

/* Neutralize the shared survey-card chrome (.entangle-container brings a
   grey background + tight padding) — the quiz stands on the page itself. */
.entangle-quiz.entangle-container {
	background: transparent;
	border-radius: 0;
	box-shadow: none;
	margin: 0 auto;
	padding: 2.5rem 1rem 3.5rem;
}

.eq-progress {
	height: 3px;
	background: var(--eq-border);
	border-radius: 2px;
	margin-bottom: 0.55rem;
	overflow: hidden;
}
.eq-progress-fill {
	height: 100%;
	background: var(--eq-action);
	border-radius: 2px;
	transition: width 0.4s;
}
/* Status sits tight under the progress bar and well clear of the content. */
.eq-step-info {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.75rem 1rem;
	flex-wrap: wrap;
	font-size: 13px;
	color: var(--eq-faint);
	margin-bottom: 1.6rem;
}
.eq-step-info[hidden] { display: none; }
/* "Start over" link — same type as the counter, sits on the right. */
.eq-restart {
	font: inherit;
	color: var(--eq-faint);
	background: none;
	border: 0;
	padding: 0;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}
.eq-restart:hover,
.eq-restart:focus-visible {
	color: var(--eq-action);
}

.eq-step { animation: eq-fade 0.35s ease; }
@keyframes eq-fade {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

.eq-eyebrow {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--eq-muted);
	margin-bottom: 0.5rem;
}
.eq-title {
	font-size: 22px;
	font-weight: 600;
	margin: 0 0 0.75rem;
	line-height: 1.4;
	color: var(--eq-text);
}
.eq-paragraph {
	font-size: 16px;
	line-height: 1.65;
	margin: 0 0 0.9rem;
}

/* Step media (image / video) — the stimulus shown above the question. */
.eq-media {
	margin: 0 0 1.1rem;
}
.eq-media img,
.eq-media video {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	border-radius: var(--eq-radius);
	border: 1px solid var(--eq-border);
	background: var(--eq-bg-alt);
}
.eq-media video {
	aspect-ratio: 16 / 9;
	object-fit: cover;
}
.eq-step--dark .eq-media img,
.eq-step--dark .eq-media video {
	border-color: rgba(255, 255, 255, 0.14);
	background: rgba(255, 255, 255, 0.04);
}

.eq-question {
	font-size: 19px;
	font-weight: 600;
	margin: 0 0 0.25rem;
	line-height: 1.5;
	color: var(--eq-text);
}
.eq-subtitle {
	font-size: 14px;
	color: var(--eq-muted);
	margin: 0 0 1.25rem;
	line-height: 1.5;
}
/* Breathing room between the prompt and the answers when there is no subtitle
   (the subtitle already supplies the gap when present). */
.eq-question + .eq-option,
.eq-question + .eq-scale { margin-top: 1.2rem; }

.eq-scale {
	display: flex;
	gap: 8px;
	margin: 1rem 0 0.5rem;
}
.eq-scale-btn {
	flex: 1;
	padding: 0.6rem 0;
	border: 1px solid var(--eq-border);
	border-radius: var(--eq-radius);
	background: var(--eq-bg);
	font-size: 15px;
	font-weight: 600;
	color: var(--eq-muted);
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
	text-align: center;
}
.eq-scale-btn:hover { border-color: var(--eq-action); background: var(--eq-bg-alt); }
.eq-scale-btn.eq-sel { background: var(--eq-action); border-color: var(--eq-action); color: var(--eq-action-text); }
.eq-scale-labels {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var(--eq-faint);
	margin-bottom: 1.5rem;
	padding: 0 2px;
}

.eq-option {
	display: block;
	width: 100%;
	text-align: left;
	padding: 0.85rem 1.1rem;
	margin-bottom: 0.5rem;
	background: var(--eq-bg);
	border: 1px solid var(--eq-border);
	border-radius: var(--eq-radius);
	font-size: 16px;
	color: var(--eq-text);
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	line-height: 1.5;
}
.eq-option:hover { border-color: var(--eq-action); background: var(--eq-bg-alt); }
.eq-option.eq-sel { border-color: var(--eq-action); background: var(--eq-action-soft); color: var(--eq-text); font-weight: 600; }
/* Option with a short definition under its label (helps decide without knowing
   the term). */
.eq-option-label { display: block; }
.eq-option--has-hint .eq-option-label { font-weight: 600; margin-bottom: 3px; }
.eq-option-hint { display: block; font-size: 14px; font-weight: 400; line-height: 1.45; color: var(--eq-muted); }

.eq-next {
	padding: 0.65rem 1.6rem;
	border: 1px solid var(--eq-action);
	border-radius: var(--eq-radius);
	background: var(--eq-action);
	color: var(--eq-action-text);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	margin-top: 0.75rem;
	transition: opacity 0.15s;
}
.eq-next:disabled { opacity: 0.35; cursor: default; }
.eq-next:not(:disabled):hover { opacity: 0.85; }

.eq-step--feedback .eq-chosen {
	background: var(--eq-bg-alt);
	border-left: 3px solid var(--eq-muted);
	border-radius: 0 var(--eq-radius) var(--eq-radius) 0;
	padding: 0.6rem 0.9rem;
	margin-bottom: 1rem;
	font-size: 13px;
	color: var(--eq-muted);
	font-style: italic;
}

/* Dark (dramatic) story steps — the finale screen. */
.entangle-quiz.eq-dark { color: #f2f4f6; }
.eq-step--dark {
	background: #16191d;
	border-radius: 12px;
	padding: 2rem 1.75rem;
	color: #f2f4f6;
}
.eq-step--dark .eq-eyebrow { color: #aeb4bd; }
.eq-step--dark .eq-title { color: #ffffff; }
.eq-step--dark .eq-paragraph { color: #d7dbe0; }
/* Light button on the dark card (inverse of the neutral action button). */
.eq-step--dark .eq-next {
	background: #f2f4f6;
	border-color: #f2f4f6;
	color: #16191d;
}

/* Results */
.eq-result-card {
	background: var(--eq-bg);
	border: 1px solid var(--eq-border);
	border-radius: 12px;
	padding: 1.25rem;
	margin-bottom: 1rem;
}
.eq-result-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--eq-muted);
	margin-bottom: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.eq-dim-label {
	font-size: 12px;
	color: var(--eq-muted);
	margin-bottom: 3px;
	display: flex;
	justify-content: space-between;
}
.eq-dim-bar-wrap {
	height: 6px;
	background: var(--eq-border);
	border-radius: 3px;
	margin-bottom: 0.875rem;
	overflow: hidden;
}
.eq-dim-bar {
	height: 6px;
	border-radius: 3px;
	background: var(--eq-action);
	transition: width 0.8s ease;
}
.eq-footnote {
	font-size: 12px;
	color: var(--eq-faint);
	margin: 0.5rem 0 0;
}
.eq-score-points {
	font-size: 13px;
	color: var(--eq-muted);
	margin-bottom: 0.35rem;
}
.eq-band-title {
	font-size: 19px;
	font-weight: 700;
	margin: 0 0 0.5rem;
	color: var(--eq-text);
}
.eq-insight-box {
	background: var(--eq-bg-alt);
	border-radius: var(--eq-radius);
	padding: 1rem;
	margin-bottom: 0.75rem;
	font-size: 14px;
	line-height: 1.6;
	color: var(--eq-text);
}
.eq-insight-box .eq-paragraph { font-size: 14px; margin-bottom: 0.6rem; }
.eq-insight-box .eq-paragraph:last-child { margin-bottom: 0; }
.eq-insight-label {
	font-size: 11px;
	font-weight: 700;
	color: var(--eq-muted);
	margin-bottom: 0.35rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.eq-cta {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 1rem;
	border: 1px solid var(--eq-border);
	border-radius: var(--eq-radius);
	background: var(--eq-bg-alt);
	color: var(--eq-text);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-align: left;
	margin-top: 0.5rem;
	text-decoration: none;
}
.eq-cta:hover { background: var(--eq-bg); border-color: var(--eq-action); }
.eq-submit-note {
	font-size: 12px;
	color: var(--eq-faint);
	font-style: italic;
}

/* ── Assessment mode (Poznej faul) ─────────────────────────────────────── */

/* Correct / incorrect flag on the feedback screen. */
.eq-answer-flag {
	display: inline-block;
	font-size: 13px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
	margin-bottom: 0.75rem;
}
.eq-answer-correct { background: #e4f1e4; color: #14671e; }
.eq-answer-wrong   { background: #fbe6e6; color: #9a1f1f; }
.eq-step--dark .eq-answer-correct { background: rgba(80,180,90,.2); color: #a6e0ac; }
.eq-step--dark .eq-answer-wrong   { background: rgba(220,80,80,.2); color: #f0b1b1; }

/* Score summary. */
.eq-assess-big {
	font-size: 40px;
	font-weight: 800;
	line-height: 1.05;
	color: var(--eq-text);
}
.eq-assess-pct {
	font-size: 18px;
	font-weight: 600;
	color: var(--eq-muted);
	margin-top: 2px;
}

/* Missed-list. */
.eq-missed-item {
	padding: 0.7rem 0;
	border-top: 1px solid var(--eq-border);
}
.eq-missed-item:first-of-type { border-top: none; }
.eq-missed-label { font-weight: 600; font-size: 14px; color: var(--eq-text); }
.eq-missed-note  { font-size: 14px; line-height: 1.55; color: var(--eq-muted); margin-top: 2px; }
/* Softening line above the missed list at a low score — framing, not a label. */
.eq-missed-soft { font-size: 15px; line-height: 1.55; color: var(--eq-muted); margin: 0 0 0.6rem; }
/* "Show remaining (N)" — quiet link-like control; the rest stays collapsed. */
.eq-missed-toggle {
	background: none;
	border: 0;
	padding: 0.55rem 0;
	font-size: 14px;
	color: var(--eq-action);
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	min-height: 44px;
}
.eq-missed-rest[hidden] { display: none; }

/* Micro-commitment — designed as a task to complete, not an optional extra:
   the card carries an accent border and a status circle in the title that
   turns into a green check once a step is saved. */
.eq-ms-card { border: 2px solid var(--eq-action); }
.eq-ms-card.eq-ms-complete { border-color: #1a7a2e; }
.eq-ms-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-size: 17px;
	font-weight: 700;
	color: var(--eq-text);
	margin-bottom: 0.85rem;
	line-height: 1.35;
}
.eq-ms-check {
	flex: none;
	width: 22px;
	height: 22px;
	border: 2px solid var(--eq-border);
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	line-height: 1;
	color: #fff;
	transition: background 0.15s, border-color 0.15s;
}
.eq-ms-complete .eq-ms-check { background: #1a7a2e; border-color: #1a7a2e; }
.eq-ms-complete .eq-ms-check::before { content: "✓"; }

/* Radio-style options — the circle affordance says "pick one". */
.eq-microstep {
	display: block;
	position: relative;
	width: 100%;
	text-align: left;
	padding: 0.85rem 1.1rem 0.85rem 2.7rem;
	margin-bottom: 0.5rem;
	background: var(--eq-bg);
	border: 1px solid var(--eq-border);
	border-radius: var(--eq-radius);
	font-size: 16px;
	color: var(--eq-text);
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	line-height: 1.5;
}
.eq-microstep::before {
	content: "";
	position: absolute;
	left: 0.95rem;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	border: 2px solid var(--eq-border);
	border-radius: 50%;
	background: var(--eq-bg);
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.eq-microstep:hover { border-color: var(--eq-action); background: var(--eq-bg-alt); }
.eq-microstep:hover::before { border-color: var(--eq-action); }
.eq-microstep.eq-sel { border-color: var(--eq-action); background: var(--eq-action-soft); font-weight: 600; }
.eq-microstep.eq-sel::before {
	border-color: var(--eq-action);
	background: var(--eq-action);
	box-shadow: inset 0 0 0 3px var(--eq-bg);
}
/* "Your own step" — short text + save; the visible saved confirmation below. */
.eq-ms-custom { margin-top: 0.25rem; }
.eq-ms-custom-label { display: block; font-size: 14px; font-weight: 600; color: var(--eq-text); }
.eq-ms-custom-row { display: flex; gap: 8px; margin-top: 6px; }
.eq-ms-custom-input {
	flex: 1;
	min-height: 44px;
	box-sizing: border-box;
	padding: 0.55rem 0.75rem;
	font-size: 16px;
	font-weight: 400;
	border: 1px solid var(--eq-border);
	border-radius: var(--eq-radius);
	background: var(--eq-bg);
	color: var(--eq-text);
}
.eq-ms-custom-save { margin: 0; flex: none; }
.eq-ms-saved { font-size: 14px; color: var(--eq-muted); margin-top: 0.5rem; min-height: 1em; }
.eq-ms-saved--ok { color: #1a7a2e; font-weight: 600; }

/* Demographics + lead. */
.eq-demo-row {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 0.9rem;
}
.eq-demo-label { font-size: 14px; font-weight: 600; color: var(--eq-text); }
.eq-demo-select,
.eq-lead-email {
	width: 100%;
	min-height: 44px;
	box-sizing: border-box;
	padding: 0.55rem 0.75rem;
	font-size: 16px;
	border: 1px solid var(--eq-border);
	border-radius: var(--eq-radius);
	background: var(--eq-bg);
	color: var(--eq-text);
}
.eq-lead-email { margin-bottom: 0.75rem; }
.eq-lead-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--eq-text);
	margin-bottom: 0.85rem;
	cursor: pointer;
}
.eq-lead-consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.eq-lead-submit { margin-top: 0; }
.eq-lead-msg { font-size: 13px; color: var(--eq-muted); margin-top: 0.5rem; min-height: 1em; }
.eq-lead-privacy { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.eq-lead-events-row { margin: 0 0 0.9rem; }
.eq-lead-events { font-size: 15px; color: var(--eq-action); text-decoration: underline; text-underline-offset: 2px; }
.eq-share { text-align: left; }
.eq-share-row {
	display: flex;
	gap: 8px;
	align-items: stretch;
	flex-wrap: wrap;
}
.eq-share-url {
	flex: 1 1 200px;
	min-width: 0;
	min-height: 44px;
	box-sizing: border-box;
	padding: 0.55rem 0.75rem;
	font-size: 14px;
	border: 1px solid var(--eq-border);
	border-radius: var(--eq-radius);
	background: var(--eq-bg-alt);
	color: var(--eq-muted);
}
.eq-share-copy {
	flex: 0 0 auto;
	margin-top: 0;
	white-space: nowrap;
}
.eq-share-msg {
	font-size: 13px;
	color: #14671e;
	margin-top: 0.5rem;
	min-height: 1em;
}

/* ── Accessibility baseline ────────────────────────────────────────────── */

/* Visible keyboard focus on every interactive element. */
.entangle-quiz a:focus-visible,
.entangle-quiz button:focus-visible,
.entangle-quiz select:focus-visible,
.entangle-quiz input:focus-visible {
	outline: 3px solid var(--eq-action);
	outline-offset: 2px;
}
/* Comfortable click targets. */
.eq-next, .eq-option, .eq-scale-btn, .eq-microstep, .eq-cta { min-height: 44px; }

/* A touch larger again on small screens (WCAG-friendly for seniors). */
@media (max-width: 620px) {
	.entangle-quiz { font-size: 17px; }
	.eq-question { font-size: 20px; }
	.eq-paragraph, .eq-option, .eq-microstep, .eq-scale-btn { font-size: 17px; }
}

/* Honour reduced-motion — no information is carried by animation. */
@media (prefers-reduced-motion: reduce) {
	.eq-step, .eq-progress-fill, .eq-dim-bar { animation: none !important; transition: none !important; }
}
