@charset "UTF-8";

/*
 * Ilaha PSY — shared components for the cabinet, admin, auth and error pages.
 * Mobile-first. Tokens follow css/style.css (warm light palette, gold CTAs, dark #1f1a28).
 * Components: .btn .card .grid .table .form/.field/.input/.select/.textarea/.checkbox .badge
 * .alert .tabs .empty .toolbar .pagination .stat .list .progress (+ data-confirm via js/app.js).
 */

@font-face {
	font-family: "Involve";
	src: url("../fonts/Involve-VF.woff2") format("woff2");
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}

/* Montserrat subset with the full Azerbaijani alphabet (SIL OFL 1.1, fonts/Montserrat-OFL.txt).
   Same family name and URL as in css/style.css, so the browser downloads it once. */
@font-face {
	font-family: "Montserrat AZ";
	src: url("../fonts/Montserrat-AZ-VF.woff2") format("woff2");
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--c-bg: #fbf7f2;
	--c-surface: #fffdf9;
	--c-surface-2: #f8efe2;
	--c-text: #262329;
	--c-heading: #141117;
	--c-muted: #6b6258;
	--c-line: #e9d7bc;
	--c-line-strong: #d7bd97;
	--c-brand: #b48746;
	--c-brand-dark: #7d5a28;
	--c-brand-ink: #1f1a28;
	--c-dark: #1f1a28;
	--c-focus: #8f6a35;
	--c-ok: #2e6b33;
	--c-ok-bg: #e3f2e1;
	--c-warn: #7a5200;
	--c-warn-bg: #fdf0d2;
	--c-danger: #a1261f;
	--c-danger-bg: #fbe6e4;
	--c-info: #1f5673;
	--c-info-bg: #e3f0f7;
	--c-muted-bg: #f0e9df;
	--radius-lg: 20px;
	--radius: 14px;
	--radius-sm: 10px;
	--shadow: 0 10px 28px rgba(28, 20, 10, 0.08);
	--shadow-sm: 0 2px 8px rgba(28, 20, 10, 0.06);
	--font: "Involve", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-az: "Montserrat AZ", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--header-h: 60px;
	--tabbar-h: 64px;
	--nav-w: 248px;
	--tap: 44px;
}

/* Involve has no Ə ə İ Ş ş: Azerbaijani text (cabinet, admin, az auth pages) uses Montserrat AZ,
   so letters are never mixed inside a word. */
:lang(az) {
	--font: var(--font-az);
}

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

body.app,
body.error-page,
body.print-page {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.55;
	color: var(--c-text);
	background: var(--c-bg);
	-webkit-text-size-adjust: 100%;
	text-rendering: optimizeLegibility;
}

.app h1,
.app h2,
.app h3,
.app h4 {
	color: var(--c-heading);
	line-height: 1.25;
	margin: 0 0 0.6em;
}

.app a {
	color: var(--c-brand-dark);
}

.app a:hover {
	color: var(--c-dark);
}

.app img,
.app svg {
	max-width: 100%;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--c-focus);
	outline-offset: 2px;
}

.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: 0.75rem;
	top: -3rem;
	z-index: 100;
	padding: 0.6rem 1rem;
	background: var(--c-dark);
	color: #fff !important;
	border-radius: var(--radius-sm);
	text-decoration: none;
}

.skip-link:focus {
	top: 0.75rem;
}

.icon {
	width: 20px;
	height: 20px;
	flex: none;
	vertical-align: middle;
}

.muted {
	color: var(--c-muted);
}

.lead {
	font-size: 1.05rem;
	color: var(--c-muted);
	margin: 0 0 1.25rem;
}

