/* Фоновая анимация сайта — та же, что в «Чат с менеджером»:
   плавающие градиентные орбы + поднимающиеся частицы.
   Keyframes переиспользуются из app.css (chat-orb-drift, chat-particle-rise) —
   без дублирования. Слой не перехватывает клики (pointer-events:none). */

.site-fx {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 0;
}

/* Вариант «фон всего сайта»: фиксирован за контентом.
   Базовый тёмный цвет уносим на html, а body делаем прозрачным,
   чтобы фиксированный FX-слой (z-index:-1) был виден на всех страницах. */
html {
	background-color: #070b14;
}
body.bg-ink {
	background-color: transparent;
}
.site-fx--page {
	position: fixed;
	z-index: -1; /* строго позади всего контента */
}

.site-fx__orb {
	position: absolute;
	border-radius: 999px;
	filter: blur(46px);
	opacity: 0.28;
	animation: chat-orb-drift 16s ease-in-out infinite;
}
.site-fx--page .site-fx__orb {
	opacity: 0.16;
	filter: blur(64px);
}
.site-fx__orb--1 {
	top: 6%;
	left: -6%;
	width: 22rem;
	height: 22rem;
	background: rgba(214, 173, 96, 0.55);
}
.site-fx__orb--2 {
	top: 40%;
	right: -8%;
	width: 18rem;
	height: 18rem;
	background: rgba(96, 165, 250, 0.4);
	animation-delay: -5s;
}
.site-fx__orb--3 {
	bottom: 8%;
	left: 26%;
	width: 20rem;
	height: 20rem;
	background: rgba(167, 139, 250, 0.32);
	animation-delay: -9s;
}

.site-fx__particles {
	position: absolute;
	inset: 0;
}
.site-fx__particle {
	position: absolute;
	bottom: -0.5rem;
	width: 0.22rem;
	height: 0.22rem;
	border-radius: 999px;
	background: rgba(239, 210, 141, 0.7);
	box-shadow: 0 0 8px rgba(214, 173, 96, 0.55);
	animation: chat-particle-rise 9s linear infinite;
	opacity: 0;
}
.site-fx__particle:nth-child(1) { left: 8%; animation-duration: 9s; animation-delay: 0s; }
.site-fx__particle:nth-child(2) { left: 18%; animation-duration: 12s; animation-delay: -2s; width: 0.16rem; height: 0.16rem; }
.site-fx__particle:nth-child(3) { left: 28%; animation-duration: 10s; animation-delay: -4s; }
.site-fx__particle:nth-child(4) { left: 38%; animation-duration: 13s; animation-delay: -1s; }
.site-fx__particle:nth-child(5) { left: 48%; animation-duration: 9.5s; animation-delay: -6s; width: 0.18rem; height: 0.18rem; }
.site-fx__particle:nth-child(6) { left: 58%; animation-duration: 11s; animation-delay: -3s; }
.site-fx__particle:nth-child(7) { left: 68%; animation-duration: 12.5s; animation-delay: -7s; }
.site-fx__particle:nth-child(8) { left: 78%; animation-duration: 10s; animation-delay: -5s; width: 0.15rem; height: 0.15rem; }
.site-fx__particle:nth-child(9) { left: 88%; animation-duration: 13.5s; animation-delay: -2.5s; }

@media (prefers-reduced-motion: reduce) {
	.site-fx__orb,
	.site-fx__particle {
		animation: none;
	}
	.site-fx__particle {
		opacity: 0.25;
	}
}

/* --- FX внутри модалок (та же анимация, что в чате) ---------------------- */
.site-fx--modal {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	z-index: 0;
}
.site-fx--modal .site-fx__orb {
	filter: blur(40px);
	opacity: 0.4;
}
.site-fx--modal .site-fx__orb--1 { width: 11rem; height: 11rem; }
.site-fx--modal .site-fx__orb--2 { width: 9rem; height: 9rem; }
.site-fx--modal .site-fx__orb--3 { width: 10rem; height: 10rem; }

/* --- Авторизация: единая геометрия, доступность и мобильная адаптация --- */
html.auth-dialog-open,
html.auth-dialog-open body {
	overflow: hidden;
}

.auth-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 100vh;
	min-height: 100dvh;
	padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	overflow-x: hidden;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.72);
	backdrop-filter: blur(6px);
}
.auth-modal-overlay.hidden {
	display: none;
}
.auth-modal-card {
	position: relative;
	width: min(448px, calc(100vw - 32px));
	max-width: 448px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	box-sizing: border-box;
	padding-top: 44px;
	overflow-x: hidden;
	overflow-y: auto;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 18px;
	background: linear-gradient(160deg, rgba(20, 28, 44, 0.96), rgba(11, 17, 30, 0.98));
	box-shadow:
		0 30px 80px rgba(0, 0, 0, 0.55),
		0 0 0 1px rgba(214, 173, 96, 0.14),
		inset 0 1px 0 rgba(255, 255, 255, 0.06);
	animation: auth-modal-in 0.32s cubic-bezier(0.16, 1, 0.3, 1);
	overscroll-behavior: contain;
}
.auth-modal-card > *:not(.site-fx):not(.auth-modal-close) {
	position: relative;
	z-index: 1;
}
.auth-modal-close {
	position: absolute;
	top: 0;
	right: 4px;
	z-index: 3;
	display: inline-grid;
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: #94a3b8;
	font: inherit;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}
