/* ==========================================================================
   Neostella Data Ownership Quiz Block — Frontend Styles
   Block: neo/data-ownership-quiz
   Flow: intro → one question per step → lead capture → results
   ========================================================================== */

.neo-data-ownership-quiz {
	--neo-dq-bg: #000;
	--neo-dq-surface: #0d0d0d;
	--neo-dq-surface-hover: #151515;
	--neo-dq-line: rgba(255, 255, 255, 0.1);
	--neo-dq-line-strong: rgba(255, 255, 255, 0.16);
	--neo-dq-text: #fff;
	--neo-dq-muted: #8f8f8f;
	--neo-dq-indigo: #403eff;
	--neo-dq-violet: #bb00ff;
	--neo-dq-violet-text: #d58cff;
	--neo-dq-ok: #4ade80;
	--neo-dq-error: #ff6b6b;
	--neo-dq-gradient: linear-gradient(90deg, var(--neo-dq-indigo), var(--neo-dq-violet));
	--neo-dq-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--neo-dq-results-max-height: min(360px, 55vh);

	background: var(--neo-dq-bg);
	color: var(--neo-dq-text);
	font-family: inherit;
	overflow-x: clip;
}

.neo-data-ownership-quiz *,
.neo-data-ownership-quiz *::before,
.neo-data-ownership-quiz *::after {
	box-sizing: border-box;
}

.neo-dq-wrap {
	max-width: 760px;
	margin: 0 auto;
	padding: 48px 16px 64px;
}

.neo-dq-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Headings that receive programmatic focus on step change */
.neo-dq-stage [data-focus-on-enter]:focus {
	outline: none;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.neo-dq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 13px 22px;
	border-radius: 10px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: opacity 0.2s, border-color 0.15s, background-color 0.15s, transform 0.1s;
}

.neo-dq-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.neo-dq-btn:focus-visible {
	outline: 2px solid var(--neo-dq-text);
	outline-offset: 3px;
}

.neo-dq-btn--primary {
	border: none;
	background: var(--neo-dq-gradient);
	color: #fff;
}

.neo-dq-btn--primary:hover:not(:disabled) {
	opacity: 0.9;
}

.neo-dq-btn--primary:disabled {
	background: #1a1a1a;
	color: #5c5c5c;
	cursor: not-allowed;
}

.neo-dq-btn--ghost {
	border: 1px solid var(--neo-dq-line-strong);
	background: transparent;
	color: var(--neo-dq-text);
}

.neo-dq-btn--ghost:hover {
	border-color: rgba(255, 255, 255, 0.34);
}

.neo-dq-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding-top: 28px;
}

/* Back / Next row: Back stays left, primary action right */
.neo-dq-nav {
	display: flex;
	flex-direction: column-reverse;
	gap: 12px;
	padding-top: 28px;
}

.neo-dq-actions .neo-dq-btn,
.neo-dq-nav .neo-dq-btn {
	width: 100%;
}

/* --------------------------------------------------------------------------
   Intro screen
   -------------------------------------------------------------------------- */

.neo-dq-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.16em;
	font-size: 12px;
	color: var(--neo-dq-muted);
	margin: 0 0 14px;
}

.neo-dq-title {
	font-size: clamp(34px, 5.5vw, 58px);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
	margin: 0 0 20px;
	max-width: 640px;
	color: var(--neo-dq-text);
}

.neo-dq-subtitle {
	font-size: 18px;
	line-height: 1.5;
	color: var(--neo-dq-muted);
	max-width: 560px;
	margin: 0;
}

.neo-dq-intro-meta {
	margin: 24px 0 0;
	padding-top: 20px;
	border-top: 1px solid var(--neo-dq-line);
	font-size: 14px;
	color: var(--neo-dq-muted);
}

/* --------------------------------------------------------------------------
   Question step — meta row + segmented progress
   -------------------------------------------------------------------------- */

.neo-dq-step-meta {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	margin-bottom: 12px;
}

.neo-dq-step-section {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	min-width: 0;
}

