/* login.css — экран входа Multi Metrics.
   Тёмная «ночная смена»: видео-фон, живые 3D-модели поверх стеклянных панелей,
   цвет отдела ведёт всю подсветку (--acc / --acc2 / --aura). */

:root {
  --bg: #05080f;
  --panel: rgba(9, 14, 26, 0.58);
  --panel-strong: rgba(9, 14, 26, 0.74);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #eef3fb;
  --muted: #8d9ab0;
  --danger: #fb7185;
  --aura: #f59e0b;
  --aura2: #fb923c;
  --px: 0;
  --py: 0;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --radius: 22px;
  color-scheme: dark;
}

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

/* Декор (свечения, рамки, блики) не перехватывает клики. */
.card::before, .card::after, .tile::before, .tile::after, .tile-glow,
.hero-ring, .card-slot::before, .btn-sheen, .field-line, .slot-shadow,
.spark, .bg-vignette::after, .backdrop { pointer-events: none; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

/* ── Фон ──────────────────────────────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
/* Живой фон — 3D-сцена на своём холсте под панелями. Снимок кадра лежит
   рядом и показывается только там, где WebGL недоступен. */
.stage-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg-poster {
  position: absolute; inset: -3%;
  width: 106%; height: 106%;
  object-fit: cover; opacity: 0;
  transform: translate3d(calc(var(--px) * -18px), calc(var(--py) * -12px), 0) scale(1.02);
  transition: transform 1.2s var(--ease-out);
}
.no-3d .bg-poster, .no-bg3d .bg-poster { opacity: 1; }
.bg-aura {
  position: absolute; inset: -20%;
  background:
    radial-gradient(40% 36% at 50% 42%, color-mix(in srgb, var(--aura) 26%, transparent), transparent 70%),
    radial-gradient(30% 30% at 62% 60%, color-mix(in srgb, var(--aura2) 16%, transparent), transparent 70%);
  mix-blend-mode: screen;
  transition: background 0.8s ease;
  animation: aura-breathe 9s ease-in-out infinite;
}
@keyframes aura-breathe { 50% { transform: scale(1.08) translateY(-1.5%); opacity: .8; } }
/* Баннер яркий, а поверх него читается текст — гасим его плотной шторкой:
   ровный тёмный слой плюс затемнение к краям и к низу. */
.bg-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 6, 12, .66) 0%, rgba(8, 6, 12, .34) 32%, rgba(6, 5, 10, .48) 72%, rgba(4, 4, 8, .8) 100%),
    radial-gradient(110% 85% at 50% 45%, transparent 24%, rgba(4, 4, 9, .66) 100%);
}
.mode-login .bg-vignette::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(4, 6, 12, .35);
  animation: fade-in .6s ease both;
}
.bg-grain {
  position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 3D-холст над панелями: модели стоят в пустых слотах и текст не перекрывают */
.stage3d {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 30; pointer-events: none;
}

/* ── Шапка ─────────────────────────────────────────────────────────────── */
.brand {
  position: fixed; z-index: 20;
  top: max(18px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -.01em;
  opacity: 0; transform: translateY(-8px);
  transition: opacity .5s ease .15s, transform .6s var(--ease-out) .15s;
  pointer-events: none;
}
.mode-login .brand { opacity: 1; transform: none; }
.brand-mark { position: relative; width: 40px; height: 40px; display: grid; place-items: center; }
.brand-name { font-size: 15px; }

/* ── Экраны ───────────────────────────────────────────────────────────── */
.screens { position: relative; z-index: 10; height: 100%; }
.screen {
  position: fixed; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  padding-inline: max(16px, env(safe-area-inset-left));
  padding-block: 72px 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  visibility: hidden; pointer-events: none;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen.is-active, .screen.is-leaving { visibility: visible; }
.screen.is-active { pointer-events: auto; }

.slot-fallback {
  font-size: 1em; line-height: 1;
  transition: opacity .4s ease, transform .5s var(--ease-spring);
}
.has-3d-emblem [data-3d="emblem"] .slot-fallback,
.has-3d-support [data-3d="support"] .slot-fallback,
.has-3d-moderation [data-3d="moderation"] .slot-fallback,
.has-3d-premoderation [data-3d="premoderation"] .slot-fallback,
.has-3d-premium [data-3d="premium"] .slot-fallback { opacity: 0; transform: scale(.6); }
.brand-mark .slot-fallback { font-size: 26px; }

/* ── Герой ────────────────────────────────────────────────────────────── */
.hero { display: flex; flex-direction: column; align-items: center; margin-bottom: clamp(20px, 4vh, 44px); }
.hero-slot {
  position: relative;
  width: clamp(130px, 19vh, 190px); aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: clamp(64px, 9vh, 96px);
}
.hero-ring {
  position: absolute; inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--aura) 30%, transparent) 0%, transparent 62%);
  filter: blur(6px);
  transition: background .6s ease;
  animation: ring-pulse 4.5s ease-in-out infinite;
}
.hero-ring::after {
  content: ""; position: absolute; inset: 18% 10% -6%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .08);
  transform: rotateX(72deg) translateY(40%);
}
@keyframes ring-pulse { 50% { transform: scale(1.12); opacity: .7; } }

