@font-face {
	font-family: 'Neuton';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('fonts/neuton-400-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: 'Neuton';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('fonts/neuton-400-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: 'Neuton';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('fonts/neuton-700-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: 'Neuton';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('fonts/neuton-700-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	--bg: #f8fafc;
	--surface: #ffffff;
	--ink: #0f172a;
	--muted: #64748b;
	--border: #e2e8f0;
	--border-strong: #cbd5e1;
	--accent: #0f172a;
	--accent-hover: #334155;
	--accent-ink: #ffffff;
	--accent-soft: #f1f5f9;
	--ring: rgba(15, 23, 42, 0.12);
	--alert-bg: #fef2f2;
	--alert-ink: #991b1b;
	--alert-border: #fecaca;
	--status-bg: #ecfdf5;
	--status-ink: #065f46;
	--status-border: #a7f3d0;
	--shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
	--shadow-md: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
	--radius-sm: 6px;
	--radius-md: 8px;
	--radius-lg: 12px;
}

* {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	background: var(--bg);
	color: var(--ink);
	font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
	"Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.app-header {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
}

.app-header__inner {
	max-width: 64rem;
	margin: 0 auto;
	padding: 0.875rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.app-header__brandgroup {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.app-header__badge {
	padding: 0.1rem 0.45rem;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
	background: var(--accent-soft);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	line-height: 1.4;
}

.app-header__brand {
	font-family: 'Neuton', Georgia, serif;
	font-weight: 400;
	font-size: 1.5rem;
	letter-spacing: -0.01em;
	color: var(--ink);
	text-decoration: none;
	line-height: 1em;
	margin-top: -5px;
}

.app-header__brand:hover {
	color: var(--muted);
}

.app-header__back {
	margin-right: 0.5rem;
}

.app-header__logout {
	margin: 0;
}

.page-card {
	max-width: 32rem;
	margin: 2.5rem auto;
	padding: 2rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
}

h1 {
	margin: 0 0 1.5rem;
	font-size: 1.5rem;
	font-weight: 600;
	letter-spacing: -0.015em;
}

h2 {
	margin: 0 0 0.875rem;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: -0.005em;
}

p {
	margin: 0 0 1rem;
	color: var(--ink);
}

p + p {
	margin-top: -0.25rem;
}

.account-page {
	max-width: 32rem;
	margin: 2.5rem auto;
}

.account-page .page-card {
	margin: 0 0 1.5rem;
}

.formGroup + .formGroup {
	margin-top: 0.875rem;
}

label {
	display: block;
	font-weight: 500;
	font-size: 0.875rem;
	color: var(--ink);
}

input[type="text"],
input[type="email"],
input[type="password"] {
	display: block;
	width: 100%;
	margin-top: 0.375rem;
	padding: 0.55rem 0.75rem;
	font: inherit;
	font-size: 0.9375rem;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	outline: 0;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
	color: var(--muted);
}

input:focus-visible {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--ring);
}

.btn {
	display: inline-block;
	margin-top: 0.25rem;
	padding: 0.55rem 1.1rem;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--accent-ink);
	background: var(--accent);
	border: 1px solid var(--accent);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
	background: var(--accent-hover);
	border-color: var(--accent-hover);
}

.btn:focus-visible {
	outline: 0;
	box-shadow: 0 0 0 3px var(--ring);
}

.btn-secondary {
	display: inline-block;
	margin-top: 0.25rem;
	padding: 0.55rem 1.1rem;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
	background: var(--accent-soft);
	border-color: var(--accent);
	color: var(--ink);
}

.btn-secondary:focus-visible {
	outline: 0;
	box-shadow: 0 0 0 3px var(--ring);
}

a {
	color: var(--ink);
}

a:hover {
	color: var(--muted);
}

.link {
	text-decoration: underline;
	text-underline-offset: 3px;
	font-weight: 500;
}

code {
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
	"Liberation Mono", monospace;
	font-size: 0.875em;
	padding: 0.125rem 0.375rem;
	color: var(--ink);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}

ul {
	padding-left: 1.25rem;
	margin: 0 0 1rem;
}

li + li {
	margin-top: 0.25rem;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

[role="alert"],
[role="status"] {
	padding: 0.75rem 1rem;
	margin: 0 0 1.25rem;
	border-radius: var(--radius-md);
	font-size: 0.9375rem;
	font-weight: 500;
}

[role="alert"] {
	color: var(--alert-ink);
	background: var(--alert-bg);
	border: 1px solid var(--alert-border);
}

[role="status"] {
	color: var(--status-ink);
	background: var(--status-bg);
	border: 1px solid var(--status-border);
}

.form-actions {
	display: flex;
	align-items: center;
	justify-content: end;
	gap: .5rem;
	margin-top: 1rem;
}

.login-form .form-actions {
	flex-direction: column;
	align-items: stretch;
}

.login-form-divider {
	display: flex;
	align-items: center;
	color: var(--text-muted);
	font-size: 0.8125rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0.75rem 0;
}

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

.login-form-divider span {
	margin: 0 0.75rem;
}

.code-boxes {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
	margin-top: 0.375rem;
}

input.code-box {
	width: 3rem;
	height: 3.5rem;
	margin-top: 0;
	text-align: center;
	font-size: 1.5rem;
	font-weight: 600;
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
		"Liberation Mono", monospace;
	padding: 0;
	flex-shrink: 0;
}

.dialog-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.4);
}

.delete-dialog {
	padding: 1.5rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
	max-width: 22rem;
	width: 90vw;
}

.delete-dialog::backdrop {
	background: rgba(15, 23, 42, 0.4);
}

.delete-dialog h3 {
	margin: 0 0 0.5rem;
	font-size: 1rem;
	font-weight: 600;
}

.delete-dialog p {
	font-size: 0.875rem;
	color: var(--muted);
	margin: 0 0 1rem;
}

.delete-dialog .form-actions {
	margin-top: 1rem;
}

.passkey-add {
	display: flex;
	align-items: flex-end;
	gap: 1rem;
	margin: 1rem 0;
}
.passkey-add label {
	width: 100%;
}

.passkey-add .form-actions {
	flex-shrink: 0;
}
.form-hint {
	color: var(--muted);
}

.passkey-list {
	list-style: none;
	margin: 1rem 0;
	padding: 0;
}

.passkey-list li {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .5rem 0;
	border-bottom: 1px solid var(--border);
}

.passkey-list .passkey-remove {
	margin-left: auto;
}

.passkey-list svg {
	width: 1rem;
	height: 1rem;
	color: var(--muted);
}

@media (max-width: 32rem) {
	.app-header__inner {
		padding: 0.75rem 1rem;
	}
	.page-card {
		margin: 1rem;
		padding: 1.5rem 1.25rem;
		border-radius: var(--radius-md);
	}
	.account-page {
		margin: 1rem;
	}
	.account-page .page-card {
		margin: 0 0 1.5rem;
	}
	input.code-box {
		width: 2.5rem;
		height: 3rem;
		font-size: 1.25rem;
	}
}
