/*
 * Login screen (light), ported from the prototype css/login.css (docs/login/v2, prototype login.html).
 * Served on wp-login.php?action=magicauth only; WordPress's own login CSS and MagicAuth's are dequeued
 * (blocks/login/hooks.php). The app is dark; the gate is light, like the Microsoft and Google sign-ins learners know.
 */
@font-face {
	font-family: "Inter";
	src: url("../../assets/fonts/inter-latin.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
}

:root {
	color-scheme: light;

	/* Proposed light tokens */
	--l-page: #FFFFFF;
	--l-ink: #0C0C0E;        /* the app's --c-base as ink */
	--l-ink-2: #45454D;      /* 9.9:1 on white */
	--l-ink-3: #6B6B73;      /* 5.3:1 on white */
	--l-edge: #8C8C94;       /* field edge, 3.4:1 on white (WCAG 1.4.11) */
	--l-hair: #E6E6EB;
	--l-fill: #F3F3F6;
	--l-act: #2463EB;        /* = --c-act, 5.2:1 on white */
	--l-act-hover: #1B50C7;
	--l-act-ring: rgb(36 99 235 / 0.16);
	--l-done: #75DFA1;       /* = --c-done, with ink label 11.9:1 */
	--l-warn: #B45309;       /* amber 700: the warn job on light, 5.0:1 on white; no red, as in the app */
	--l-warn-fill: #FFF7ED;
	--l-warn-edge: #F6D3A8;
	/* AI training module look: ground and accents sampled from shadow-ai-cover (Copilot icon, tile rims) */
	--ai-ground: #0A0910;
	--ai-haze: #1B1521;
	--ai-violet: #AB59DB;
	--ai-magenta: #D656A5;
	--ai-coral: #EB8160;
	--ai-blue: #2059CC;

	--f: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--r-control: 8px;
	--r-panel: 24px;
	--m-fast: 150ms;
	--ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--l-page);
	color: var(--l-ink);
	font: 400 1rem/1.5rem var(--f);
	letter-spacing: -0.011em;
	-webkit-font-smoothing: antialiased;
	font-optical-sizing: auto;
}
[hidden] { display: none !important; }

/* Layout: phone first. Logo, art band, form, language. */
.lg {
	min-height: 100svh;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "top" "art" "main" "foot";
	grid-template-rows: auto auto 1fr auto;
	padding: 0 16px;
}
.lg-top { grid-area: top; display: flex; align-items: center; height: 64px; }
.lg-main { grid-area: main; width: 100%; max-width: 400px; justify-self: center; padding: 28px 0 32px; }
.lg-foot { grid-area: foot; display: flex; justify-content: center; padding: 8px 0 max(16px, env(safe-area-inset-bottom)); }

/* Logo */
.lg-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--l-ink); text-decoration: none; min-height: 44px; border-radius: 6px; }
.lg-logo__mark { width: 28px; height: 22px; fill: currentColor; }
.lg-logo__name { font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.014em; }

/* Art: the AI training module's own cover on its dark haze, lit in the cover's accent colours */
.lg-art {
	grid-area: art;
	position: relative;
	margin: 0;
	height: 232px;
	border-radius: 20px;
	overflow: hidden;
	isolation: isolate;
	background:
		radial-gradient(50% 40% at 14% 30%, rgb(32 89 204 / 0.55), transparent 70%),
		radial-gradient(44% 38% at 50% 16%, rgb(171 89 219 / 0.58), transparent 72%),
		radial-gradient(48% 42% at 90% 30%, rgb(235 129 96 / 0.46), transparent 72%),
		radial-gradient(60% 50% at 72% 62%, rgb(214 86 165 / 0.30), transparent 75%),
		linear-gradient(180deg, var(--ai-haze), var(--ai-ground) 70%);
}
.lg-art picture { position: absolute; inset: 0; z-index: -1; }
.lg-art__img {
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: 46% 30%;
	transform: translateX(-50%);
	mix-blend-mode: lighten;
	opacity: 0;
	transition: opacity 300ms var(--ease-out);
}
.lg-art.is-ready .lg-art__img, .no-js .lg-art__img { opacity: 1; }