.money,
.nowrap {
	white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	min-height: var(--tap);
	padding: 0.6rem 1.15rem;
	border: 1px solid var(--c-line-strong);
	border-radius: 999px;
	background: var(--c-surface);
	color: var(--c-heading);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.btn:hover {
	background: var(--c-surface-2);
	color: var(--c-heading);
}

.btn:active {
	transform: translateY(1px);
}

.btn[disabled],
.btn.is-disabled {
	opacity: 0.55;
	pointer-events: none;
}

/* Gold CTA: dark ink on gold keeps contrast above 4.5:1. */
.btn--primary {
	background: linear-gradient(145deg, #d1a866, #b48746);
	border-color: #a57a3c;
	color: var(--c-brand-ink);
	box-shadow: 0 6px 16px rgba(143, 106, 53, 0.25);
}

.btn--primary:hover {
	background: linear-gradient(145deg, #c79c58, #a57a3c);
	color: var(--c-brand-ink);
}

.btn--ghost {
	background: transparent;
	border-color: transparent;
	color: var(--c-brand-dark);
}

.btn--ghost:hover {
	background: var(--c-muted-bg);
}

.btn--danger {
	background: var(--c-danger);
	border-color: var(--c-danger);
	color: #fff;
}

.btn--danger:hover {
	background: #861e18;
	color: #fff;
}

.btn--sm {
	min-height: 36px;
	padding: 0.35rem 0.8rem;
	font-size: 0.9rem;
}

.btn--block {
	display: flex;
	width: 100%;
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--tap);
	height: var(--tap);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--c-heading);
	cursor: pointer;
}

.icon-btn:hover {
	background: var(--c-muted-bg);
}

/* ---------- Cards, grid, lists, stats ---------- */

.card {
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	padding: 1rem 1.1rem;
	box-shadow: var(--shadow-sm);
	margin-bottom: 1rem;
}

.card--soft {
	background: var(--c-surface-2);
	box-shadow: none;
}

.card__title {
	margin: 0 0 0.5rem;
	font-size: 1.1rem;
}

.card__text {
	margin: 0;
}

.card__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.9rem;
}

.grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

.grid > .card {
	margin-bottom: 0;
}

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

.list > li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--c-line);
}

.list > li:last-child {
	border-bottom: 0;
}

.stat {
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	padding: 1rem;
}

.stat__label {
	margin: 0;
	font-size: 0.85rem;
	color: var(--c-muted);
}

.stat__value {
	margin: 0.2rem 0 0;
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--c-heading);
	line-height: 1.2;
}

.stat__hint {
	margin: 0.25rem 0 0;
	font-size: 0.85rem;
	color: var(--c-muted);
}

/* ---------- Badges ---------- */

.badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.15rem 0.6rem;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1.5;
	white-space: nowrap;
	background: var(--c-muted-bg);
	color: #5c5347;
}

.badge--ok {
	background: var(--c-ok-bg);
	color: var(--c-ok);
}

.badge--warn {
	background: var(--c-warn-bg);
	color: var(--c-warn);
}

.badge--danger {
	background: var(--c-danger-bg);
	color: var(--c-danger);
}

.badge--info {
	background: var(--c-info-bg);
	color: var(--c-info);
}

.badge--muted {
	background: var(--c-muted-bg);
	color: #5c5347;
}

/* ---------- Alerts / flash ---------- */

.flashes {
	display: grid;
	gap: 0.6rem;
	margin-bottom: 1rem;
}

.alert {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	padding: 0.75rem 0.9rem;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	background: var(--c-info-bg);
	color: var(--c-info);
	margin-bottom: 1rem;
	transition: opacity 0.3s ease;
}

.flashes .alert {
	margin-bottom: 0;
}

.alert.is-hiding {
	opacity: 0;
}

.alert__icon {
	margin-top: 0.1rem;
}

.alert__text {
	margin: 0;
	flex: 1;
}

.alert__close {
	flex: none;
	display: inline-flex;
	padding: 0.15rem;
	margin: -0.1rem -0.2rem 0 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	border-radius: 6px;
}

.alert--success {
	background: var(--c-ok-bg);
	border-color: #bcdcb8;
	color: var(--c-ok);
}

.alert--error {
	background: var(--c-danger-bg);
	border-color: #eebcbc;
	color: var(--c-danger);
}

.alert--info {
	background: var(--c-info-bg);
	border-color: #bcd7e6;
	color: var(--c-info);
}

/* ---------- Forms ---------- */

.form {
	display: grid;
	gap: 1rem;
}

.form__row {
	display: grid;
	gap: 1rem;
}

/* .field is a grid: without this a hint under one field stretches the inputs next to it. */
.form__row > .field {
	align-content: start;
}

.form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
}

.field {
	display: grid;
	gap: 0.35rem;
	min-width: 0;
}

.field__label {
	font-weight: 600;
	font-size: 0.93rem;
	color: var(--c-heading);
}

.field__hint {
	margin: 0;
	font-size: 0.85rem;
	color: var(--c-muted);
}

.field__error {
	margin: 0;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--c-danger);
}

.input,
.select,
.textarea {
	display: block;
	width: 100%;
	min-height: var(--tap);
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--c-line-strong);
	border-radius: var(--radius-sm);
	background: #fff;
	color: var(--c-text);
	font: inherit;
	font-size: 1rem; /* >= 16px: no zoom on iOS */
	line-height: 1.4;
}