.neo-dq-step-section-count {
	font-size: 13px;
	color: var(--neo-dq-muted);
}

.neo-dq-step-section-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--neo-dq-text);
}

.neo-dq-step-count {
	margin: 0;
	font-size: 14px;
	color: var(--neo-dq-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.neo-dq-step-count strong {
	color: var(--neo-dq-text);
	font-size: 20px;
}

.neo-dq-progress {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 6px;
}

.neo-dq-progress-seg {
	height: 4px;
	border-radius: 999px;
	background: #1c1c1c;
	overflow: hidden;
}

.neo-dq-progress-seg.is-current {
	background: #2c2c2c;
}

.neo-dq-progress-fill {
	height: 100%;
	border-radius: 999px;
	background: var(--neo-dq-gradient);
	transition: width 0.3s var(--neo-dq-ease);
}

/* --------------------------------------------------------------------------
   Question step — body
   -------------------------------------------------------------------------- */

.neo-dq-step-body {
	padding-top: 32px;
}

.neo-dq-step-intro {
	margin: 0 0 12px;
	max-width: 560px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--neo-dq-muted);
}

.neo-dq-step-question {
	margin: 0 0 28px;
	max-width: 680px;
	font-size: clamp(24px, 4vw, 34px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.015em;
	color: var(--neo-dq-text);
}

.neo-dq-choices {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

.neo-dq-choice {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 60px;
	padding: 14px 18px;
	border: 1px solid var(--neo-dq-line-strong);
	border-radius: 12px;
	background: var(--neo-dq-surface);
	color: var(--neo-dq-text);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: border-color 0.15s, background-color 0.15s, transform 0.1s;
}

.neo-dq-choice:hover {
	border-color: rgba(255, 255, 255, 0.34);
	background: var(--neo-dq-surface-hover);
}

.neo-dq-choice:active {
	transform: scale(0.985);
}

.neo-dq-choice.is-selected {
	border-color: var(--neo-dq-violet);
	background: rgba(187, 0, 255, 0.14);
}

/* Native radio stays focusable and announced; the pill is the visual */
.neo-dq-choice-input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.neo-dq-choice:has(.neo-dq-choice-input:focus-visible) {
	outline: 2px solid var(--neo-dq-text);
	outline-offset: 3px;
}

.neo-dq-choice-indicator {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.neo-dq-choice.is-selected .neo-dq-choice-indicator {
	border-color: var(--neo-dq-violet);
	background: var(--neo-dq-violet);
	box-shadow: inset 0 0 0 3px #000;
	animation: neo-dq-pop 0.22s var(--neo-dq-ease);
}

.neo-dq-choice-label {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Lead capture
   -------------------------------------------------------------------------- */

.neo-dq-screen-title {
	margin: 0 0 10px;
	font-size: clamp(28px, 4.5vw, 38px);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--neo-dq-text);
}

.neo-dq-screen-subtitle {
	margin: 0 0 28px;
	max-width: 500px;
	font-size: 16px;
	line-height: 1.5;
	color: var(--neo-dq-muted);
}

.neo-dq-field-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.neo-dq-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--neo-dq-text);
}

.neo-dq-field input {
	width: 100%;
	height: 50px;
	padding: 12px 14px;
	border: 1px solid var(--neo-dq-line-strong);
	border-radius: 10px;
	background: var(--neo-dq-surface);
	color: var(--neo-dq-text);
	font: inherit;
	font-size: 16px; /* 16px+ prevents iOS zoom on focus */
	transition: border-color 0.15s, box-shadow 0.15s;
}

.neo-dq-field input:hover {
	border-color: rgba(255, 255, 255, 0.3);
}

.neo-dq-field input:focus {
	outline: none;
	border-color: var(--neo-dq-indigo);
	box-shadow: 0 0 0 3px rgba(64, 62, 255, 0.35);
}

.neo-dq-field.has-error input {
	border-color: var(--neo-dq-error);
}

.neo-dq-field-error {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--neo-dq-error);
}

.neo-dq-field-error:empty {
	display: none;
}

.neo-dq-consent {
	margin: 20px 0 0;
	max-width: 560px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--neo-dq-muted);
}