/* Caption: the announcement. On phones it sits on the band's floor, on desktop at the top of the panel. */
.lg-art__cap {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 40px 16px 14px;
	background: linear-gradient(180deg, transparent, rgb(10 9 16 / 0.85) 55%);
	color: #FFFFFF;
}
.lg-art__title { font-size: 1rem; line-height: 1.375rem; font-weight: 600; letter-spacing: -0.011em; }
.lg-art__text { font-size: 0.875rem; line-height: 1.25rem; color: rgb(255 255 255 / 0.78); }

/* Type */
.lg-h1 {
	margin: 0;
	font-size: 2rem;
	line-height: 2.5rem;
	font-weight: 600;
	letter-spacing: -0.0216em;
}
.lg-sub { margin: 8px 0 0; color: var(--l-ink-2); font-size: 1rem; line-height: 1.5rem; }

/* Form */
.lg-form { margin-top: 28px; }
.lg-label { display: block; font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; letter-spacing: -0.006em; margin-bottom: 8px; }
.lg-input {
	display: block;
	width: 100%;
	height: 48px;
	padding: 0 14px;
	font: inherit;
	font-size: 1rem;
	color: var(--l-ink);
	background: var(--l-page);
	border: 1px solid var(--l-edge);
	border-radius: var(--r-control);
	transition: border-color var(--m-fast), box-shadow var(--m-fast);
}
.lg-input::placeholder { color: #9A9AA2; opacity: 1; }
.lg-input:hover { border-color: var(--l-ink-3); }
.lg-input:focus { outline: none; border-color: var(--l-act); box-shadow: 0 0 0 1px var(--l-act), 0 0 0 5px var(--l-act-ring); }
.lg-input[aria-invalid="true"] { border-color: var(--l-warn); box-shadow: 0 0 0 1px var(--l-warn); }
.lg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.lg-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 48px;
	margin-top: 16px;
	padding: 0 20px;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: -0.011em;
	color: #FFFFFF;
	background: var(--l-act);
	border: 0;
	border-radius: var(--r-control);
	cursor: pointer;
	transition: background-color var(--m-fast), transform 80ms;
}
.lg-btn:hover { background: var(--l-act-hover); }
.lg-btn:active { transform: translateY(1px); }
.lg-btn:focus-visible { outline: 2px solid var(--l-act); outline-offset: 2px; }
.lg-btn__check { display: none; width: 20px; height: 20px; }
.lg-btn--secondary { margin-top: 0; color: var(--l-ink); background: var(--l-page); box-shadow: inset 0 0 0 1px #C9C9CF; }
.lg-btn--secondary:hover { background: var(--l-fill); }
.lg-btn--secondary[aria-busy="true"] { color: var(--l-ink-3); cursor: progress; }

/* Passkey block: divider, button, live regions (the regions are always rendered, never hidden) */
[data-magicauth-passkey-root][hidden], [data-magicauth-passkey-signin][hidden] { display: none !important; }
.lg-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; font-size: 0.875rem; line-height: 1.25rem; color: var(--l-ink-3); }
.lg-divider::before, .lg-divider::after { content: ""; flex: 1; height: 1px; background: var(--l-hair); }
.lg-pk__error:empty { display: none; }
.lg-sr { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lg-btn.is-busy .lg-btn__label { opacity: 0.6; }

/* Links */
.lg-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--l-act);
	background: none;
	border: 0;
	cursor: pointer;
	border-radius: 4px;
}
.lg-link:hover { color: var(--l-act-hover); text-decoration: underline; text-underline-offset: 3px; }
.lg-link:focus-visible, .lg-inline:focus-visible, .lg-logo:focus-visible, .lg-lang__opt:focus-visible { outline: 2px solid var(--l-act); outline-offset: 2px; }
.lg-link--inline { min-height: 32px; }
.lg-inline { color: var(--l-act); text-underline-offset: 3px; }