.textarea {
	min-height: 7rem;
	resize: vertical;
}

.select {
	appearance: none;
	padding-right: 2.2rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d5a28' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.7rem center;
	background-size: 18px;
}

.input:focus,
.select:focus,
.textarea:focus {
	border-color: var(--c-brand);
	outline: 3px solid rgba(180, 135, 70, 0.25);
	outline-offset: 0;
}

.field--invalid .input,
.field--invalid .select,
.field--invalid .textarea {
	border-color: var(--c-danger);
}

.input--code {
	font-size: 1.5rem;
	letter-spacing: 0.3em;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	min-height: var(--tap);
	padding: 0.4rem 0;
	cursor: pointer;
}

.checkbox input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 0.15rem 0 0;
	accent-color: var(--c-brand-dark);
}

/* ---------- Tables (cards on phones) ---------- */

.table-wrap {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.table {
	width: 100%;
	border-collapse: collapse;
	background: var(--c-surface);
	font-size: 0.95rem;
}

.table th,
.table td {
	padding: 0.65rem 0.75rem;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--c-line);
}

.table th {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--c-muted);
	background: var(--c-surface-2);
}

.table tbody tr:hover {
	background: #fffaf2;
}

.table .num {
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* Put data-label="Column" on each <td>: below 640px every row becomes a card. */
@media (max-width: 639.98px) {
	.table--stack thead {
		display: none;
	}

	.table--stack,
	.table--stack tbody,
	.table--stack tr,
	.table--stack td {
		display: block;
		width: 100%;
	}

	.table--stack {
		background: transparent;
	}

	.table--stack tr {
		margin-bottom: 0.75rem;
		padding: 0.5rem 0.8rem;
		background: var(--c-surface);
		border: 1px solid var(--c-line);
		border-radius: var(--radius);
	}

	.table--stack td {
		display: flex;
		justify-content: space-between;
		gap: 1rem;
		padding: 0.45rem 0;
		border-bottom: 1px dashed var(--c-line);
		text-align: right;
	}

	.table--stack td:last-child {
		border-bottom: 0;
	}

	.table--stack td::before {
		content: attr(data-label);
		flex: none;
		max-width: 45%;
		font-weight: 600;
		color: var(--c-muted);
		text-align: left;
	}

	.table--stack .num {
		text-align: right;
	}
}

/* ---------- Tabs, toolbar, pagination ---------- */

.tabs {
	display: flex;
	gap: 0.25rem;
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	border-bottom: 1px solid var(--c-line);
	scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
	display: none;
}

.tabs a,
.tabs button {
	display: inline-flex;
	align-items: center;
	min-height: var(--tap);
	padding: 0.5rem 0.9rem;
	border: 0;
	border-bottom: 3px solid transparent;
	background: none;
	color: var(--c-muted);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.tabs .is-active,
.tabs [aria-current="page"],
.tabs [aria-selected="true"] {
	color: var(--c-heading);
	border-bottom-color: var(--c-brand);
}

.toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.toolbar--center {
	justify-content: center;
}

.toolbar--between {
	justify-content: space-between;
}

.toolbar .input,
.toolbar .select {
	width: auto;
	min-width: 0;
	flex: 1 1 12rem;
}

.pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.3rem;
	margin: 1.25rem 0;
}

.pagination__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--tap);
	height: var(--tap);
	padding: 0 0.6rem;
	border: 1px solid var(--c-line);
	border-radius: var(--radius-sm);
	background: var(--c-surface);
	color: var(--c-heading);
	text-decoration: none;
	font-weight: 600;
}

.pagination__link.is-current {
	background: var(--c-dark);
	border-color: var(--c-dark);
	color: #fff;
}

.pagination__gap {
	align-self: center;
	padding: 0 0.3rem;
	color: var(--c-muted);
}

/* ---------- Empty state, progress, steps ---------- */

.empty {
	display: grid;
	justify-items: center;
	gap: 0.5rem;
	padding: 2.5rem 1rem;
	text-align: center;
	color: var(--c-muted);
	background: var(--c-surface);
	border: 1px dashed var(--c-line-strong);
	border-radius: var(--radius);
	margin-bottom: 1rem;
}

.empty p {
	margin: 0;
	max-width: 36rem;
}

.empty__icon {
	width: 40px;
	height: 40px;
	color: var(--c-brand);
}

.progress {
	width: 100%;
	height: 8px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--c-muted-bg);
}

.progress__bar {
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #d1a866, #b48746);
}