.auth-modal-close:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.06);
}
.auth-tabs {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.auth-tab {
	min-width: 0;
	min-height: 50px;
	padding: 0 12px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: transparent;
	color: #94a3b8;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}
.auth-tab.is-active {
	border-bottom-color: #d6ad60;
	color: #ffffff;
}
.auth-modal-section {
	box-sizing: border-box;
	width: 100%;
	padding: 24px;
}
.auth-modal-section.hidden {
	display: none;
}
.auth-section-title {
	margin: 0 0 16px;
	color: #ffffff;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
}
.auth-section-copy,
.auth-switch-copy {
	margin: -6px 0 16px;
	color: #cbd5e1;
	font-size: 14px;
	line-height: 1.55;
}
.auth-switch-copy {
	margin: 16px 0 0;
	text-align: center;
}
.auth-form {
	display: grid;
	width: 100%;
	gap: 14px;
}
.auth-field {
	display: grid;
	min-width: 0;
	gap: 6px;
}
.auth-label {
	display: block;
	min-width: 0;
	color: #94a3b8;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.auth-control,
.auth-primary {
	width: 100%;
	min-width: 0;
	height: 50px;
	min-height: 50px;
	box-sizing: border-box;
	border-radius: 12px;
	font: inherit;
	font-size: 16px;
	line-height: 1.25;
}
.auth-control {
	padding: 0 16px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	outline: none;
	background: #070b14;
	color: #ffffff;
}
.auth-control::placeholder {
	color: #64748b;
	opacity: 1;
}
.auth-control:focus,
.auth-control:focus-visible {
	border-color: rgba(214, 173, 96, 0.68);
	box-shadow: 0 0 0 3px rgba(214, 173, 96, 0.14);
}
.auth-checkbox {
	display: inline-flex;
	min-height: 24px;
	align-items: center;
	gap: 10px;
	color: #cbd5e1;
	font-size: 14px;
	cursor: pointer;
}
.auth-checkbox input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: #d6ad60;
}
.auth-primary {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 16px;
	border: 1px solid #d6ad60;
	background: #d6ad60;
	color: #070b14;
	font-weight: 800;
	cursor: pointer;
	box-shadow: 0 8px 22px rgba(214, 173, 96, 0.28);
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.auth-primary:hover:not(:disabled) {
	transform: translateY(-1px);
	background: #efd28d;
	box-shadow: 0 12px 28px rgba(214, 173, 96, 0.38);
}
.auth-primary:disabled,
.auth-primary.is-loading {
	cursor: wait;
	opacity: 0.68;
}
.auth-tab:focus-visible,
.auth-modal-close:focus-visible,
.auth-primary:focus-visible,
.auth-text-button:focus-visible,
.auth-inline-button:focus-visible {
	outline: 2px solid #d6ad60;
	outline-offset: 3px;
}
.auth-text-button,
.auth-inline-button {
	border: 0;
	background: transparent;
	color: #d6ad60;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.auth-text-button {
	display: block;
	min-height: 44px;
	margin: 8px auto -8px;
	padding: 8px 12px;
	font-size: 14px;
}
.auth-inline-button {
	padding: 4px;
	font-size: inherit;
}
.auth-feedback {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid rgba(248, 113, 113, 0.3);
	border-radius: 10px;
	background: rgba(248, 113, 113, 0.1);
	color: #fee2e2;
	font-size: 14px;
	line-height: 1.45;
	overflow-wrap: anywhere;
}
.auth-feedback--success {
	border-color: rgba(52, 211, 153, 0.3);
	background: rgba(52, 211, 153, 0.1);
	color: #d1fae5;
}
.auth-feedback.hidden {
	display: none;
}
.auth-reset-page {
	display: grid;
	min-height: 100vh;
	min-height: 100dvh;
	box-sizing: border-box;
	place-items: center;
	padding: 32px 16px;
}
.auth-reset-card {
	width: min(448px, calc(100vw - 32px));
	max-width: 448px;
	box-sizing: border-box;
	padding: 24px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 18px;
	background: #101827;
}
.auth-reset-card .auth-section-copy {
	margin-top: -8px;
}

@keyframes auth-modal-in {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (max-width: 480px) {
	.auth-modal-overlay {
		align-items: flex-start;
		padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
	}
	.auth-modal-card {
		width: calc(100vw - 24px);
		max-height: calc(100vh - 24px);
		max-height: calc(100dvh - 24px);
		border-radius: 16px;
	}
	.auth-modal-section,
	.auth-reset-card {
		padding: 18px;
	}
	.auth-form {
		gap: 12px;
	}
	.auth-reset-page {
		padding: 20px 12px;
	}
	.auth-reset-card {
		width: calc(100vw - 24px);
	}
}

@media (max-height: 620px) {
	.auth-modal-overlay {
		align-items: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.auth-modal-card {
		animation: none;
	}
}