/* Notices and errors stay until the next action (no toasts) */
.lg-notice {
	display: flex;
	gap: 10px;
	margin: 0 0 24px;
	padding: 12px 14px;
	font-size: 0.9375rem;
	line-height: 1.375rem;
	color: var(--l-ink);
	background: var(--l-warn-fill);
	border: 1px solid var(--l-warn-edge);
	border-radius: 12px;
}
.lg-notice--plain { background: var(--l-fill); border-color: var(--l-hair); }
.lg-notice__icon { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--l-warn); }
.lg-error { display: flex; gap: 8px; margin: 8px 0 0; font-size: 0.9375rem; line-height: 1.375rem; color: var(--l-warn); }
.lg-error__icon { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.lg-hint { margin: 8px 0 0; font-size: 0.875rem; line-height: 1.25rem; color: var(--l-ink-3); }

/* Address echo */
.lg-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 10px 0 0; }
.lg-chip {
	display: inline-block;
	max-width: 100%;
	padding: 6px 12px;
	font-size: 0.9375rem;
	line-height: 1.25rem;
	font-weight: 500;
	background: var(--l-fill);
	border-radius: 999px;
	overflow-wrap: anywhere;
}

/* Code: one real input. With JS it is drawn as six slots; without JS it is a plain field. */
.lg-code { position: relative; }
.lg-code__slots { display: none; }
.js .lg-code__slots {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr)) 20px repeat(3, minmax(0, 1fr));
	gap: 8px;
	pointer-events: none;
}
.js .lg-code__input {
	position: absolute;
	inset: 0;
	height: 100%;
	opacity: 0;
	z-index: 1;
	cursor: text;
}
.lg-slot {
	display: grid;
	place-items: center;
	height: 60px;
	font-size: 1.5rem;
	font-weight: 600;
	letter-spacing: 0;
	font-variant-numeric: tabular-nums;
	border: 1px solid var(--l-edge);
	border-radius: var(--r-control);
	background: var(--l-page);
	transition: border-color var(--m-fast), box-shadow var(--m-fast), background-color var(--m-fast);
}
.lg-code__dash { align-self: center; justify-self: center; width: 12px; height: 2px; border-radius: 1px; background: var(--l-edge); }
.lg-code.is-focus .lg-slot.is-active { border-color: var(--l-act); box-shadow: 0 0 0 1px var(--l-act), 0 0 0 5px var(--l-act-ring); }
.lg-code.is-focus .lg-slot.is-active:empty::after { content: ""; width: 2px; height: 26px; background: var(--l-act); }
.lg-code.is-invalid .lg-slot { border-color: var(--l-warn); }
.lg-code.is-done .lg-slot { border-color: transparent; background: var(--l-done); }

/* Success: one beat in done green, then the dashboard */
.lg-btn.is-done, .lg-btn.is-done:hover { background: var(--l-done); color: var(--l-ink); box-shadow: none; }
.lg-btn.is-done .lg-btn__check { display: block; }

/* Resend, note */
.lg-resend { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin: 16px 0 0; font-size: 0.9375rem; line-height: 1.375rem; color: var(--l-ink-3); min-height: 32px; }
.lg-count { font-weight: 500; font-variant-numeric: tabular-nums; }
.lg-note { margin: 4px 0 0; font-size: 0.875rem; line-height: 1.25rem; color: var(--l-ink-3); }

/* Login trouble, inline: Help sits behind the wall */
.lg-help { margin-top: 20px; padding-top: 4px; border-top: 1px solid var(--l-hair); }
.lg-help summary { list-style: none; gap: 6px; }
.lg-help summary::-webkit-details-marker { display: none; }
.lg-help summary::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-left: 2px;
	border-right: 1.6px solid currentColor;
	border-bottom: 1.6px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform var(--m-fast);
}
.lg-help[open] summary::after { transform: translateY(2px) rotate(225deg); }
.lg-help__list { margin: 0 0 4px; padding-left: 20px; font-size: 0.9375rem; line-height: 1.375rem; color: var(--l-ink-2); }
.lg-help__list li + li { margin-top: 8px; }
.lg-help__list li::marker { color: var(--l-ink-3); }