.steps {
	margin: 0 0 1.25rem;
	padding-left: 1.3rem;
	display: grid;
	gap: 0.6rem;
}

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	margin: 0 0 0.5rem;
	padding: 0;
	list-style: none;
	font-size: 0.88rem;
	color: var(--c-muted);
}

.breadcrumbs li + li::before {
	content: "/";
	margin-right: 0.3rem;
	color: var(--c-line-strong);
}

/* ---------- App shell (cabinet + admin) ---------- */

.app-header {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	height: var(--header-h);
	padding: 0 0.5rem 0 0.25rem;
	background: rgba(255, 251, 245, 0.95);
	border-bottom: 1px solid var(--c-line);
	backdrop-filter: blur(10px);
}

.app-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: var(--tap);
	color: var(--c-heading) !important;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.app-brand img {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid var(--c-line);
}

.app-header__right {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin-left: auto;
}

.app-user {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	max-width: 14rem;
	color: var(--c-muted);
	font-size: 0.92rem;
}

.app-user__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.app-user--link {
	min-height: var(--tap);
	padding: 0 0.35rem;
	border-radius: var(--radius-sm);
	text-decoration: none;
}

.app-user--link:hover,
.app-user--link[aria-current="page"] {
	color: var(--c-heading);
	background: var(--c-surface-2);
}

.app-user--link:focus-visible {
	outline: 2px solid var(--c-focus);
	outline-offset: 2px;
}

.app-logout,
.locale-switch {
	margin: 0;
}

.app-shell {
	display: block;
}

.app-main {
	min-width: 0;
	padding: 1rem 1rem 2rem;
	max-width: 1200px;
}

.page-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.page-head__title {
	margin: 0;
	font-size: clamp(1.35rem, 4vw, 1.8rem);
}

/* Side navigation: off-canvas drawer on phones, static column on large screens. */
.app-nav {
	position: fixed;
	z-index: 40;
	top: 0;
	bottom: 0;
	left: 0;
	width: min(84vw, 300px);
	padding: 1rem 0.6rem calc(1rem + env(safe-area-inset-bottom));
	overflow-y: auto;
	background: var(--c-surface);
	border-right: 1px solid var(--c-line);
	box-shadow: var(--shadow);
	transform: translateX(-105%);
	transition: transform 0.2s ease;
	visibility: hidden;
}

.nav-open .app-nav {
	transform: none;
	visibility: visible;
}

.app-backdrop {
	position: fixed;
	inset: 0;
	z-index: 35;
	background: rgba(31, 26, 40, 0.4);
}

.app-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 2px;
}

.app-nav__link {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	min-height: var(--tap);
	padding: 0.5rem 0.75rem;
	border-radius: var(--radius-sm);
	color: var(--c-text) !important;
	text-decoration: none;
	font-weight: 600;
}

.app-nav__link:hover {
	background: var(--c-muted-bg);
}

.app-nav__link.is-active {
	background: var(--c-dark);
	color: #fff !important;
}

.app-nav__heading {
	margin: 1rem 0.75rem 0.35rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--c-muted);
}

.app-nav__group:first-child .app-nav__heading {
	margin-top: 0;
}

.app-nav__collapse {
	display: none;
}

.hide-sm {
	display: none !important;
}

@media (min-width: 640px) {
	.hide-sm {
		display: inline-flex !important;
	}

	.grid--2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.grid--3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.grid--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.form__row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.app-main {
		padding: 1.5rem 1.5rem 2.5rem;
	}
}

@media (min-width: 1024px) {
	.grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.grid--4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.app-header {
		padding: 0 1rem;
	}

	.app-header__toggle {
		display: none;
	}

	.app-shell {
		display: grid;
		grid-template-columns: var(--nav-w) minmax(0, 1fr);
		min-height: calc(100vh - var(--header-h));
	}

	.app-nav {
		position: sticky;
		top: var(--header-h);
		height: calc(100vh - var(--header-h));
		width: auto;
		transform: none;
		visibility: visible;
		box-shadow: none;
		transition: none;
	}

	.app-backdrop {
		display: none;
	}

	.app-main {
		padding: 2rem 2.25rem 3rem;
	}
}

/* ---------- Auth pages (inside the public layout) ---------- */

.auth {
	display: flex;
	justify-content: center;
	padding: clamp(1.5rem, 5vw, 3.5rem) 1rem;
	min-height: 60vh;
}

