:root {
	--login-ctl: 2.75rem;
	--login-radius: 12px;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--display);
	font-size: var(--t-sm);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.gate {
	min-height: 100dvh;
	display: grid;
	place-items: center;
	padding: 1.5rem;
}

.card {
	width: min(100%, 26rem);
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--login-radius);
	padding: 1.75rem;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.06);
}

.header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 1rem;
}

.kicker {
	margin: 0;
	font-family: var(--mono);
	font-size: var(--t-label);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--fg-muted);
}

h1 {
	margin: 0.25rem 0 0;
	font-size: var(--t-md);
	font-weight: 650;
}

.hint {
	margin: 0 0 1.25rem;
	font-size: var(--t-xs);
	color: var(--fg-muted);
}

.hint a {
	color: var(--accent);
}

button.google {
	width: 100%;
	height: var(--login-ctl);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--bg);
	color: var(--fg);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

button.google:hover {
	border-color: var(--accent);
}

button.google:disabled {
	opacity: 0.65;
	cursor: wait;
}

button.google:focus-visible {
	outline: 2px solid var(--accent-ring);
}

.google__mark {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
}

.divider {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 1rem 0 1.15rem;
	color: var(--fg-muted);
	font-size: var(--t-xs);
}

.divider::before,
.divider::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: var(--border);
}

.tabs {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.35rem;
	margin-bottom: 1.25rem;
}

.tab {
	appearance: none;
	border: 1px solid var(--border);
	background: transparent;
	color: var(--fg-muted);
	border-radius: 999px;
	padding: 0.45rem 0.65rem;
	font: inherit;
	font-size: var(--t-xs);
	cursor: pointer;
}

.tab[aria-selected="true"] {
	background: var(--accent-soft);
	border-color: var(--accent);
	color: var(--fg);
}

.panel[hidden] {
	display: none;
}

label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: var(--t-xs);
	color: var(--fg-muted);
}

input {
	width: 100%;
	height: var(--login-ctl);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 0 0.85rem;
	font: inherit;
	background: var(--bg);
	color: var(--fg);
	margin-bottom: 0.85rem;
}

input:focus-visible {
	outline: 2px solid var(--accent-ring);
	border-color: var(--accent);
}

button[type="submit"],
button.primary {
	width: 100%;
	height: var(--login-ctl);
	border: none;
	border-radius: 8px;
	background: var(--accent);
	color: var(--on-accent);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

button[type="submit"]:disabled,
button.primary:disabled {
	opacity: 0.65;
	cursor: wait;
}

.error {
	margin: 0.85rem 0 0;
	color: var(--accent-strong);
	font-size: var(--t-xs);
}

.success {
	margin: 0.85rem 0 0;
	color: var(--p-green);
	font-size: var(--t-xs);
}

.view[hidden] {
	display: none;
}

/*
 * Magic link and forgot password sit under the password box as quiet recoveries
 * — theme blue, so they read as links and never compete with the accent-coloured
 * Sign in button.
 */
.assist {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	margin: 0.25rem 0 1rem;
	font-size: var(--t-xs);
}

.linkish {
	appearance: none;
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	font-size: var(--t-xs);
	color: var(--confidence);
	cursor: pointer;
	text-decoration: none;
}

.linkish:hover {
	text-decoration: underline;
}

.linkish:focus-visible {
	outline: 2px solid var(--confidence);
	outline-offset: 2px;
	border-radius: 4px;
}

.assist__sep {
	color: var(--border);
}

/* Every assist row follows a submit button, so it needs room to clear it. */
form + .assist {
	margin-top: 0.9rem;
}

a.linkish {
	text-decoration: none;
}

/* ---------- /access ---------- */

.access-who {
	margin: 0 0 1.25rem;
	color: var(--fg-muted);
	font-size: var(--t-xs);
}

/* Invite-only request form. Inputs and .primary inherit the card's controls;
   only the block itself and the textarea need saying. */
.access-request {
	margin: 0 0 1.25rem;
	padding-top: 1.1rem;
	border-top: 1px solid var(--border);
}

.access-request[hidden] {
	display: none;
}

.access-request__title {
	margin: 0 0 0.35rem;
	font-size: var(--t-sm);
	font-weight: 600;
}

.access-request .hint {
	margin-bottom: 1rem;
}

.access-request textarea {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 0.6rem 0.85rem;
	font: inherit;
	background: var(--bg);
	color: var(--fg);
	margin-bottom: 0.85rem;
	resize: vertical;
}

.access-request textarea:focus-visible {
	outline: 2px solid var(--accent-ring);
	border-color: var(--accent);
}

.access-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.access-actions .primary {
	flex: 1 1 auto;
	width: auto;
}

.access-actions .ghost {
	flex: 0 0 auto;
	height: var(--login-ctl);
	padding: 0 1rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: transparent;
	color: var(--fg-muted);
	font: inherit;
	cursor: pointer;
}

.access-actions .ghost:hover {
	border-color: var(--accent);
	color: var(--fg);
}

/* Reachable from the Login tab too, not only the Register consent line. */
.card-legal {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin: 1.25rem 0 0;
	color: var(--fg-muted);
	font-size: var(--t-xs);
}

.card-legal a {
	color: inherit;
	text-decoration: none;
}

.card-legal a:hover {
	color: var(--fg);
	text-decoration: underline;
}

.consent {
	margin: 0.85rem 0 0;
	color: var(--fg-muted);
	font-size: var(--t-xs);
	line-height: 1.5;
}

.consent a {
	color: var(--accent);
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}