.hero-title {
  margin: clamp(4px, 1.4vh, 14px) 0 0;
  font-size: clamp(38px, 6.2vw, 76px);
  font-weight: 700; letter-spacing: -.045em; line-height: 1;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 30%, #a9b8d4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.hero-title.is-split { background: none; }
.hero-title .ch {
  display: inline-block;
  background: linear-gradient(180deg, #ffffff 30%, #a9b8d4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(.45em) rotateX(-60deg); filter: blur(8px);
}
.is-ready .hero-title .ch {
  animation: ch-in .9s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 38ms + 120ms);
}
@keyframes ch-in { to { opacity: 1; transform: none; filter: blur(0); } }

/* ── Плитки отделов ───────────────────────────────────────────────────── */
.tiles {
  width: min(1080px, 100%);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
  perspective: 1200px;
}
.tile {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%;
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 16px 18px;
  min-height: clamp(220px, 32vh, 290px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  text-align: center;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .5s var(--ease-out), border-color .35s ease, background .35s ease, box-shadow .5s ease;
  opacity: 0;
  outline: none;
}
.is-ready .tile {
  animation: tile-in .9s var(--ease-out) both;
  animation-delay: calc(var(--i) * 90ms + 420ms);
}
.is-ready .tile.is-in { animation: none; opacity: 1; }
@keyframes tile-in {
  from { opacity: 0; transform: translateY(36px) scale(.96); filter: blur(10px); }
  to { opacity: 1; transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); filter: blur(0); }
}
.tile::before {   /* блик за курсором */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx) var(--my), color-mix(in srgb, var(--acc) 22%, transparent), transparent 65%);
  opacity: 0; transition: opacity .35s ease;
}
.tile::after {    /* контур цветом отдела */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, var(--acc), transparent 40%, transparent 60%, var(--acc2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s ease;
}
.tile:hover, .tile:focus-visible {
  border-color: transparent;
  background: var(--panel-strong);
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--acc) 55%, transparent), 0 0 0 1px rgba(255,255,255,.02) inset;
}
.tile:hover::before, .tile:focus-visible::before, .tile:hover::after, .tile:focus-visible::after { opacity: 1; }
.tile:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 55%, transparent), 0 30px 60px -30px color-mix(in srgb, var(--acc) 55%, transparent); }
.tile:active { transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) scale(.975); transition-duration: .12s; }

.tile-glow {
  position: absolute; left: 50%; top: 30%; width: 70%; aspect-ratio: 1; z-index: -1;
  transform: translate(-50%, -50%) scale(.7);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc) 38%, transparent), transparent 65%);
  opacity: .35; filter: blur(14px);
  transition: opacity .45s ease, transform .6s var(--ease-spring);
}
.tile:hover .tile-glow, .tile:focus-visible .tile-glow { opacity: .9; transform: translate(-50%, -50%) scale(1.1); }

.tile-slot {
  position: relative; width: 100%; flex: 1 1 auto;
  min-height: 110px; max-height: 160px;
  display: grid; place-items: center;
  font-size: 58px;
}
.slot-shadow {
  position: absolute; left: 50%; bottom: 4%;
  width: 46%; height: 12px; transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent);
  transition: transform .5s var(--ease-spring), opacity .4s ease;
}
.tile:hover .slot-shadow { transform: translateX(-50%) scale(.78); opacity: .6; }

