/**
 * The email gate in front of the timed instruments.
 *
 * House tokens throughout, so it reads as part of the page rather than as a
 * marketing overlay pasted on top of it. Deliberately not a full-bleed
 * interstitial: it is a panel the reader can dismiss, because the page behind
 * it is the free material and must stay reachable.
 */

.lr-test-gate[hidden] {
	display: none;
}

.lr-test-gate {
	position: fixed;
	inset: 0;
	z-index: 9000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--lr-gap-medium, 1rem);
}

.lr-test-gate__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
}

.lr-test-gate__panel {
	position: relative;
	width: min(34rem, 100%);
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
	padding: var(--lr-gap-large, 1.75rem);
	background: var(--lr-color-bg-card, #fff);
	border: 1px solid var(--lr-color-border-card, #e2e8f0);
	border-left: 3px solid var(--lr-color-accent, #1e3a8a);
	border-radius: 4px;
	box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.lr-test-gate__title {
	margin: 0 0 0.5rem;
	font-family: var(--lr-font-heading, Georgia, serif);
	font-size: var(--lr-font-size-h3, 1.4rem);
	line-height: var(--lr-line-height-heading, 1.2);
	color: var(--lr-color-text-main, #0f172a);
}

.lr-test-gate__lede {
	margin: 0 0 var(--lr-gap-medium, 1rem);
	color: var(--lr-color-text-muted, #475569);
	line-height: var(--lr-line-height-body, 1.6);
}

.lr-test-gate__label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: var(--lr-font-size-small, 0.875rem);
	font-weight: 600;
	color: var(--lr-color-text-main, #0f172a);
}

.lr-test-gate__input {
	width: 100%;
	padding: 0.6rem 0.7rem;
	font-size: 1rem;
	color: var(--lr-color-text-main, #0f172a);
	background: #fff;
	border: 1px solid var(--lr-color-border-card, #cbd5e1);
	border-radius: 3px;
}

.lr-test-gate__input:focus-visible {
	outline: 2px solid var(--lr-color-focus-ring, #1d4ed8);
	outline-offset: 1px;
}

.lr-test-gate__error {
	margin: 0.4rem 0 0;
	font-size: var(--lr-font-size-small, 0.875rem);
	color: #b91c1c;
}

.lr-test-gate__check {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	margin: var(--lr-gap-medium, 1rem) 0 0;
	font-size: var(--lr-font-size-small, 0.9rem);
	line-height: var(--lr-line-height-small, 1.5);
	color: var(--lr-color-text-main, #0f172a);
	cursor: pointer;
}

.lr-test-gate__check input {
	margin-top: 0.2rem;
	flex: none;
}

/* What starting the test signs the reader up to. Body colour, not the muted
   grey of the notice below the buttons: it is the one sentence on the panel
   that has to be read, so it must not be dressed as small print. */
.lr-test-gate__consent {
	margin: var(--lr-gap-medium, 1rem) 0 0;
	font-size: var(--lr-font-size-small, 0.9rem);
	line-height: var(--lr-line-height-small, 1.5);
	color: var(--lr-color-text-main, #0f172a);
}

/* Privacy and nothing else, and it sits after the buttons now that the consent
   has taken its place above them. */
.lr-test-gate__notice {
	margin: var(--lr-gap-medium, 1rem) 0 0;
	font-size: var(--lr-font-size-small, 0.85rem);
	line-height: var(--lr-line-height-small, 1.5);
	color: var(--lr-color-text-muted, #64748b);
}

.lr-test-gate__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--lr-gap-button, 0.75rem);
	margin-top: var(--lr-gap-large, 1.5rem);
}

/* The house outline button carries its colours but takes its padding from the
   anchor rules, so a <button> wearing the class renders at the browser default
   and reads as an afterthought beside the primary. Match the primary here. */
.lr-test-gate__cancel {
	padding: 0.65em 1.2em;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	border-radius: 6px;
	cursor: pointer;
}

/* The honeypot: reachable by a bot reading the DOM, invisible and unfocusable
   to a person. Not display:none, which some bots skip. */
.lr-test-gate__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

/* Hold the page still while the panel is up, so a dismissed gate returns the
   reader to the same scroll position. */
.lr-test-gate-open body {
	overflow: hidden;
}

/* A PHONE HAS TO SHOW THE BUTTON WITHOUT SCROLLING. Measured at 375x812 before
   this rule: 1091px of panel in a 686px box, with Start at y=803, so the reader
   met a form whose control was out of sight. The copy was cut first; this takes
   the rest out of the gaps, which is where a panel of six stacked blocks spends
   it. Nothing here changes on a laptop. */
@media (max-width: 480px) {
	.lr-test-gate {
		padding: 0.5rem;
	}

	.lr-test-gate__panel {
		padding: 1.1rem;
		max-height: calc(100vh - 1rem);
	}

	.lr-test-gate__lede {
		margin-bottom: 0.85rem;
	}

	.lr-test-gate__check,
	.lr-test-gate__consent {
		margin-top: 0.75rem;
	}

	.lr-test-gate__actions {
		margin-top: 0.9rem;
	}

	.lr-test-gate__notice {
		margin-top: 0.75rem;
	}
}
