/* Страницы авторизации — MD3 + Magic UI */

.auth-page {
	--auth-accent: var(--main-bg-color, #ed1c24);
	--auth-accent-bg: #ffd9d9;
	--auth-on-surface: #1a1c1e;
	--auth-on-surface-variant: #5c5f66;
	--auth-outline: #e4e0e2;
	--auth-surface: #ffffff;
	--auth-page-bg: var(--bs-body-bg, #f2ecee);
	--auth-magic-x: 50%;
	--auth-magic-y: 50%;
	color: var(--auth-on-surface);
	padding: 0.25rem 0 1.5rem;
}

.auth-page__panel {
	position: relative;
	max-width: 26rem;
	margin: 0 auto;
	padding: 1.75rem 1.5rem 1.85rem;
	background:
		radial-gradient(120% 80% at 50% -15%, rgba(255, 217, 217, 0.55) 0%, transparent 55%),
		var(--auth-surface);
	border: 1px solid rgba(237, 28, 36, 0.1);
	border-radius: 24px;
	box-shadow:
		0 1px 2px rgba(26, 28, 30, 0.04),
		0 12px 32px rgba(237, 28, 36, 0.07);
	overflow: hidden;
}

.auth-page__panel::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(circle at 14% 18%, rgba(237, 28, 36, 0.08), transparent 30%),
		radial-gradient(circle at 88% 14%, rgba(255, 143, 163, 0.14), transparent 28%);
}

.auth-page__panel::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	background: radial-gradient(
		480px circle at var(--auth-magic-x) var(--auth-magic-y),
		rgba(237, 28, 36, 0.1),
		transparent 42%
	);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.auth-page__panel:hover::after {
	opacity: 1;
}

.auth-page__inner {
	position: relative;
	z-index: 1;
}

.auth-page__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.1rem;
	height: 3.1rem;
	margin: 0 auto 1rem;
	border-radius: 16px;
	background: var(--auth-accent);
	color: #fff;
	box-shadow: 0 8px 20px rgba(237, 28, 36, 0.28);
}

.auth-page__icon-svg {
	display: block;
	width: 1.4rem;
	height: 1.4rem;
}

.auth-page__title {
	font-size: clamp(1.25rem, 2.2vw, 1.5rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0 0 0.4rem;
	text-align: center;
	color: var(--auth-on-surface);
}

.auth-page__lead {
	margin: 0 auto 1.25rem;
	max-width: 22rem;
	font-size: 0.9rem;
	line-height: 1.5;
	text-align: center;
	color: var(--auth-on-surface-variant);
}

.auth-page__alert {
	margin: 0 0 1rem;
	padding: 0.75rem 0.9rem;
	border-radius: 12px;
	font-size: 0.875rem;
	line-height: 1.45;
}

.auth-page__alert--error,
.auth-page .errortext {
	background: #fff0f0;
	color: #b01018;
	border: 1px solid rgba(237, 28, 36, 0.18);
}

.auth-page__alert--ok,
.auth-page .notetext {
	background: #f0faf2;
	color: #1b6b35;
	border: 1px solid rgba(27, 107, 53, 0.18);
}

.auth-page .errortext,
.auth-page .notetext,
.auth-page font.errortext,
.auth-page font.notetext {
	display: block;
	margin: 0 0 1rem;
	padding: 0.75rem 0.9rem;
	border-radius: 12px;
	font-size: 0.875rem;
	line-height: 1.45;
	font-weight: 500;
}

.auth-page .starrequired {
	color: var(--auth-accent);
	margin-left: 0.15rem;
}

.auth-page__field {
	margin: 0 0 0.9rem;
}

.auth-page__label {
	display: block;
	font-size: 0.8125rem;
	font-weight: 600;
	margin-bottom: 0.4rem;
	color: var(--auth-on-surface);
}

.auth-page__input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	min-height: 2.75rem;
	padding: 0.65rem 1rem;
	border: 1px solid var(--auth-outline);
	border-radius: 14px;
	background: var(--auth-page-bg);
	color: var(--auth-on-surface);
	font-size: 1rem;
	line-height: 1.4;
	outline: none;
	transition:
		box-shadow 0.2s ease,
		border-color 0.2s ease,
		background 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.auth-page__input:focus {
	background: #fff;
	border-color: rgba(237, 28, 36, 0.4);
	box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.12);
}

.auth-page__check {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0 0 1.1rem;
	font-size: 0.875rem;
	color: var(--auth-on-surface-variant);
	cursor: pointer;
	user-select: none;
}

.auth-page__check input {
	width: 1.1rem;
	height: 1.1rem;
	accent-color: var(--auth-accent);
	cursor: pointer;
}

.auth-page__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	width: 100%;
	min-height: 2.85rem;
	margin: 0 0 1rem;
	padding: 0.65rem 1.25rem;
	border: 0;
	border-radius: 9999px;
	background: var(--auth-accent);
	color: #fff !important;
	font-size: 0.975rem;
	font-weight: 600;
	cursor: pointer;
	transition:
		transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
		filter 0.2s ease;
}

.auth-page__submit:hover {
	filter: brightness(0.96);
	transform: translateY(-1px);
}

a.auth-page__submit:link,
a.auth-page__submit:visited,
a.auth-page__submit:hover,
a.auth-page__submit:active,
a.auth-page__submit:focus {
	color: #fff !important;
	text-decoration: none;
}

.auth-page__submit span,
.auth-page__submit .bi {
	color: inherit;
}

.auth-page__links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem 1rem;
	margin: 0;
	font-size: 0.875rem;
}

.auth-page__links a,
.auth-page__links a:link,
.auth-page__links a:visited {
	color: var(--auth-accent);
	font-weight: 600;
	text-decoration: none;
}

.auth-page__links a:hover {
	text-decoration: underline;
	color: var(--auth-accent);
}

.auth-page__hint {
	margin: 0.85rem 0 0;
	font-size: 0.78rem;
	line-height: 1.45;
	color: var(--auth-on-surface-variant);
	text-align: center;
}

.auth-page__captcha {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem;
	margin-top: 0.45rem;
}

.auth-page__captcha img {
	border-radius: 10px;
	border: 1px solid var(--auth-outline);
}

.auth-page__secure {
	display: inline-flex;
	align-items: center;
	margin-left: 0.35rem;
	vertical-align: middle;
}

@media (min-width: 768px) {
	.auth-page__panel {
		padding: 2rem 2rem 2.1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.auth-page__submit {
		transition: none;
	}

	.auth-page__submit:hover {
		transform: none;
	}

	.auth-page__panel::after {
		display: none;
	}
}