/* Language */
.lg-lang { display: inline-flex; gap: 4px; padding: 4px; background: var(--l-fill); border-radius: 999px; }
.lg-lang__opt {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 14px;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--l-ink-3);
	text-decoration: none;
	border-radius: 999px;
}
.lg-lang__opt:hover { color: var(--l-ink); }
.lg-lang__opt[aria-current="true"] { color: var(--l-ink); background: var(--l-page); box-shadow: 0 1px 2px rgb(12 12 14 / 0.08), 0 0 0 1px rgb(12 12 14 / 0.04); }

.lg-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Step change: the new step rises in, as the exam's status line does (exam.css 218-232) */
.js .lg-step.is-in { animation: lg-in 220ms var(--ease-out); }
@keyframes lg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Small phones: shorter art band */
@media (max-width: 359px) {
	.lg-art { height: 176px; border-radius: 16px; }
	.lg-main { padding-top: 22px; }
	.lg-h1 { font-size: 1.75rem; line-height: 2.125rem; }
	.lg-form { margin-top: 22px; }
	.lg-slot { height: 52px; font-size: 1.25rem; }
	.js .lg-code__slots { gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)) 14px repeat(3, minmax(0, 1fr)); }
}

/* Tablet: one column, a wider band */
@media (min-width: 600px) and (max-width: 1023px) {
	.lg { padding: 0 24px; }
	.lg-art { height: 280px; width: 100%; max-width: 560px; justify-self: center; }
	.lg-main { padding-top: 40px; }
}

/* Desktop: form column left, art panel right, inset like the app's frame */
@media (min-width: 1024px) {
	.lg {
		grid-template-columns: minmax(480px, 1fr) minmax(0, 1.08fr);
		grid-template-areas: "top art" "main art" "foot art";
		grid-template-rows: auto 1fr auto;
		padding: 0;
		height: 100svh;
		min-height: 640px;
	}
	.lg-top, .lg-main, .lg-foot { width: 100%; max-width: 400px; justify-self: center; }
	.lg-top { height: 96px; }
	.lg-main { align-self: center; padding: 0 0 24px; }
	.lg-foot { justify-content: flex-start; padding: 0 0 32px; }
	.lg-art { height: auto; margin: 16px 16px 16px 0; border-radius: var(--r-panel); }
	.lg-art__img { width: 122%; height: auto; object-fit: initial; }
	.lg-art__img { -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%); mask-image: linear-gradient(180deg, transparent, #000 14%); }
	.lg-art__cap {
		top: 0; bottom: auto;
		gap: 12px;
		max-width: 480px;
		padding: 64px 0 0 64px;
		background: none;
	}
	.lg-art__title { font-size: 2rem; line-height: 2.5rem; letter-spacing: -0.0216em; text-wrap: balance; }
	.lg-art__text { font-size: 1.0625rem; line-height: 1.625rem; max-width: 360px; text-wrap: balance; }
}
@media (min-width: 1024px) and (max-height: 760px) {
	.lg-art__img { width: 112%; }
	.lg-art__cap { padding: 48px 0 0 48px; }
}

@media (prefers-reduced-motion: reduce) {
	.lg-art__img, .lg-input, .lg-slot, .lg-btn { transition: none; }
	.js .lg-step.is-in { animation: none; }
}

/* wp-login.php leftovers around the screen (core and MagicAuth markup this screen does not use) */
body.login > h1.screen-reader-text, .wp-login-logo, #backtoblog, .privacy-policy-page-link, #login_error, #login > .message, .magicauth-toast, .language-switcher { display: none !important; }
#login { display: contents; }

/* Without JS the countdown cannot run: offer the resend straight away (the server keeps the cooldown) */
.no-js .lg-resend__wait { display: none !important; }
.no-js #resend { display: inline-flex !important; }
a.lg-link { text-decoration: none; }
.lg-btn[aria-busy="true"] { cursor: progress; }
.lg-btn[aria-busy="true"] .lg-btn__label { opacity: 0.6; }