.tile-name {
  margin-top: 10px;
  font-size: clamp(16px, 1.35vw, 19px); font-weight: 600; letter-spacing: -.015em;
  line-height: 1.2;
}
.tile-go {
  margin-top: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px 7px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  transition: color .3s ease, background .3s ease, border-color .3s ease, gap .35s var(--ease-spring);
}
.tile-go svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease-spring); }
.tile:hover .tile-go, .tile:focus-visible .tile-go {
  color: #06101a; border-color: transparent;
  background: linear-gradient(90deg, var(--acc), var(--acc2));
  gap: 9px;
}
.tile:hover .tile-go svg { transform: translateX(2px); }

.tile-badge {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: var(--acc);
  background: color-mix(in srgb, var(--acc) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--acc) 35%, transparent);
}
.tile-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 0 currentColor; animation: live 2s ease-out infinite;
}
@keyframes live { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Уход с экрана выбора: выбранная плитка «вспыхивает», остальные опадают */
.screen-picker.is-leaving .hero { animation: hero-out .5s var(--ease-out) forwards; }
.screen-picker.is-leaving .tile { animation: tile-out .5s var(--ease-out) forwards; animation-delay: calc(var(--i) * 40ms); }
.screen-picker.is-leaving .tile.is-picked { animation: tile-picked .55s var(--ease-out) forwards; }
@keyframes hero-out { to { opacity: 0; transform: translateY(-30px) scale(.96); filter: blur(8px); } }
@keyframes tile-out { to { opacity: 0; transform: translateY(50px) scale(.92); filter: blur(8px); } }
@keyframes tile-picked {
  30% { opacity: 1; transform: scale(1.04); box-shadow: 0 0 80px -10px var(--acc); }
  to { opacity: 0; transform: scale(1.1); filter: blur(6px); }
}
.screen-picker.is-returning .hero { animation: fade-up .6s var(--ease-out) both; }
.screen-picker.is-returning .tile { animation: tile-in .6s var(--ease-out) both; animation-delay: calc(var(--i) * 60ms + 80ms); }
.screen-picker.is-returning .hero-title .ch { animation: none; opacity: 1; transform: none; filter: none; }
@keyframes fade-up { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }

/* ── Карточка входа ───────────────────────────────────────────────────── */
.card {
  --acc: #2dd4ff; --acc2: #a78bfa;
  position: relative; isolation: isolate;
  width: min(410px, 100%);
  padding: 26px 30px 30px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 21, 38, .72), rgba(8, 12, 22, .78));
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .03) inset;
}
.card::before {   /* подсветка сверху цветом отдела */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--acc) 20%, transparent), transparent 60%);
}
.card::after {    /* бегущий контур */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--spin, 0deg), transparent 0 55%, var(--acc) 70%, var(--acc2) 80%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .55;
  animation: border-spin 6s linear infinite;
}
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes border-spin { to { --spin: 360deg; } }

.screen-login.is-active .card { animation: card-in .75s var(--ease-out) .12s both; }
@keyframes card-in {
  from { opacity: 0; transform: translate(var(--from-x, 0), var(--from-y, 40px)) scale(.55); filter: blur(12px); }
  60% { filter: blur(0); }
  to { opacity: 1; transform: none; }
}
.screen-login.is-leaving .card { animation: card-out .45s var(--ease-out) forwards; }
@keyframes card-out { to { opacity: 0; transform: translateY(30px) scale(.94); filter: blur(8px); } }

.screen-login.is-active .card > * { animation: fade-up-soft .6s var(--ease-out) both; }
.screen-login.is-active .card > .card-slot { animation-delay: .25s; }
.screen-login.is-active .card > .card-title { animation-delay: .32s; }
.screen-login.is-active .form > * { animation: fade-up-soft .6s var(--ease-out) both; }
.screen-login.is-active .form > :nth-child(1) { animation-delay: .38s; }
.screen-login.is-active .form > :nth-child(2) { animation-delay: .44s; }
.screen-login.is-active .form > :nth-child(4) { animation-delay: .5s; }
.screen-login.is-active .form > :nth-child(5) { animation-delay: .56s; }
@keyframes fade-up-soft { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card.is-shake { animation: shake .5s cubic-bezier(.36, .07, .19, .97) both !important; }
@keyframes shake {
  15% { transform: translateX(-10px); } 30% { transform: translateX(9px); }
  45% { transform: translateX(-7px); } 60% { transform: translateX(5px); }
  75% { transform: translateX(-3px); } 100% { transform: none; }
}

.card-back {
  position: absolute; top: 16px; left: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 8px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font-size: 13px;
  transition: color .25s ease, background .25s ease, gap .3s var(--ease-spring);
}
.card-back svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease-spring); }
.card-back:hover, .card-back:focus-visible { color: var(--text); background: rgba(255, 255, 255, .06); outline: none; }
.card-back:hover svg { transform: translateX(-3px); }

