@font-face {
  font-family: "Auth Inter";
  src: url("fonts/inter-cyrillic.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Auth Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.auth-page {
  --auth-bg: #0a0a0a;
  --auth-panel: #141414;
  --auth-line: #262626;
  --auth-text: #fff;
  --auth-muted: #a1a1aa;
  --auth-error: #ef4444;
  --auth-ease: cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0;
  background: var(--auth-bg);
  color: var(--auth-text);
  color-scheme: dark;
  font: 400 1rem/1.5 "Auth Inter", system-ui, sans-serif;
}

.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; }
.auth-page :where(h1, h2, p, figure, dl, dd) { margin: 0; }
.auth-page :where(a, input, button) { font: inherit; color: inherit; }
.auth-page :where(a, button):focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.auth-page button { cursor: pointer; }
.auth-page button:disabled { cursor: wait; }
.auth-page [hidden] { display: none !important; }
.auth-recovery { width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 20px; color: var(--auth-text); background: var(--auth-panel); border: 1px solid #383838; border-radius: 10px; }
.auth-recovery::backdrop { background: rgb(0 0 0 / 70%); }
.auth-recovery header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.auth-recovery h2 { font-size: 1.2rem; }

.auth-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 100svh; }
.auth-entry {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 26px clamp(20px, 4.7vw, 76px) 44px;
  border-inline-end: 1px solid var(--auth-line);
}

.auth-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 1.45rem; font-weight: 700; letter-spacing: -.045em; line-height: 1; text-decoration: none; }
.auth-brand img { border: 1px solid #404040; border-radius: 8px; }
.auth-entry-content {
  align-self: start;
  width: min(100%, 390px);
  margin: clamp(26px, calc((100svh - 665px) / 2), 160px) auto 0;
}

.auth-tabs { display: inline-flex; gap: 3px; margin-bottom: 24px; padding: 3px; border: 1px solid var(--auth-line); border-radius: 8px; background: #101010; }
.auth-tabs button { border: 1px solid transparent; border-radius: 6px; padding: 5px 14px; background: transparent; color: var(--auth-muted); font-size: .875rem; line-height: 1.45; }
.auth-tabs button[aria-selected="true"] { border-color: #393939; background: #252525; color: #fff; font-weight: 600; }
.auth-tabs button:hover { color: #fff; }
/* The outgoing form is removed from layout while its replacement changes the height. */
.auth-panels { position: relative; }
.auth-panels.auth-switching { overflow: clip; overflow-clip-margin: 5px; }
.auth-pane.auth-outgoing { position: absolute; inset: 0 0 auto; pointer-events: none; }
.auth-pane[hidden] { display: none; }
.auth-pane h1 { font-size: clamp(1.75rem, 3vw, 2.15rem); font-weight: 650; letter-spacing: -.032em; line-height: 1.15; }
.auth-intro { margin-top: 6px; color: var(--auth-muted); font-size: .875rem; }

.auth-form { display: grid; gap: 14px; margin-top: 21px; }
.auth-field { display: grid; gap: 5px; min-width: 0; }
.auth-field label { color: #eee; font-size: .875rem; font-weight: 500; }
.auth-field input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--auth-line);
  border-radius: 6px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  background: var(--auth-panel);
}

.auth-field input:focus { border-color: #fff; outline-color: #fff; }
.auth-field input[aria-invalid="true"] { border-color: var(--auth-error); }
.auth-field input[aria-invalid="true"]:focus { outline-color: var(--auth-error); }
.auth-field-error { color: #fca5a5; font-size: .8125rem; line-height: 1.4; }
.auth-form-error { padding: 8px 10px; border: 1px solid #4a4a4a; border-radius: 6px; background: #151515; color: #fff; font-size: .875rem; overflow-wrap: anywhere; }
.auth-forgot {
  justify-self: end;
  margin: 2px 0 0;
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--auth-muted);
  font-size: .8125rem;
  text-decoration: underline;
  text-underline-offset: .21em;
}

.auth-forgot:hover { color: #fff; }
.auth-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #fff;
  border-radius: 6px;
  padding: 8px 11px;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.auth-primary { background: #fff; color: #0a0a0a; }
.auth-primary:hover:enabled { background-color: #e4e4e7; }
.auth-primary:disabled { background: #d4d4d8; border-color: #d4d4d8; }
.auth-docs { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; color: var(--auth-muted); font-size: .8125rem; }
.auth-docs a:hover { color: #fff; }
.auth-notice { color: var(--auth-muted); font-size: .8125rem; }
.auth-notice:not(:empty) { margin-top: 9px; }

.auth-story { padding: 48px clamp(24px, 5.2vw, 88px); }
.auth-story-content { display: grid; gap: clamp(23px, 4.25vh, 46px); width: min(100%, 580px); margin: clamp(0px, calc((100svh - 720px) / 2), 135px) auto 0; }
.auth-story-heading h2 { max-width: 16ch; font-size: clamp(2.3rem, 4.1vw, 4.25rem); font-weight: 650; line-height: 1.04; letter-spacing: -.047em; text-wrap: balance; }
.auth-story-heading p { max-width: 43ch; margin-top: 16px; color: var(--auth-muted); font-size: clamp(.9375rem, 1.15vw, 1.0625rem); line-height: 1.55; }
.auth-map { position: relative; min-width: 0; border: 1px solid var(--auth-line); border-radius: 8px; overflow: hidden; background: #121212; }
.auth-map-image { display: block; width: 100%; height: clamp(155px, 24vh, 265px); }
.auth-map figcaption { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid #2c2c2c; background: #101010; color: #d4d4d8; font-size: .75rem; }
.auth-map figcaption a { color: var(--auth-muted); text-decoration: none; }
.auth-map figcaption a:hover { text-decoration: underline; }
.auth-map-points { fill: #e4e4e7; stroke: #1b1b1b; stroke-width: 1.3; }
.auth-map-ring { fill: none; stroke: #a1a1aa; stroke-width: 1; }
.auth-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 18px; border-top: 1px solid var(--auth-line); }
.auth-stats > div { display: flex; flex-direction: column-reverse; gap: 2px; }
.auth-stats dd { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 650; letter-spacing: -.04em; line-height: 1.16; font-variant-numeric: tabular-nums; white-space: nowrap; }
.auth-stats dt { color: var(--auth-muted); font-size: .875rem; }

@media (prefers-reduced-motion: no-preference) {
  .auth-layout { animation: auth-appear 260ms var(--auth-ease) both; }
  .auth-button, .auth-tabs button {
    transition: transform 150ms var(--auth-ease), background-color 150ms var(--auth-ease), border-color 150ms var(--auth-ease);
  }
  .auth-button:active:enabled, .auth-tabs button:active { transform: scale(.98); }
  .auth-field input { transition: border-color 165ms var(--auth-ease), outline-color 165ms var(--auth-ease); }
  @keyframes auth-appear { from { opacity: 0; } to { opacity: 1; } }
}

@media (max-width: 760px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-entry { padding: 18px clamp(16px, 5vw, 32px) 38px; border-inline-end: 0; border-bottom: 1px solid var(--auth-line); }
  .auth-entry-content { margin-top: 25px; }
  .auth-tabs { margin-bottom: 18px; }
  .auth-story { padding: 32px clamp(16px, 5vw, 32px) 37px; }
  .auth-story-content { width: min(100%, 470px); margin-top: 0; }
  .auth-story-heading h2 { font-size: clamp(2rem, 6.6vw, 2.85rem); }
  .auth-story-heading p { margin-top: 10px; }
  .auth-stats { padding-top: 13px; }
}