.neo-dq-consent a {
	color: var(--neo-dq-text);
}

/* Honeypot — off-screen, not display:none (some bots skip hidden fields) */
.neo-dq-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   Results
   -------------------------------------------------------------------------- */

.neo-dq-score-card {
	margin-bottom: 32px;
	padding: 24px;
	border: 1px solid var(--neo-dq-line);
	border-radius: 16px;
	background: var(--neo-dq-surface);
}

.neo-dq-results-label {
	margin: 0 0 10px;
	font-size: 15px;
	color: var(--neo-dq-muted);
}

.neo-dq-results-headline {
	margin: 0 0 12px;
	font-size: clamp(28px, 4.5vw, 38px);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--neo-dq-text);
}

.neo-dq-results-summary {
	margin: 0;
	max-width: 560px;
	font-size: 16px;
	line-height: 1.5;
	color: var(--neo-dq-muted);
}

.neo-dq-score-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 28px;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--neo-dq-line);
}

.neo-dq-stat {
	display: flex;
	flex-direction: column-reverse;
	gap: 4px;
}

.neo-dq-stat-label {
	font-size: 13px;
	color: var(--neo-dq-muted);
}

.neo-dq-stat-value {
	font-size: 32px;
	font-weight: 700;
	line-height: 1;
	color: var(--neo-dq-text);
	font-variant-numeric: tabular-nums;
}

.neo-dq-stat-value--flag {
	color: var(--neo-dq-violet-text);
}

.neo-dq-section-summaries {
	margin-bottom: 32px;
}

.neo-dq-section-summaries h3,
.neo-dq-gaps-heading {
	margin: 0 0 14px;
	font-size: 20px;
	font-weight: 700;
	color: var(--neo-dq-text);
}

.neo-dq-section-summary {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 12px 0;
	border-top: 1px solid #1a1a1a;
	font-size: 15px;
}

.neo-dq-section-summary-name {
	color: var(--neo-dq-text);
	font-weight: 500;
}

.neo-dq-section-status {
	flex-shrink: 0;
	font-size: 13px;
	text-align: right;
	color: var(--neo-dq-muted);
}

.neo-dq-section-status--ok {
	color: var(--neo-dq-ok);
}

.neo-dq-section-status--warn {
	color: var(--neo-dq-violet-text);
}

.neo-dq-gaps {
	margin-bottom: 8px;
}

/* Fixed-height, scrollable gaps list.
   Adjust the height with --neo-dq-results-max-height. */
.neo-dq-scroll {
	--neo-dq-scroll-bg: var(--neo-dq-bg);
	position: relative;
	max-height: var(--neo-dq-results-max-height);
	overflow-y: auto;
	border-top: 1px solid var(--neo-dq-line);
	border-bottom: 1px solid var(--neo-dq-line);
	scrollbar-width: thin;
	scrollbar-color: #3a3a3a transparent;
	-webkit-overflow-scrolling: touch;

	/* Scroll shadows: fade appears at an edge only when more content is there */
	background:
		linear-gradient(var(--neo-dq-scroll-bg) 30%, rgba(0, 0, 0, 0)) center top,
		linear-gradient(rgba(0, 0, 0, 0), var(--neo-dq-scroll-bg) 70%) center bottom,
		linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0)) center top,
		linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.9)) center bottom;
	background-repeat: no-repeat;
	background-size: 100% 40px, 100% 40px, 100% 18px, 100% 18px;
	background-attachment: local, local, scroll, scroll;
}

.neo-dq-scroll.is-scrollable {
	padding-right: 12px;
}

.neo-dq-scroll:focus-visible {
	outline: 2px solid var(--neo-dq-text);
	outline-offset: 3px;
}

.neo-dq-scroll::-webkit-scrollbar {
	width: 6px;
}

.neo-dq-scroll::-webkit-scrollbar-thumb {
	background: #3a3a3a;
	border-radius: 999px;
}

.neo-dq-scroll::-webkit-scrollbar-track {
	background: transparent;
}