.auth-card {
	width: min(460px, 100%);
	padding: clamp(1.4rem, 4vw, 2.4rem);
	background: linear-gradient(180deg, #fffdf9, #f8efe2);
	border: 1px solid var(--c-line-strong);
	border-radius: var(--radius-lg);
	box-shadow: 0 20px 40px rgba(28, 20, 10, 0.14);
	font-family: var(--font);
	color: var(--c-text);
}

.auth-card--wide {
	width: min(620px, 100%);
}

.auth-card__logo {
	display: block;
	width: 72px;
	height: 72px;
	margin: 0 auto 0.6rem;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #d7e6ee;
	object-fit: contain;
}

.auth-card__title {
	margin: 0 0 0.4rem;
	text-align: center;
	font-size: clamp(1.35rem, 3vw, 1.75rem);
	line-height: 1.25;
	color: var(--c-heading);
}

.auth-card__intro {
	margin: 0 0 1.1rem;
	text-align: center;
	color: #5c5347;
}

.auth-card .form {
	margin-top: 0.5rem;
}

.auth-card__links {
	margin: 1rem 0 0;
	text-align: center;
}

.auth-card__links a,
.auth-card__hint a,
.auth-card .checkbox a {
	color: var(--c-brand-dark);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.auth-card__hint {
	margin: 0.9rem 0 0;
	font-size: 0.92rem;
	color: #5c5347;
	text-align: center;
}

.auth-card__footer {
	display: flex;
	justify-content: center;
	margin-top: 1rem;
}

.totp-setup {
	display: grid;
	gap: 0.3rem;
	margin: 0.6rem 0 0;
}

.totp-setup dt {
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--c-muted);
}

.totp-setup dd {
	margin: 0 0 0.5rem;
}

.totp-setup code {
	display: inline-block;
	padding: 0.3rem 0.5rem;
	border-radius: 8px;
	background: #fff;
	border: 1px solid var(--c-line);
	font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
	word-break: break-all;
}

.totp-setup__secret {
	font-size: 1.1rem;
	letter-spacing: 0.08em;
}

.totp-setup__uri {
	display: block;
	font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
	font-size: 0.8rem;
	word-break: break-all;
	color: var(--c-brand-dark);
}

/* QR code of the otpauth:// link (inline SVG, black on white with its own quiet zone). */
.totp-qr {
	margin: 0.6rem 0;
	width: min(100%, 220px);
	border-radius: 8px;
	border: 1px solid var(--c-line);
	overflow: hidden;
	line-height: 0;
}

.totp-qr svg {
	display: block;
	width: 100%;
	height: auto;
}

/* ---------- Error page ---------- */

.error-page {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 1rem;
	background:
		radial-gradient(circle at 0% 0%, #f8efe2 0%, transparent 40%),
		radial-gradient(circle at 100% 100%, #f6ecde 0%, transparent 42%),
		var(--c-bg);
}

.error-card {
	width: min(520px, 100%);
	padding: clamp(1.5rem, 5vw, 2.5rem);
	text-align: center;
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
}

.error-card__brand img {
	width: 48px;
	height: 48px;
	border-radius: 50%;
}

.error-card__code {
	margin: 0.75rem 0 0.25rem;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--c-brand-dark);
}

.error-card__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.4rem, 4vw, 1.9rem);
	color: var(--c-heading);
}

.error-card__text {
	margin: 0 0 1.25rem;
	color: #5c5347;
}

.error-card__debug {
	margin: 1.5rem 0 0;
	padding: 1rem;
	max-height: 50vh;
	overflow: auto;
	text-align: left;
	font-size: 0.8rem;
	white-space: pre-wrap;
	word-break: break-word;
	background: #1f1a28;
	color: #f6efe8;
	border-radius: var(--radius-sm);
}

/* ---------- Print layout ---------- */

.print-toolbar {
	display: flex;
	justify-content: center;
	padding: 1rem;
}

.print-sheet {
	width: min(210mm, 100%);
	margin: 0 auto 2rem;
	padding: 18mm 16mm;
	background: #fff;
	border: 1px solid var(--c-line);
	box-shadow: var(--shadow);
}

.print-sheet__head {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	padding-bottom: 1rem;
	margin-bottom: 1.5rem;
	border-bottom: 2px solid var(--c-brand);
}

@media print {
	@page {
		size: A4;
		margin: 12mm;
	}

	.no-print,
	.app-header,
	.app-nav,
	.tabbar,
	.flashes {
		display: none !important;
	}

	body.print-page,
	body.app {
		background: #fff;
	}

	.print-sheet {
		width: auto;
		margin: 0;
		padding: 0;
		border: 0;
		box-shadow: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