.card-slot {
  position: relative; margin: 8px auto 0;
  width: 132px; height: 132px;
  display: grid; place-items: center; font-size: 64px;
}
.card-slot::before {
  content: ""; position: absolute; inset: 10%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc) 35%, transparent), transparent 65%);
  filter: blur(10px);
  animation: ring-pulse 4s ease-in-out infinite;
}
.card-title {
  margin: 4px 0 22px;
  font-size: 24px; font-weight: 650; letter-spacing: -.025em; text-align: center;
}

/* ── Поля ─────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { position: relative; }
.field input {
  width: 100%; height: 58px;
  padding: 22px 16px 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  outline: none;
  font-size: 16px;
  transition: border-color .25s ease, background .25s ease, box-shadow .35s ease;
}
.field-pass input { padding-right: 52px; }
.field input:hover { border-color: var(--line-strong); }
.field.is-focus input {
  border-color: color-mix(in srgb, var(--acc) 60%, transparent);
  background: rgba(255, 255, 255, .055);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc) 14%, transparent);
}
.field label {
  position: absolute; left: 17px; top: 19px;
  color: var(--muted); font-size: 15px;
  pointer-events: none; transform-origin: left top;
  transition: transform .3s var(--ease-out), color .25s ease;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label {
  transform: translateY(-11px) scale(.78);
}
.field.is-focus label { color: var(--acc); }
.field-line {
  position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--acc), var(--acc2));
  transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--ease-out);
}
.field.is-focus .field-line { transform: scaleX(1); }
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  transition: background-color 9999s ease-out 0s;
  box-shadow: 0 0 0 40px rgba(20, 28, 46, 1) inset;
}

.spark {
  position: absolute; bottom: 12px; width: 6px; height: 6px; margin-left: 14px;
  border-radius: 50%; pointer-events: none;
  background: var(--acc); box-shadow: 0 0 10px var(--acc);
  animation: spark .55s var(--ease-out) forwards;
}
@keyframes spark {
  from { opacity: .95; transform: translate(0, 0) scale(1); }
  to { opacity: 0; transform: translate(var(--dx), -26px) scale(.2); }
}

.pass-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; border-radius: 10px;
  display: grid; place-items: center;
  background: transparent; color: var(--muted);
  transition: color .25s ease, background .25s ease;
}
.pass-toggle:hover, .pass-toggle:focus-visible { color: var(--text); background: rgba(255, 255, 255, .06); outline: none; }
.pass-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pass-toggle .pupil { transform-origin: 12px 12px; transition: transform .35s var(--ease-spring); }
.pass-toggle .slash { stroke-dasharray: 23; stroke-dashoffset: 0; transition: stroke-dashoffset .35s var(--ease-out); }
.pass-toggle.is-on { color: var(--acc); }
.pass-toggle.is-on .slash { stroke-dashoffset: 23; }
.pass-toggle:not(.is-on) .pupil { transform: scale(.55); }

.error {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .35s var(--ease-out), margin .35s var(--ease-out);
  margin: -6px 0;
}
.error > span {
  overflow: hidden; min-height: 0;
  color: var(--danger); font-size: 13.5px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .25s ease, transform .35s var(--ease-out);
}
.error.is-shown { grid-template-rows: 1fr; margin: 0; }
.error.is-shown > span { opacity: 1; transform: none; }

/* ── «Запомнить меня» ─────────────────────────────────────────────────── */
.remember {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  margin: 2px 0 4px; font-size: 14px; color: var(--muted);
  cursor: pointer; user-select: none;
}
.remember input { position: absolute; opacity: 0; pointer-events: none; }
.remember-box {
  width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .03);
  transition: background .25s ease, border-color .25s ease, transform .3s var(--ease-spring);
}
.remember-box svg { width: 14px; height: 14px; fill: none; stroke: #06101a; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .3s var(--ease-out) .05s; }
.remember input:checked + .remember-box { background: linear-gradient(135deg, var(--acc), var(--acc2)); border-color: transparent; }
.remember input:checked + .remember-box svg { stroke-dashoffset: 0; }
.remember:active .remember-box { transform: scale(.88); }
.remember input:focus-visible + .remember-box { box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 45%, transparent); }
.remember:hover { color: var(--text); }