/* Section name stays pinned while its gaps scroll underneath */
.neo-dq-gap-group {
	position: sticky;
	top: 0;
	z-index: 1;
	margin: 0;
	padding: 14px 0 6px;
	background: var(--neo-dq-bg);
	font-size: 14px;
	font-weight: 600;
	color: var(--neo-dq-muted);
}

.neo-dq-gap-list + .neo-dq-gap-group {
	margin-top: 8px;
}

.neo-dq-gap-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.neo-dq-gap-item {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 0;
	border-top: 1px solid #1a1a1a;
}

.neo-dq-gap-label {
	font-size: 15px;
	line-height: 1.4;
	color: #d0d0d0;
}

.neo-dq-gap-badge {
	flex-shrink: 0;
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(187, 0, 255, 0.18);
	color: var(--neo-dq-violet-text);
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

.neo-dq-gap-empty {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--neo-dq-muted);
}

/* --------------------------------------------------------------------------
   Step transitions (respond to the visitor's action only)
   -------------------------------------------------------------------------- */

@keyframes neo-dq-in-forward {
	from { opacity: 0; transform: translateX(28px); }
	to   { opacity: 1; transform: none; }
}

@keyframes neo-dq-in-back {
	from { opacity: 0; transform: translateX(-28px); }
	to   { opacity: 1; transform: none; }
}

@keyframes neo-dq-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes neo-dq-pop {
	from { transform: scale(0.6); }
	to   { transform: scale(1); }
}

.neo-dq-stage.is-enter-forward .neo-dq-animate {
	animation: neo-dq-in-forward 0.32s var(--neo-dq-ease) both;
}

.neo-dq-stage.is-enter-back .neo-dq-animate {
	animation: neo-dq-in-back 0.32s var(--neo-dq-ease) both;
}

.neo-dq-stage.is-enter-forward .neo-dq-intro,
.neo-dq-stage.is-enter-back .neo-dq-intro {
	animation: neo-dq-fade 0.3s ease both;
}

/* --------------------------------------------------------------------------
   Static HTML fallback (crawlers / no-JS) — replaced on init
   -------------------------------------------------------------------------- */

.neo-dq-static-fallback {
	max-width: 760px;
	margin: 0 auto;
	padding: 48px 20px;
}

.neo-dq-static-fallback h2 {
	margin: 0 0 24px;
	font-size: 1.5rem;
	font-weight: 700;
}

.neo-dq-static-section {
	margin-bottom: 32px;
}

.neo-dq-static-section h3 {
	margin: 0 0 10px;
	font-size: 1.1rem;
	font-weight: 700;
}

.neo-dq-static-section ol {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding-left: 20px;
	list-style: decimal;
}

.neo-dq-static-section ol li {
	font-size: 0.9375rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.75);
}

/* --------------------------------------------------------------------------
   Larger screens (mobile-first above)
   -------------------------------------------------------------------------- */

@media (min-width: 641px) {
	.neo-dq-wrap {
		padding: 72px 20px 96px;
	}

	.neo-dq-actions {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.neo-dq-nav {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.neo-dq-actions .neo-dq-btn,
	.neo-dq-nav .neo-dq-btn {
		width: auto;
	}

	.neo-dq-nav .neo-dq-btn--primary {
		min-width: 190px;
	}

	/* Reserve 3 lines so choices and nav don't jump between questions */
	.neo-dq-step-question {
		min-height: calc(3 * 1.15em);
	}

	.neo-dq-step-intro {
		min-height: 3em;
	}

	.neo-dq-choices {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.neo-dq-field-grid {
		grid-template-columns: 1fr 1fr;
	}

	.neo-dq-field--wide {
		grid-column: 1 / -1;
	}

	.neo-dq-score-card {
		padding: 32px;
	}

	.neo-data-ownership-quiz {
		--neo-dq-results-max-height: 420px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.neo-data-ownership-quiz *,
	.neo-data-ownership-quiz *::before,
	.neo-data-ownership-quiz *::after {
		animation: none !important;
		transition: none !important;
	}
}
