/* The package's pages. Everything an app might want to change is a variable:
   a stylesheet of its own, after this one, sets them on :root. */
:root {
	color-scheme: light dark;
	--auth-canvas: #f6f5f3;
	--auth-surface: #ffffff;
	--auth-ink: #1c1917;
	--auth-muted: #6b6560;
	--auth-line: #e4e1dc;
	--auth-accent: #3f3a36;
	--auth-accent-ink: #ffffff;
	--auth-danger: #b42318;
	--auth-danger-surface: #fef3f2;
	--auth-radius: 8px;
	--auth-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--auth-mono: ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
	:root {
		--auth-canvas: #161412;
		--auth-surface: #201d1b;
		--auth-ink: #f1efec;
		--auth-muted: #a39d96;
		--auth-line: #38332f;
		--auth-accent: #e7e3de;
		--auth-accent-ink: #1c1917;
		--auth-danger: #fda29b;
		--auth-danger-surface: #3a1a17;
	}
}

[hidden] {
	display: none !important;
}

.auth-page {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 3rem 1rem;
	box-sizing: border-box;
	background: var(--auth-canvas);
	color: var(--auth-ink);
	font-family: var(--auth-font);
	font-size: 15px;
	line-height: 1.5;
}

.auth-card,
.auth-section {
	width: 100%;
	max-width: 24rem;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 1.75rem;
	background: var(--auth-surface);
	border: 1px solid var(--auth-line);
	border-radius: var(--auth-radius);
}

.auth-security {
	width: 100%;
	max-width: 40rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.auth-section {
	max-width: none;
}

.auth-logo {
	height: 2rem;
	width: auto;
	align-self: flex-start;
}

.auth-heading {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.3;
}

.auth-section .auth-heading {
	font-size: 1.05rem;
}

.auth-lead,
.auth-note {
	margin: 0;
	color: var(--auth-muted);
}

.auth-note {
	font-size: 0.8125rem;
}

.auth-stack,
.auth-field {
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
}

.auth-field {
	gap: 0.375rem;
}

.auth-label {
	font-size: 0.8125rem;
	font-weight: 600;
}

.auth-input,
.auth-account {
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 0.5rem 0.75rem;
	font: inherit;
	color: inherit;
	background: var(--auth-canvas);
	border: 1px solid var(--auth-line);
	border-radius: var(--auth-radius);
	overflow-wrap: anywhere;
}

input[type="checkbox"].auth-input {
	width: auto;
	align-self: flex-start;
}

.auth-input:focus-visible,
.auth-button:focus-visible,
.auth-button-secondary:focus-visible {
	outline: 2px solid var(--auth-accent);
	outline-offset: 1px;
}

.auth-button,
.auth-button-secondary {
	padding: 0.5rem 0.875rem;
	font: inherit;
	font-weight: 600;
	border-radius: var(--auth-radius);
	cursor: pointer;
}

.auth-button {
	color: var(--auth-accent-ink);
	background: var(--auth-accent);
	border: 1px solid var(--auth-accent);
}

.auth-button-secondary {
	color: inherit;
	background: transparent;
	border: 1px solid var(--auth-line);
}

.auth-button:disabled,
.auth-button-secondary:disabled {
	opacity: 0.6;
	cursor: default;
}

.auth-link {
	padding: 0;
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	text-decoration: underline;
	cursor: pointer;
}

.auth-notice {
	margin: 0;
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
	color: var(--auth-danger);
	background: var(--auth-danger-surface);
	border-radius: var(--auth-radius);
}

.auth-or {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0;
	font-size: 0.75rem;
	color: var(--auth-muted);
}

.auth-or::before,
.auth-or::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--auth-line);
}

.auth-rows {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--auth-line);
	border-radius: var(--auth-radius);
}

.auth-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 1rem;
	padding: 0.625rem 0.875rem;
}

.auth-row + .auth-row {
	border-top: 1px solid var(--auth-line);
}

.auth-row-main {
	flex: 1;
	min-width: 0;
	overflow-wrap: anywhere;
}

.auth-row-title {
	margin: 0;
	font-weight: 600;
}

.auth-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
	align-items: center;
}

.auth-codes,
.auth-secret {
	margin: 0;
	padding: 0.75rem;
	font-family: var(--auth-mono);
	font-size: 0.875rem;
	background: var(--auth-canvas);
	border: 1px solid var(--auth-line);
	border-radius: var(--auth-radius);
	overflow-wrap: anywhere;
}

.auth-codes {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.25rem 1rem;
	list-style: none;
}

.auth-qr {
	width: 12rem;
	height: 12rem;
	/* The code stays black on white in both themes: a scanner needs it. */
	background: #fff;
	border-radius: var(--auth-radius);
}

.auth-signout {
	margin-top: 1.25rem;
	font-size: 0.875rem;
}

.auth-check {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	font-size: 0.875rem;
}

.auth-admin {
	width: 100%;
	max-width: 62rem;
	display: grid;
	grid-template-columns: 11rem minmax(0, 1fr);
	gap: 2rem;
	align-items: start;
}

.auth-admin-nav {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.auth-admin-nav a {
	padding: 0.375rem 0.625rem;
	color: inherit;
	text-decoration: none;
	border-radius: var(--auth-radius);
}

.auth-admin-nav a[aria-current="page"] {
	font-weight: 600;
	background: var(--auth-surface);
	border: 1px solid var(--auth-line);
}

.auth-admin-nav form {
	margin-top: 0.75rem;
	padding: 0 0.625rem;
	font-size: 0.875rem;
}

.auth-admin-main {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

@media (max-width: 42rem) {
	.auth-admin {
		grid-template-columns: minmax(0, 1fr);
	}

	.auth-admin-nav {
		flex-direction: row;
		flex-wrap: wrap;
	}
}

.auth-stats {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
	gap: 0.75rem;
}

.auth-stat {
	padding: 0.875rem 1rem;
	color: inherit;
	text-decoration: none;
	background: var(--auth-surface);
	border: 1px solid var(--auth-line);
	border-radius: var(--auth-radius);
}

.auth-stat-value {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 600;
}

.auth-badge {
	padding: 0.0625rem 0.5rem;
	font-size: 0.75rem;
	color: var(--auth-muted);
	border: 1px solid var(--auth-line);
	border-radius: 999px;
}

.auth-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
}

.auth-filters .auth-input {
	flex: 1 1 12rem;
	width: auto;
}
