/* LSE Quiz Funnel. Everything is scoped under .lseq-* so the theme cannot restyle it.
   Change the brand colours here, once. */
.lseq-overlay,
.lseq-overlay *,
.lseq-overlay *::before,
.lseq-overlay *::after {
	box-sizing: border-box;
}

.lseq-overlay {
	--lseq-navy: #0f1e3a;
	--lseq-ink: #16233f;
	--lseq-muted: #4a5568;
	--lseq-paper: #fbfaf6;
	--lseq-line: #d9d4c4;
	--lseq-gold: #d9a93a;
	--lseq-tint: #fff4d6;
	--lseq-action: #b94e0a;
	--lseq-action-dark: #963f06;
	--lseq-error: #b3261e;
	--lseq-serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
	--lseq-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(8, 16, 36, 0.78);
	font-family: var(--lseq-sans);
	color: var(--lseq-ink);
	-webkit-text-size-adjust: 100%;
}

.lseq-overlay.is-open {
	display: flex;
}

html.lseq-lock {
	overflow: hidden;
}

.lseq-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	background: var(--lseq-paper);
	font-size: 17px;
	line-height: 1.55;
	overflow: hidden;
}

@media (min-width: 640px) {
	.lseq-dialog {
		width: min(720px, calc(100vw - 48px));
		height: auto;
		max-height: min(860px, calc(100dvh - 48px));
		border-radius: 20px;
		font-size: 18px;
		box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
	}
}

/* Top bar: progress and close */
.lseq-top {
	flex: none;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px 10px 20px;
	min-height: 60px;
}

.lseq-progress-wrap {
	flex: 1;
	min-width: 0;
}

.lseq-progress-label {
	margin: 0 0 6px;
	font-size: 0.82em;
	font-weight: 600;
	color: var(--lseq-muted);
}

.lseq-progress {
	height: 10px;
	background: #e7e2d2;
	border-radius: 99px;
	overflow: hidden;
}

.lseq-progress-fill {
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--lseq-navy), var(--lseq-gold));
	border-radius: 99px;
	transition: width 0.4s ease;
}

.lseq-overlay button.lseq-close {
	flex: none;
	appearance: none;
	-webkit-appearance: none;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--lseq-ink);
	font: 400 30px/1 var(--lseq-sans);
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
}

.lseq-overlay button.lseq-close:hover {
	background: #ece7d7;
}

/* Scrolling content */
.lseq-main {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 6px 20px 24px;
}

@media (min-width: 640px) {
	.lseq-main {
		padding: 8px 40px 28px;
	}
}

.lseq-main:focus,
.lseq-title:focus {
	outline: none;
}

.lseq-title {
	margin: 4px 0 14px;
	font-family: var(--lseq-serif);
	font-weight: 700;
	font-size: clamp(1.4rem, 5.2vw, 1.85rem);
	line-height: 1.25;
	color: var(--lseq-navy);
	text-transform: none;
	letter-spacing: normal;
}

.lseq-hint {
	margin: -6px 0 14px;
	color: var(--lseq-muted);
	font-size: 0.92em;
}

.lseq-text {
	margin: 0 0 14px;
	color: var(--lseq-ink);
}

.lseq-lead {
	font-family: var(--lseq-serif);
	font-size: 1.12em;
	line-height: 1.6;
}

/* Answer options */
.lseq-opts {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.lseq-opt {
	position: relative;
	display: flex;
	gap: 14px;
	align-items: flex-start;
	margin: 0;
	padding: 14px 16px;
	min-height: 56px;
	background: #fff;
	border: 2px solid var(--lseq-line);
	border-radius: 14px;
	cursor: pointer;
	font-size: 1em;
	line-height: 1.45;
	color: var(--lseq-ink);
	transition: border-color 0.15s, background-color 0.15s;
}

.lseq-opt:hover {
	border-color: #a9a28a;
}

.lseq-opt input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.lseq-mark {
	flex: none;
	width: 24px;
	height: 24px;
	margin-top: 1px;
	border: 2px solid #8c8670;
	border-radius: 50%;
	background: #fff;
	display: grid;
	place-items: center;
}

.lseq-opt.is-multi .lseq-mark {
	border-radius: 6px;
}

.lseq-mark::after {
	content: "";
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--lseq-navy);
	transform: scale(0);
	transition: transform 0.12s;
}

.lseq-opt.is-multi .lseq-mark::after {
	width: 6px;
	height: 12px;
	border-radius: 0;
	background: transparent;
	border: solid #fff;
	border-width: 0 3px 3px 0;
	transform: rotate(45deg) scale(0);
	margin-top: -2px;
}

.lseq-opt.is-on {
	border-color: var(--lseq-navy);
	background: var(--lseq-tint);
}

