/* Tracxion login screen: the standard for EVERY login screen. Load tokens/tokens.css and
   icons/bootstrap-icons.min.css first. The photograph (assets/login-bg.jpg) covers the viewport,
   unwashed - the image is the brand, not a texture - over a chrome-teal gradient that shows if it
   is missing or still loading. The card carries the wordmark (dark on light, white on dark), the
   app icon and name, the form, and optionally an "or" divider with a passkey button. */

*,
*::before,
*::after {
	box-sizing: border-box;
}

body.tx-login {
	margin: 0;
	min-height: 100vh;
	display: grid;
	grid-template-columns: minmax(0, 420px);
	place-content: center;
	padding: 24px 16px;
	font-family: var(--font-sans);
	color: var(--ink);
	background:
		url("../assets/login-bg.jpg") center / cover no-repeat fixed,
		radial-gradient(
			120% 120% at 30% 20%,
			var(--primary2) 0%,
			var(--primary) 55%,
			var(--primary-deep) 100%
		);
}

.tx-login-card {
	width: 100%;
	padding: 30px 30px 26px;
	border-radius: var(--r-md);
	background: var(--surface);
	box-shadow: var(--shadow-3);
}

/* the wordmark: one image per theme, swapped with the same rule tokens.css uses */
.tx-login-mark {
	display: flex;
	justify-content: center;
	margin-bottom: 14px;
}

.tx-login-mark img {
	height: 38px;
	width: auto;
}

.tx-login-mark .tx-wm-dark {
	display: none;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .tx-login-mark .tx-wm-light {
		display: none;
	}

	:root:not([data-theme="light"]) .tx-login-mark .tx-wm-dark {
		display: block;
	}
}

:root[data-theme="dark"] .tx-login-mark .tx-wm-light {
	display: none;
}

:root[data-theme="dark"] .tx-login-mark .tx-wm-dark {
	display: block;
}

.tx-login-card h1 {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--heading);
}

.tx-login-card h1 .bi {
	color: var(--action);
	font-size: 1rem;
}

.tx-login-sub {
	margin: 2px 0 20px;
	text-align: center;
	font-size: 0.875rem;
	color: var(--muted);
}

.tx-login-card label {
	display: block;
	margin: 14px 0 5px;
	font-size: 0.85rem;
	color: var(--ink);
}

.tx-login-card input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--input-line);
	border-radius: var(--r-sm);
	background: var(--field-bg);
	color: var(--ink);
	font: inherit;
}

.tx-login-card button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 9px 16px;
	border-radius: var(--r-sm);
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
}

.tx-login-card button[type="submit"] {
	margin-top: 22px;
	border: 0;
	background: var(--action);
	color: var(--on-action);
	font-weight: 700;
}

.tx-login-card button[type="submit"]:hover {
	background: var(--action-hover);
}

.tx-login-or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 16px 0;
	color: var(--muted);
	font-size: 0.78rem;
}

.tx-login-or::before,
.tx-login-or::after {
	content: "";
	flex: 1;
	border-top: 1px solid var(--line);
}

.tx-login-card .tx-login-alt {
	border: 1px solid var(--input-line);
	background: var(--surface);
	color: var(--ink);
}

.tx-login-card .tx-login-alt:hover {
	background: var(--nav-current);
}

.tx-login-error {
	margin: 0 0 12px;
	padding: 9px 12px;
	border-radius: var(--r-sm);
	background: var(--err-bg);
	color: var(--err-ink);
	font-size: 0.84rem;
}

/* White on the unwashed photograph measures 3.8-4.7:1 under this line; a faint ink pill behind
   just the text holds it above 6:1 without washing the image. */
.tx-login-foot {
	width: fit-content;
	margin: 16px auto 0;
	padding: 2px 10px;
	border-radius: var(--r-pill);
	background: rgb(6 21 19 / 30%);
	text-align: center;
	font-size: 0.78rem;
	color: var(--on-primary);
}

:focus-visible {
	outline: 3px solid var(--focus-ring);
	outline-offset: 2px;
}
