/* ==========================================================================
   Экран входа
   ========================================================================== */
.auth {
	position: fixed;
	inset: 0;
	z-index: 50;
	overflow: auto;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
	background: #000;
	color: #f4f1ea;
	--accent-text: var(--accent);
	opacity: 0;
	transition: opacity 0.6s var(--e-out);
}
.auth.is-in { opacity: 1; }
.auth.is-leaving .auth-stage { transform: scale(0.96); opacity: 0; filter: blur(8px); transition: all 0.6s var(--e-io); }
.auth-aurora { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0.95; }
.auth-vignette { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 40%, transparent 30%, rgba(0, 0, 0, 0.75) 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.8)); }
.auth-orbit { position: fixed; z-index: 0; pointer-events: none; right: -18vmax; top: 50%; width: 80vmax; height: 80vmax; translate: 0 -50%; }
.auth-orbit i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.05); animation: orbit 60s linear infinite; }
.auth-orbit i:nth-child(2) { inset: 12%; animation-duration: 44s; animation-direction: reverse; }
.auth-orbit i:nth-child(3) { inset: 24%; animation-duration: 32s; }
.auth-orbit i::before { content: ''; position: absolute; top: 50%; left: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px 2px var(--accent); }
.auth-orbit i:nth-child(2)::before { background: var(--accent-2); box-shadow: 0 0 14px 2px var(--accent-2); top: 10%; left: 20%; }
.auth-orbit i:nth-child(3)::before { background: var(--accent-3); box-shadow: 0 0 14px 2px var(--accent-3); top: 85%; left: 70%; }
@keyframes orbit { to { transform: rotate(360deg); } }