.lseq-opt.is-on .lseq-mark {
	border-color: var(--lseq-navy);
}

.lseq-opt.is-on .lseq-mark::after {
	transform: scale(1);
}

.lseq-opt.is-multi.is-on .lseq-mark {
	background: var(--lseq-navy);
}

.lseq-opt.is-multi.is-on .lseq-mark::after {
	transform: rotate(45deg) scale(1);
}

.lseq-opt:focus-within {
	outline: 3px solid #1d3a6e;
	outline-offset: 2px;
}

/* Footer actions */
.lseq-foot {
	flex: none;
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	align-items: center;
	padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
	background: var(--lseq-paper);
	border-top: 1px solid var(--lseq-line);
}

@media (min-width: 640px) {
	.lseq-foot {
		padding: 16px 40px;
	}
}

.lseq-foot:empty {
	display: none;
}

.lseq-overlay button.lseq-btn,
.lseq-overlay a.lseq-btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	min-height: 52px;
	padding: 0 28px;
	border: 2px solid var(--lseq-action);
	border-radius: 12px;
	background: var(--lseq-action);
	color: #fff;
	font: 700 1em/1.2 var(--lseq-sans);
	text-align: center;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
}

.lseq-overlay button.lseq-btn:hover,
.lseq-overlay a.lseq-btn:hover {
	background: var(--lseq-action-dark);
	border-color: var(--lseq-action-dark);
	color: #fff;
}

.lseq-overlay button.lseq-btn:disabled {
	background: #d6d1c0;
	border-color: #d6d1c0;
	color: #6b6757;
	cursor: not-allowed;
}

.lseq-overlay button.lseq-btn.is-ghost,
.lseq-overlay a.lseq-btn.is-ghost {
	background: transparent;
	color: var(--lseq-navy);
	border-color: #b7b098;
}

.lseq-overlay button.lseq-btn.is-ghost:hover,
.lseq-overlay a.lseq-btn.is-ghost:hover {
	background: #ece7d7;
	color: var(--lseq-navy);
}

.lseq-overlay button.lseq-btn.is-wide,
.lseq-overlay a.lseq-btn.is-wide {
	width: 100%;
}

.lseq-overlay button:focus-visible,
.lseq-overlay a:focus-visible,
.lseq-overlay input:focus-visible {
	outline: 3px solid #1d3a6e;
	outline-offset: 2px;
}

.lseq-overlay a.lseq-link {
	color: var(--lseq-navy);
	font-weight: 600;
	text-decoration: underline;
}

/* Image screens */
.lseq-fig {
	margin: 0 0 18px;
	background: var(--lseq-navy);
	border-radius: 14px;
	overflow: hidden;
	text-align: center;
}

.lseq-fig img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: min(50vh, 460px);
	margin: 0 auto;
}

@media (max-height: 620px) {
	.lseq-fig img {
		max-height: 34vh;
	}
}

.lseq-note {
	margin: 0 auto 8px;
	max-width: 32em;
	padding: 18px 20px;
	background: #fff;
	border: 0;
	border-radius: 12px;
	font-family: var(--lseq-serif);
	font-style: italic;
	font-weight: 700;
	font-size: 1.12em;
	line-height: 1.6;
	text-align: center;
	text-wrap: balance;
	color: var(--lseq-navy);
}

/* Fade in on every new screen */
.lseq-fade {
	animation: lseq-fadein 0.4s ease both;
}

@keyframes lseq-fadein {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* Brief "scoring" pause */
.lseq-pause {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 260px;
	gap: 18px;
}

.lseq-spin {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	border: 5px solid #e7e2d2;
	border-top-color: var(--lseq-navy);
	animation: lseq-spin 0.9s linear infinite;
}

@keyframes lseq-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Final scoring animation over the stars image */
.lseq-dialog.is-scoring .lseq-top,
.lseq-dialog.is-scoring .lseq-foot {
	display: none;
}

.lseq-dialog.is-scoring .lseq-main {
	padding: 0;
	display: flex;
}

.lseq-scoring {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 20px;
	padding: 40px 24px;
	min-height: 420px;
	text-align: center;
	color: #fff;
	background: #0b1730 center / cover no-repeat;
}

.lseq-scoring::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(8, 16, 36, 0.55), rgba(8, 16, 36, 0.8));
}

.lseq-scoring > * {
	position: relative;
}

.lseq-scoring .lseq-title {
	color: #fff;
	margin: 0;
}

.lseq-scoring-line {
	margin: 0;
	min-height: 1.6em;
	font-size: 1.05em;
	color: #f3ecd6;
}