/* ── Кнопка входа ─────────────────────────────────────────────────────── */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  height: 54px; margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 14px;
  color: #06101a; font-size: 16px; font-weight: 650; letter-spacing: -.01em;
  background: linear-gradient(90deg, var(--acc), var(--acc2));
  box-shadow: 0 16px 36px -16px color-mix(in srgb, var(--acc) 80%, transparent);
  transition: transform .3s var(--ease-spring), box-shadow .35s ease, filter .25s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 22px 44px -16px color-mix(in srgb, var(--acc) 90%, transparent); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .1s; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--acc); }
.btn:disabled { cursor: default; }
.btn-sheen {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%);
}
.btn:hover .btn-sheen { animation: sheen .9s var(--ease-out); }
@keyframes sheen { to { transform: translateX(120%); } }
.btn-icon { position: relative; width: 18px; height: 18px; }
.btn-icon svg {
  position: absolute; inset: 0; width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: opacity .25s ease, transform .35s var(--ease-spring);
}
.btn .i-spin, .btn .i-check { opacity: 0; transform: scale(.4); }
.btn .i-arrow { transition: opacity .2s ease, transform .35s var(--ease-spring); }
.btn:hover .i-arrow { transform: translateX(3px); }
.btn[data-state="loading"] .i-arrow, .btn[data-state="done"] .i-arrow { opacity: 0; transform: translateX(10px); }
.btn[data-state="loading"] .i-spin { opacity: 1; transform: none; }
.btn .i-spin circle { stroke-dasharray: 26; stroke-dashoffset: 18; transform-origin: 8px 8px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn[data-state="loading"] .btn-sheen { animation: sheen 1.1s ease-in-out infinite; }
.btn[data-state="done"] .i-check { opacity: 1; transform: none; }
.btn[data-state="done"] .i-check path { stroke-dasharray: 16; stroke-dashoffset: 16; animation: draw .4s var(--ease-out) .1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.btn[data-state="done"] { transform: scale(1.02); }

/* ── Успешный вход и уход ─────────────────────────────────────────────── */
.exit-flash {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--aura) 55%, #fff 10%) 0%, transparent 60%);
  opacity: 0; transform: scale(.4);
}
.is-success .exit-flash { animation: flash 1.1s var(--ease-out) forwards; }
@keyframes flash { 35% { opacity: .55; } to { opacity: 0; transform: scale(2.2); } }
.is-success .card { animation: card-win .8s var(--ease-out) forwards !important; }
@keyframes card-win { 40% { transform: scale(1.02); } to { transform: scale(.97); opacity: .0; filter: blur(6px); } }
body::after {
  content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: var(--bg); opacity: 0; transition: opacity .5s ease;
}
body.is-exiting::after { opacity: 1; }

/* ── Без 3D ───────────────────────────────────────────────────────────── */
.no-3d .stage3d, .no-bg3d .stage-bg { display: none; }

/* ── Узкие экраны ─────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; }
  .tile { min-height: 200px; }
}
@media (max-width: 460px) {
  .screen { padding-block: 64px 28px; justify-content: flex-start; }
  .screen-login { justify-content: center; }
  .hero { margin-top: 8px; }
  .tile { min-height: 176px; padding: 14px 10px; border-radius: 18px; }
  .tile-slot { min-height: 84px; font-size: 44px; }
  .tile-go { padding: 6px 10px 6px 12px; font-size: 12px; }
  .tile-badge { top: 8px; right: 8px; }
  .card { padding: 22px 20px 24px; border-radius: 24px; }
  .card-slot { width: 112px; height: 112px; }
}
@media (max-height: 700px) and (min-width: 461px) {
  .screen { justify-content: flex-start; }
}

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