.auth-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 26px clamp(20px, 4vw, 56px); }
.auth-brand { display: flex; align-items: center; gap: 12px; color: #f4f1ea; font: 600 17px var(--f-display); letter-spacing: -0.03em; text-decoration: none !important; }
.auth-brand b { font-weight: 300; margin-left: 5px; opacity: 0.7; }
.auth-status { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 14px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: #aaa7b2; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); backdrop-filter: blur(10px); }
.auth-status i { width: 7px; height: 7px; border-radius: 50%; background: #5ceb8a; box-shadow: 0 0 0 0 rgba(92, 235, 138, 0.6); animation: pulse 2s infinite; }
.auth-status.is-off i { background: #ff5a6e; animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(92, 235, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(92, 235, 138, 0); } }

.auth-stage {
	position: relative;
	z-index: 1;
	flex: 1;
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(360px, 440px);
	gap: clamp(32px, 6vw, 110px);
	align-items: center;
	max-width: 1320px;
	width: 100%;
	margin: 0 auto;
	padding: 20px clamp(20px, 4vw, 56px) 40px;
}

.auth-eyebrow { display: inline-flex; align-items: center; gap: 10px; height: 32px; padding: 0 14px 0 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; color: #d9d6de; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); animation: rise 0.9s var(--e-out) both; }
.auth-eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.auth-h1 { margin: 26px 0 22px; font: 600 clamp(44px, 6.4vw, 96px) / 0.98 var(--f-display); letter-spacing: -0.055em; }
.auth-word { display: inline-block; overflow: hidden; padding: 0.04em 0.1em 0.1em 0; margin-bottom: -0.1em; vertical-align: top; }
.auth-word > span { display: inline-block; animation: word-up 1.1s var(--e-out) both; animation-delay: calc(0.15s + var(--i) * 0.09s); }
.auth-h1 br + .auth-word > span { animation-delay: calc(0.35s + var(--i) * 0.09s); }
.auth-word.grad > span { background: linear-gradient(95deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: word-up 1.1s var(--e-out) 0.55s both, sheen 6s ease-in-out 1.6s infinite; font-style: italic; padding-right: 0.08em; }
@keyframes word-up { from { transform: translateY(105%) rotate(4deg); opacity: 0; } }
@keyframes sheen { 50% { background-position: 100% 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.auth-lead { max-width: 520px; margin: 0; font-size: clamp(15px, 1.25vw, 17.5px); line-height: 1.6; color: #aaa7b2; animation: rise 1s var(--e-out) 0.7s both; }
.auth-feats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }
.auth-feat { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.07); backdrop-filter: blur(12px); animation: rise 1s var(--e-out) both; }
.auth-feat:nth-child(1) { animation-delay: 0.85s; }
.auth-feat:nth-child(2) { animation-delay: 0.95s; }
.auth-feat:nth-child(3) { animation-delay: 1.05s; }
.auth-feat-ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, transparent); }
.auth-feat b { display: block; font-size: 13.5px; font-weight: 650; }
.auth-feat span { font-size: 12px; color: #8a8793; }

.auth-card-wrap { position: relative; perspective: 1400px; animation: card-in 1.1s var(--e-spring) 0.25s both; }
@keyframes card-in { from { transform: translateY(40px) scale(0.95); opacity: 0; } }
.auth-perch { position: absolute; left: 50%; top: 0; translate: -50% -78%; z-index: 3; pointer-events: auto; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.6)); }
.auth-nori { animation: nori-arrive 1.2s var(--e-spring) 0.9s both; }
@keyframes nori-arrive { from { transform: translateY(40px) scale(0.3); opacity: 0; } }
.auth-card {
	position: relative;
	padding: 56px 32px 28px;
	border-radius: 34px;
	background: linear-gradient(180deg, rgba(20, 20, 24, 0.82), rgba(10, 10, 12, 0.9)) padding-box, linear-gradient(160deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04) 35%, rgba(255, 255, 255, 0.02) 60%, color-mix(in oklab, var(--accent) 45%, transparent)) border-box;
	border: 1px solid transparent;
	backdrop-filter: blur(28px) saturate(150%);
	-webkit-backdrop-filter: blur(28px) saturate(150%);
	box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.95), 0 0 80px -40px var(--accent);
	transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
	transition: transform 0.5s var(--e-out);
	transform-style: preserve-3d;
	overflow: hidden;
	color-scheme: dark;
	--bg-well: rgba(0, 0, 0, 0.5);
	--bg-raise: rgba(0, 0, 0, 0.6);
	--line: rgba(255, 255, 255, 0.09);
	--line-strong: rgba(255, 255, 255, 0.16);
	--text: #f4f1ea;
	--text-2: #aaa7b2;
	--text-3: #6f6c79;
	--bg-active: rgba(255, 255, 255, 0.085);
	--bg-hover: rgba(255, 255, 255, 0.05);
}
.auth-card-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 0%), color-mix(in oklab, var(--accent) 12%, transparent), transparent 60%); transition: background 0.2s; }
.auth-card.is-morph .auth-head, .auth-card.is-morph .auth-submit { animation: morph 0.5s var(--e-out); }
@keyframes morph { from { opacity: 0.2; transform: translateY(6px); filter: blur(3px); } }
.auth-segs { display: flex; width: 100%; background: rgba(0, 0, 0, 0.4); }
.auth-segs .seg { flex: 1; justify-content: center; height: 38px; font-size: 13.5px; }
.auth-segs.is-single { display: none; }
.auth-head { margin: 26px 0 22px; }
.auth-title { margin: 0; font: 600 26px/1.15 var(--f-display); letter-spacing: -0.04em; }
.auth-sub { margin: 8px 0 0; color: #8f8c98; font-size: 14px; }
.auth-fields { display: flex; flex-direction: column; gap: 16px; }
.auth-field[hidden] { display: none; }
.auth-field { transition: opacity 0.3s var(--e-out), transform 0.35s var(--e-spring); }
.auth-field:not(.is-open)[data-field='displayName'], .auth-field:not(.is-open)[data-field='inviteCode'] { opacity: 0; transform: translateY(-8px) scale(0.98); }
.auth-control { position: relative; display: flex; align-items: center; }
.auth-control .input { height: 52px; border-radius: 16px; font-size: 15px; padding-right: 16px; }
.auth-control .input[name='password'] { padding-right: 52px; letter-spacing: 0.04em; }
.auth-eye { position: absolute; right: 8px; }
.auth-suffix { position: absolute; right: 8px; height: 36px; padding: 0 12px; border-radius: 11px; display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; color: #aaa7b2; background: rgba(255, 255, 255, 0.06); opacity: 0; transform: translateX(8px); pointer-events: none; transition: opacity 0.25s, transform 0.35s var(--e-spring), background-color 0.2s; }
.auth-suffix.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.auth-suffix.is-picker:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.auth-suffix:not(.is-picker) { cursor: default; }
.auth-card.is-register .auth-control:has(.auth-suffix.is-shown) .input { padding-right: 140px; }
.auth-control:has(.auth-suffix.is-shown) .input { padding-right: 140px; }
.auth-meter { display: flex; align-items: center; gap: 5px; margin-top: 2px; height: 16px; }
.auth-meter i { flex: 1; max-width: 46px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); transition: background-color 0.3s, box-shadow 0.3s; }
.auth-meter-label { margin-left: 8px; font-size: 11.5px; font-weight: 600; color: #8f8c98; }
.auth-meter[data-level='0'] i:nth-child(-n + 1), .auth-meter[data-level='1'] i:nth-child(-n + 1) { background: #ff5a6e; }
.auth-meter[data-level='2'] i:nth-child(-n + 2) { background: #ffc93d; }
.auth-meter[data-level='3'] i:nth-child(-n + 3) { background: var(--accent-2); }
.auth-meter[data-level='4'] i { background: var(--accent); box-shadow: 0 0 10px -1px var(--accent); }
.auth-error { display: flex; gap: 9px; align-items: center; margin-top: 16px; padding: 11px 14px; border-radius: 14px; font-size: 13.5px; font-weight: 500; color: #ff8b99; background: rgba(255, 90, 110, 0.1); border: 1px solid rgba(255, 90, 110, 0.22); }
.auth-error.is-shake { animation: shake 0.45s var(--e-out); }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.auth-submit { margin-top: 22px; height: 56px; font-size: 15.5px; border-radius: 18px; }
.auth-submit svg { transition: transform 0.35s var(--e-spring); }
.auth-submit:hover svg { transform: translateX(4px); }
.auth-accounts { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.07); display: flex; flex-direction: column; gap: 6px; }
.auth-accounts-head { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #6f6c79; margin-bottom: 4px; }
.auth-acc { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; text-align: left; color: #f4f1ea; transition: background-color 0.2s; overflow: hidden; }
.auth-acc:hover { background: rgba(255, 255, 255, 0.05); }
.auth-acc > svg { color: #6f6c79; transition: transform 0.3s var(--e-spring), color 0.2s; }
.auth-acc:hover > svg { transform: translateX(3px); color: var(--accent); }
.auth-acc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.auth-acc-text b { font-size: 13.5px; font-weight: 600; }
.auth-acc-text span { font-size: 12px; color: #8f8c98; overflow: hidden; text-overflow: ellipsis; }
.auth-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 16px; padding: 20px clamp(20px, 4vw, 56px) 26px; font-size: 12.5px; color: #6f6c79; }

.auth-portal { position: fixed; inset: 0; z-index: 2000; pointer-events: none; background: radial-gradient(circle at var(--x) var(--y), var(--accent), color-mix(in oklab, var(--accent) 40%, #000) 60%, #000); clip-path: circle(0 at var(--x) var(--y)); animation: portal 0.65s var(--e-io) forwards; }
.auth-portal.is-done { animation: portal-out 0.6s var(--e-out) forwards; clip-path: circle(var(--r) at var(--x) var(--y)); }
@keyframes portal { to { clip-path: circle(var(--r) at var(--x) var(--y)); } }
@keyframes portal-out { to { opacity: 0; } }

.logo-mark { display: inline-grid; place-items: center; flex: none; }
.logo-mark svg { overflow: visible; }
.logo-mark.is-animated .lm-n { stroke-dasharray: 110; animation: lm-draw 1.4s var(--e-out) 0.2s both; }
.logo-mark.is-animated .lm-dot { animation: lm-dot 0.8s var(--e-pop) 1.2s both; transform-origin: 45px 12.5px; transform-box: view-box; }
@keyframes lm-draw { from { stroke-dashoffset: 110; } }
@keyframes lm-dot { from { transform: scale(0); } }

@media (max-width: 980px) {
	.auth-stage { grid-template-columns: 1fr; gap: 90px; padding-top: 0; }
	.auth-hero { text-align: center; display: flex; flex-direction: column; align-items: center; }
	.auth-h1 { font-size: clamp(40px, 11vw, 64px); margin: 20px 0 14px; }
	.auth-feats { justify-content: center; margin-top: 24px; }
	.auth-card-wrap { max-width: 460px; width: 100%; margin: 0 auto; }
	.auth-orbit { display: none; }
}
@media (max-width: 560px) {
	.auth-top { padding: 18px 18px; }
	.auth-stage { padding: 0 14px 20px; gap: 84px; }
	.auth-feats, .auth-lead { display: none; }
	.auth-h1 { font-size: 40px; }
	.auth-card { padding: 50px 20px 22px; border-radius: 28px; }
	.auth-foot { justify-content: center; }
	.auth-foot .faint { display: none; }
}