.lseq-scoring-bar {
	width: min(320px, 80%);
	height: 8px;
	background: rgba(255, 255, 255, 0.25);
	border-radius: 99px;
	overflow: hidden;
}

.lseq-scoring-fill {
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, #f1d58a, var(--lseq-gold));
}

/* Form */
.lseq-field {
	margin: 0 0 16px;
}

.lseq-field label {
	display: block;
	margin: 0 0 6px;
	font-weight: 600;
	font-size: 0.95em;
	color: var(--lseq-ink);
}

.lseq-field input[type="text"],
.lseq-field input[type="email"] {
	display: block;
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 14px;
	border: 2px solid #a9a28a;
	border-radius: 12px;
	background: #fff;
	color: var(--lseq-ink);
	font: 400 16px/1.2 var(--lseq-sans);
	box-shadow: none;
}

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

.lseq-consent {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin: 4px 0 8px;
	font-size: 0.95em;
	line-height: 1.5;
}

.lseq-consent input {
	flex: none;
	width: 24px;
	height: 24px;
	margin: 2px 0 0;
	accent-color: var(--lseq-navy);
}

.lseq-error {
	margin: 8px 0 0;
	color: var(--lseq-error);
	font-weight: 600;
	font-size: 0.95em;
}

.lseq-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Results */
.lseq-points {
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 12px;
}

.lseq-points li {
	position: relative;
	margin: 0;
	padding: 12px 14px 12px 46px;
	background: #fff;
	border: 1px solid var(--lseq-line);
	border-radius: 12px;
}

.lseq-points li::before {
	content: "";
	position: absolute;
	left: 16px;
	top: 17px;
	width: 8px;
	height: 14px;
	border: solid var(--lseq-action);
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
}

.lseq-sent {
	margin: 14px 0 0;
	font-size: 0.9em;
	color: var(--lseq-muted);
}

.lseq-results-actions {
	display: grid;
	gap: 12px;
	margin-top: 8px;
}

/* The invitation block and launch button from [lse_quiz_button] */
.lseq-hero {
	text-align: center;
	margin: 0 auto;
	padding: 8px 12px;
}

.lseq-hero .lseq-hero-title {
	margin: 0 0 0.35em;
	font-size: clamp(1.6rem, 4.5vw, 2.3rem);
	line-height: 1.2;
	text-align: center;
}

.lseq-hero .lseq-hero-sub {
	margin: 0 0 3em;
	font-size: clamp(1.05rem, 2.6vw, 1.3rem);
	text-align: center;
}

.lseq-hero-btnwrap {
	position: relative;
	display: inline-block;
}

/* Glow that waxes and wanes behind the button */
.lseq-glow {
	position: absolute;
	inset: -6px;
	z-index: 0;
	border-radius: 20px;
	background: linear-gradient(90deg, #ff8a1f, #ffd37a, #ff6a00);
	filter: blur(16px);
	opacity: 0.35;
	pointer-events: none;
	animation: lseq-glow 3.4s ease-in-out infinite alternate;
}

.lseq-hero-btnwrap:hover .lseq-glow,
.lseq-hero-btnwrap:focus-within .lseq-glow {
	filter: blur(22px);
	animation: lseq-glow-hot 1.6s ease-in-out infinite alternate;
}

@keyframes lseq-glow {
	from {
		opacity: 0.25;
		transform: scale(0.98);
	}
	to {
		opacity: 0.7;
		transform: scale(1.07);
	}
}

@keyframes lseq-glow-hot {
	from {
		opacity: 0.75;
		transform: scale(1.04);
	}
	to {
		opacity: 1;
		transform: scale(1.14);
	}
}

button.lseq-launch {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	padding: 0 40px;
	border: 0;
	border-radius: 14px;
	background: #b94e0a;
	color: #fff;
	font: 700 19px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: transform 0.2s ease, background 0.2s ease;
}

button.lseq-launch:hover,
button.lseq-launch:focus-visible {
	background: #d2570a;
	color: #fff;
	transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
	.lseq-overlay *,
	.lseq-overlay *::before,
	.lseq-overlay *::after {
		animation-duration: 0.001s !important;
		animation-iteration-count: 1 !important;
		transition: none !important;
	}
	.lseq-spin {
		border-top-color: var(--lseq-navy);
		animation-duration: 0.9s !important;
		animation-iteration-count: infinite !important;
	}
}

/* Administrator preview (only rendered for logged-in admins) */
.lseq-admin {
	display: grid;
	gap: 10px;
	margin: 18px 0 0;
	padding: 14px 16px;
	background: #eef3fb;
	border: 2px dashed #1d3a6e;
	border-radius: 12px;
}

.lseq-admin-note {
	margin: 0;
	font-size: 0.92em;
	color: var(--lseq-navy);
}
