@font-face {
  font-family: Manrope;
  src: url(manrope-cyrillic.woff2) format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Manrope;
  src: url(manrope-latin.woff2) format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  color-scheme: dark;
  color: #f2f1f8;
  background: #080a12;
  font-family: Manrope, system-ui, sans-serif;
  --muted: #adb1c5;
  --faint: #8f97ad;
  --rule: #ffffff16;
  --purple: #cbb9ff;
  --scale: clamp(1px, 0.075vw, 1.38px);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 12% 20%, #171331 0, transparent 47%),
    radial-gradient(ellipse at 100% 83%, #101828 0, transparent 41%),
    #080a12;
}

.shell {
  width: min(calc(100% - 8vw), 2380px);
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(25px, 4.8vh, 85px) 0 clamp(20px, 4vh, 72px);
  gap: clamp(18px, 4.2vh, 74px);
  animation: reveal 400ms cubic-bezier(.2,.65,.3,1) both;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  justify-self: start;
  padding-left: 2px;
}

.brand img {
  width: calc(44 * var(--scale));
  height: calc(44 * var(--scale));
  border-radius: 11px;
  border: 1px solid #7ac7ff31;
}

.brand-name {
  font-weight: 800;
  font-size: calc(22 * var(--scale));
  letter-spacing: -.04em;
}

.brand-name span { color: #abb6da; font-weight: 640; }

.stage {
  align-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr);
  min-height: clamp(495px, 69vh, 1200px);
  position: relative;
  border: 1px solid var(--rule);
  border-radius: clamp(23px, 2.35vw, 41px);
  overflow: hidden;
  background: #0b0d17;
  box-shadow: 0 36px 90px #0203086e;
}

.art {
  position: relative;
  min-width: 0;
  min-height: 100%;
  display: flex;
  overflow: hidden;
  isolation: isolate;
  align-items: flex-end;
  background: #090a14;
}

.art-image, .art-image::before, .art-image::after {
  position: absolute;
  inset: 0;
}

.art-image::before {
  content: "";
  background: url(aperture.webp) 59% 45% / cover no-repeat;
}

.art-image::after {
  content: "";
  background:
    radial-gradient(ellipse at 31% 24%, #7158d130 0, transparent 63%),
    linear-gradient(180deg, transparent 37%, #080a15b5 78%, #0a0c17 100%),
    linear-gradient(90deg, #090b16ab 0, transparent 64%);
  animation: ambient 24s ease-in-out infinite alternate;
  pointer-events: none;
}

.art-copy {
  z-index: 1;
  width: max-content;
  max-width: 100%;
  padding: calc(42 * var(--scale)) calc(43 * var(--scale));
}

.art-title {
  font-size: clamp(2.3rem, 3.38vw, 5.25rem);
  line-height: .99;
  letter-spacing: -.066em;
  font-weight: 770;
  margin: 0 0 calc(20 * var(--scale));
  max-width: 680px;
}

.art-detail {
  color: #bec6de;
  font-size: calc(14 * var(--scale));
  margin: 0;
  max-width: 410px;
}

.auth-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  background:
    radial-gradient(ellipse at 12% 0%, #30244942, transparent 62%),
    linear-gradient(156deg, #121320 0%, #101420 61%, #111623 100%);
  border-left: 1px solid #c7bbff19;
  padding: calc(39 * var(--scale)) clamp(26px, 3.65vw, 95px) calc(32 * var(--scale));
}

.auth-content {
  align-self: center;
  padding-bottom: calc(16 * var(--scale));
  max-width: 640px;
  width: 100%;
  margin: auto;
}

.application {
  margin: 0 0 calc(25 * var(--scale));
  color: #d8caff;
  font-size: calc(13 * var(--scale));
  font-weight: 770;
  overflow-wrap: anywhere;
}

.auth-heading { position: relative; }

h1 {
  margin: 0;
  letter-spacing: -.063em;
  font-weight: 770;
  line-height: 1.05;
  font-size: clamp(2.05rem, 2.75vw, 4.2rem);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

#auth-description {
  margin: calc(13 * var(--scale)) 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 520;
  font-size: calc(15 * var(--scale));
  max-width: 44ch;
}

.methods {
  display: grid;
  gap: calc(11 * var(--scale));
  margin-top: calc(26 * var(--scale));
}

.methods form { margin: 0; }

.method {
  display: grid;
  width: 100%;
  grid-template-columns: calc(31 * var(--scale)) minmax(0,1fr) auto;
  align-items: center;
  text-align: left;
  gap: calc(10 * var(--scale));
  min-height: calc(57 * var(--scale));
  padding: 10px calc(15 * var(--scale));
  border-radius: calc(14 * var(--scale));
  border: 1px solid transparent;
  font: inherit;
  font-size: calc(15 * var(--scale));
  line-height: 1.3;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.method:hover { transform: translateY(-2px); }
.method:active { transform: translateY(0) scale(.991); }

.method-secondary {
  color: #eff0ff;
  background: #c1c6f208;
  border-color: #d7ccff25;
}

.method-secondary:hover {
  background: #c1c6f212;
  border-color: #d7ccff54;
}

.method-icon, .state-icon { display: block; }
.method-icon .icon { width: calc(25 * var(--scale)); height: calc(25 * var(--scale)); }
.method-secondary .method-icon { color: #d3c6f7; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; }

.auth-security {
  justify-self: stretch;
  display: flex;
  align-items: center;
  gap: calc(10 * var(--scale));
  margin: calc(16 * var(--scale)) auto 0;
  padding: calc(20 * var(--scale)) 0 0;
  width: 100%;
  max-width: 640px;
  border-top: 1px solid var(--rule);
  font-size: calc(12.5 * var(--scale));
  color: #a9afc5;
}

.auth-security p { margin: 0; }
.auth-security .icon { flex: 0 0 calc(18 * var(--scale)); width: calc(18 * var(--scale)); height: calc(18 * var(--scale)); color: #bcaaf4; }

.legal {
  display: flex;
  justify-content: flex-end;
}

.legal p {
  margin: 0;
  max-width: 70ch;
  color: #a9afc5;
  font-size: calc(12.5 * var(--scale));
  line-height: 1.55;
  text-align: right;
}

.legal a {
  color: #d8caff;
  font-weight: 610;
  text-decoration-color: #a994d9a6;
  text-underline-offset: 3px;
}

.legal a:hover { color: #eee6ff; text-decoration-color: currentColor; }

.state-mark {
  display: none;
  width: calc(58 * var(--scale));
  aspect-ratio: 1;
  margin-bottom: calc(21 * var(--scale));
  color: var(--purple);
  border: 1px solid #c3afff38;
  border-radius: calc(17 * var(--scale));
  background: #b49aff0c;
  position: relative;
  place-items: center;
}

.state-icon, .state-spinner { display: none; }
.state-icon { width: calc(27 * var(--scale)); height: calc(27 * var(--scale)); }

:is([data-view="vk_wait"],[data-view="passkey_wait"],[data-view="success"],[data-view="continue"],
    [data-view="error"],[data-view="expired"],[data-view="cancelled"],[data-view="unavailable"]) .state-mark { display: grid; }
[data-view="vk_wait"] .state-vk, [data-view="passkey_wait"] .state-key,
:is([data-view="success"],[data-view="continue"]) .state-check,
:is([data-view="error"],[data-view="expired"],[data-view="cancelled"],[data-view="unavailable"]) .state-alert { display: block; }

:is([data-view="vk_wait"],[data-view="passkey_wait"]) .state-spinner {
  display: block;
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid transparent;
  border-top-color: #d5bfff;
  animation: scan 1.55s ease-in-out infinite alternate;
}

:is([data-view="success"],[data-view="continue"]) .check-stroke {
  stroke-dasharray: 20;
  animation: confirm 380ms ease-out both;
}

:is([data-view="error"],[data-view="unavailable"]) .state-mark {
  color: #ffc8d1;
  border-color: #ffc8d145;
  background: #d2809b10;
}

.runtime-actions { margin-top: calc(22 * var(--scale)); }
.text-button {
  border: 0;
  background: none;
  color: var(--purple);
  text-underline-offset: 4px;
  text-decoration: underline;
  padding: 6px 0;
  font: inherit;
  font-size: calc(14 * var(--scale));
  cursor: pointer;
}
.support-note { margin: 0; color: var(--muted); font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@keyframes ambient { 0% { opacity: .82; } 100% { opacity: 1; } }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes confirm { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }
@keyframes scan { from { opacity: .48; clip-path: inset(0 60% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 10%); } }

.auth-choices {
  gap: calc(12 * var(--scale));
}

.auth-control {
  --cut: calc(14 * var(--scale));
  --facet: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut),
                  100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  --inset-facet: polygon(0 0, calc(100% - var(--cut) + 1px) 0, 100% calc(var(--cut) - 1px),
                        100% 100%, calc(var(--cut) - 1px) 100%, 0 calc(100% - var(--cut) + 1px));
  --edge: linear-gradient(127deg, #c3a6f3, #997bc7 41%, #534173 72%, #b393ea);
  --surface: radial-gradient(ellipse at 42% -45%, #b893f040 0%, transparent 75%),
             linear-gradient(112deg, #402e5e 0%, #59417e 48%, #4d346e 100%);
  --ink: #fbf5ff;
  --plate: linear-gradient(145deg, #56417d, #302146 78%);
  --plate-ink: #f3e7ff;
  --plate-edge: #c7a8f28a;
  --bay: linear-gradient(151deg, #b692e61f, #271a454f);
  --bay-edge: #b493e959;
  --shadow: #7951b743;

  position: relative;
  isolation: isolate;
  grid-template-columns: calc(53 * var(--scale)) minmax(0, 1fr) calc(52 * var(--scale));
  gap: calc(14 * var(--scale));
  min-height: calc(68 * var(--scale));
  padding: 1px 1px 1px calc(7 * var(--scale));
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  letter-spacing: -.018em;
  font-size: calc(15.5 * var(--scale));
  font-weight: 790;
  filter: drop-shadow(0 5px 5px var(--shadow));
  transition: transform 180ms cubic-bezier(.2,.75,.3,1), filter 180ms ease;
}

.auth-control--secondary {
  --edge: linear-gradient(145deg, #a497c0 0%, #4a4265 25%, #2b2a41 60%, #8780ac 100%);
  --surface: radial-gradient(ellipse at 12% -30%, #39334e, transparent 64%),
             linear-gradient(114deg, #1c2134 0%, #1a1b2c 47%, #24223c 100%);
  --ink: #efedfb;
  --plate: linear-gradient(150deg, #3d3758, #23263c 80%);
  --plate-ink: #dccfff;
  --plate-edge: #bdb1e352;
  --bay: linear-gradient(151deg, #a691f111, #a598fc24);
  --bay-edge: #b5a3df37;
  --shadow: #08061195;
}

.auth-control::before, .auth-control::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.auth-control::before {
  inset: 0;
  z-index: -2;
  clip-path: var(--facet);
  background: linear-gradient(118deg, transparent 42%, #f1e3ff80 50%, transparent 58%)
              160% 0 / 270% 100% no-repeat, var(--edge);
}

.auth-control::after {
  inset: 1px;
  z-index: -1;
  clip-path: var(--inset-facet);
  background: linear-gradient(123deg, transparent 63%, #ffffff25 83%, transparent 98%),
              var(--surface);
  box-shadow: inset 0 1px 0 #ffffff35, inset 0 -3px 0 #110c332a;
}

.auth-control__symbol {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  height: calc(45 * var(--scale));
  color: var(--plate-ink);
  background: var(--plate-edge);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
}

.auth-control__symbol::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: var(--plate);
  clip-path: inherit;
  box-shadow: inset 0 -3px 7px #110c3463;
}

.auth-control__symbol .icon {
  display: block;
  width: calc(26 * var(--scale));
  height: calc(26 * var(--scale));
}
.auth-control[data-auth-method="passkey"] .auth-control__symbol .icon {
  display: block;
  width: calc(23 * var(--scale));
  height: calc(23 * var(--scale));
}

.auth-control__copy {
  padding: 9px 0;
}
.auth-control__pending, .auth-control__done, .auth-control__unavailable { display: none; }
.auth-control:not([data-control-state="default"]) .auth-control__label { display: none; }
[data-control-state="loading"] .auth-control__pending,
[data-control-state="success"] .auth-control__done,
[data-control-state="unavailable"] .auth-control__unavailable { display: inline; }

.auth-control__action {
  position: relative;
  display: grid;
  align-self: stretch;
  place-items: center;
  border-left: 1px solid var(--bay-edge);
  clip-path: polygon(0 0, calc(100% - var(--cut) + 1px) 0,
                     100% calc(var(--cut) - 1px), 100% 100%, 0 100%);
  background: var(--bay);
}

.auth-control__action > * {
  grid-area: 1 / 1;
  width: calc(21 * var(--scale));
  height: calc(21 * var(--scale));
}
.auth-control__arrow {
  opacity: .8;
  transition: transform 240ms cubic-bezier(.18,.72,.25,1), opacity 180ms ease;
}
.auth-control__check, .auth-control__stop, .auth-control__spinner { display: none; }

.auth-control:hover, .auth-control:active { transform: none; }

@media (hover: hover) {
  .auth-control:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.045) drop-shadow(0 7px 5px var(--shadow));
  }

  .auth-control:hover:not(:disabled)::before {
    animation: auth-facet-highlight 560ms cubic-bezier(.2,.62,.35,1) both;
  }

  .auth-control:hover:not(:disabled) .auth-control__arrow {
    opacity: 1;
    transform: translateX(3px);
  }
}

@keyframes auth-facet-highlight {
  from { background-position: 160% 0, 0 0; }
  to { background-position: -60% 0, 0 0; }
}

.auth-control:active:not(:disabled) {
  transform: translateY(1px);
  filter: brightness(.95) drop-shadow(0 1px 2px var(--shadow));
  transition-duration: 85ms;
}

.auth-control:active:not(:disabled)::after {
  box-shadow: inset 0 2px 5px #110b3547, inset 0 -1px 0 #e9d6ff26;
}

.auth-control:focus-visible {
  outline-color: #e4d6ff;
  outline-offset: 4px;
}

.auth-control:disabled[data-control-state="default"],
.auth-control[data-control-state="unavailable"] {
  --ink: #aeb3cb;
  --edge: linear-gradient(135deg,#69627a,#313048 70%,#6b6883);
  --surface: linear-gradient(115deg,#242439,#1a1d2d);
  --plate: linear-gradient(145deg,#34344e,#25263b);
  --plate-ink: #b9b5d0;
  --plate-edge: #8b86a34f;
  --bay: #c4b6ff08;
  --bay-edge: #9689b34f;
  --shadow: #09071171;
  cursor: not-allowed;
}

.auth-control[data-control-state="loading"] {
  --bay-edge: #c7b7f37a;
  cursor: progress;
}

.auth-control[data-control-state="success"] {
  --ink: #e4f4ed;
  --edge: linear-gradient(124deg,#a4d9c5,#394b58 48%,#73a99c);
  --surface: linear-gradient(112deg,#2a4349,#202939 65%,#263e47);
  --plate: linear-gradient(150deg,#46696b,#26353e);
  --plate-ink: #d3f7e6;
  --bay: #92d6bd17;
  --bay-edge: #94dbc04f;
  --shadow: #2b514459;
  cursor: default;
}

.auth-control[data-control-state="unavailable"] {
  --ink: #f4d9bd;
  --bay-edge: #c2996652;
}

.auth-control:disabled .auth-control__arrow { display: none; }
[data-control-state="loading"] .auth-control__spinner,
[data-control-state="success"] .auth-control__check,
.auth-control:disabled[data-control-state="default"] .auth-control__stop,
[data-control-state="unavailable"] .auth-control__stop { display: block; }

.auth-control__spinner {
  width: calc(17 * var(--scale));
  height: calc(17 * var(--scale));
  border: 1.5px solid #d9c6ff47;
  border-top-color: currentColor;
  border-right-color: currentColor;
  border-radius: 50%;
  animation: auth-control-orbit 840ms linear infinite;
}

@keyframes auth-control-orbit { to { transform: rotate(1turn); } }

.method-feedback {
  margin: 0 0 4px;
  color: #e6cad5;
  font-size: calc(13 * var(--scale));
  line-height: 1.5;
}

.auth-choice-view .state-mark { display: none; }

@media (min-width: 761px) and (max-width: 1050px) {
  .auth-panel:has(.auth-choices) { padding-inline: clamp(18px, 2.35vw, 25px); }

  .auth-control {
    grid-template-columns: 40px minmax(0, 1fr) 34px;
    gap: 8px;
    min-height: 63px;
    font-size: 14px;
  }

  .auth-control__symbol { height: 37px; }
  .auth-control__action > svg { width: 17px; }
}

@media (max-width: 760px) {
  :root { --scale: 1px; }
  body { background: radial-gradient(ellipse at 45% 4%, #19172f, transparent 61%), #080a12; }
  .shell {
    width: min(calc(100% - 34px), 476px);
    min-height: 100svh;
    grid-template-rows: auto auto 1fr;
    gap: 16px;
    padding: 23px 0 max(20px, env(safe-area-inset-bottom));
  }
  .brand { gap: 10px; padding-left: 2px; }
  .brand img { width: 40px; height: 40px; }
  .brand-name { font-size: 21px; }
  .stage {
    align-self: start;
    min-height: 0;
    border-radius: 24px;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
  }
  .art { min-height: clamp(134px, 22vw + 54px, 188px); }
  .art-image::before {
    background-size: max(100%, 430px) auto;
    background-position: center 34%;
  }
  .art-image::after { background: linear-gradient(180deg, transparent 48%, #10131fb7 100%); }
  .art-copy { display: none; }
  .auth-panel {
    border-left: 0;
    border-top: 1px solid #c7bbff19;
    padding: 23px 22px 19px;
    margin-top: -8px;
    border-radius: 20px 20px 0 0;
    z-index: 1;
  }
  .auth-content { padding-bottom: 1px; }
  .application { margin-bottom: 14px; }
  h1 { font-size: clamp(1.85rem, 7vw, 2.28rem); }
  #auth-description { margin-top: 9px; font-size: 14px; }
  .methods { margin-top: 20px; gap: 8px; }
  .method { min-height: 51px; font-size: 14px; }
  .auth-control {
    grid-template-columns: 43px minmax(0, 1fr) 40px;
    gap: 11px;
    min-height: 60px;
  }
  .auth-control__symbol { height: 38px; }
  .auth-security { margin-top: 21px; padding-top: 15px; font-size: 12px; }
  .state-mark { width: 49px; margin-bottom: 16px; }
  .legal { justify-content: flex-start; align-items: start; padding: 1px 2px; }
  .legal p { font-size: 12px; text-align: left; }
}

@media (max-width: 380px) {
  .shell { width: calc(100% - 26px); }
  .auth-panel { padding-inline: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .method:hover, .method:active, .auth-control__arrow { transform: none !important; }
}
