@font-face {
  font-family: "Onest Auth";
  src: url("/static/fonts/onest-cyrillic-ext-wght-normal.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

body:not(.auth-ready) .app-shell,
body.auth-locked .app-shell {
  visibility: hidden;
}

body.auth-locked {
  overflow: hidden;
  color: #0d0e0c;
  background: #f5f1e8;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(520px, .82fr);
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  color: #0d0e0c;
  background: #f5f1e8;
  font-family: "Onest Auth", "Onest", Inter, "Segoe UI", sans-serif;
}

.auth-gate.hidden,
.auth-form.hidden,
.auth-tabs.hidden {
  display: none;
}

.auth-visual {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100dvh;
  flex-direction: column;
  padding: 40px clamp(38px, 4vw, 68px) 38px;
  overflow: hidden;
  color: #fffaf1;
  background: #0d0e0c;
}

.auth-visual::before {
  position: absolute;
  z-index: 0;
  inset: 0 0 auto;
  width: 100%;
  height: 4px;
  background: #ff6b55;
  content: "";
}

.auth-visual::after {
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 107, 85, .18);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.journey-auth-home {
  position: absolute;
  z-index: 3;
  top: 39px;
  right: clamp(38px, 4vw, 68px);
  left: auto;
  width: auto;
  max-width: none;
  color: #a9a298;
  font-size: 13px;
  font-weight: 650;
  text-align: right;
  text-decoration: none;
  white-space: nowrap;
}

.journey-auth-home:hover {
  color: #ff8a76;
}

.auth-brand {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
}

.auth-brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  padding: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 107, 85, .55);
  border-radius: 13px;
  color: transparent;
  background: #fffaf1;
  box-shadow: none;
  font-size: 0;
}

.auth-brand-mark img,
.auth-brand-mark svg {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: cover;
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  color: #fffaf1;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -.035em;
}

.auth-brand small {
  margin-top: 2px;
  color: #a9a298;
  font-size: 12px;
  font-weight: 580;
  letter-spacing: 0;
}

.auth-hero {
  position: relative;
  z-index: 2;
  max-width: 690px;
  margin: auto 0 0;
  padding-top: clamp(64px, 11vh, 118px);
}

.auth-hero > span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 107, 85, .45);
  border-radius: 999px;
  color: #ffb3a5;
  background: rgba(255, 107, 85, .08);
  font-size: 12px;
  font-weight: 700;
}

.auth-hero h1 {
  max-width: 680px;
  margin: 22px 0 18px;
  color: #fffaf1;
  font-size: clamp(46px, 4.5vw, 68px);
  font-weight: 750;
  line-height: .99;
  letter-spacing: -.06em;
}

.auth-hero p {
  max-width: 620px;
  margin: 0;
  color: #bdb7ad;
  font-size: 16px;
  line-height: 1.6;
}

.auth-points {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: clamp(38px, 6vh, 64px);
  border-top: 1px solid rgba(255, 250, 241, .16);
}

.auth-point {
  min-width: 0;
  padding: 18px 22px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-point + .auth-point {
  padding-left: 22px;
  border-left: 1px solid rgba(255, 250, 241, .12);
}

.auth-point b,
.auth-point strong,
.auth-point small {
  display: block;
}

.auth-point b {
  width: auto;
  height: auto;
  margin: 0 0 12px;
  border: 0;
  border-radius: 0;
  color: #ff806d;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.auth-point strong {
  color: #fffaf1;
  font-size: 14px;
  font-weight: 680;
}

.auth-point small {
  margin-top: 6px;
  color: #9f998f;
  font-size: 12px;
  line-height: 1.45;
}

.auth-panel {
  display: flex;
  min-width: 0;
  min-height: 100dvh;
  align-items: flex-start;
  justify-content: center;
  padding: 0 clamp(24px, 4vw, 60px);
  overflow-x: hidden;
  overflow-y: auto;
  background: #f5f1e8;
}

.auth-card {
  width: min(100%, 540px);
  max-width: 540px;
  min-height: 0;
  margin: clamp(22px, 4vh, 42px) auto;
  padding: 27px 30px 29px;
  border: 1px solid #d8d2c7;
  border-radius: 18px;
  color: #0d0e0c;
  background: #fffaf1;
  box-shadow: 0 18px 48px rgba(13, 14, 12, .09);
}

.auth-card-head {
  margin-bottom: 18px;
}

.auth-card-head p {
  margin: 0 0 6px;
  color: #bf3d2b;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .02em;
}

.auth-card-head h2 {
  margin: 0;
  color: #0d0e0c;
  font-size: 30px;
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -.045em;
}

.auth-card-head small {
  display: block;
  margin-top: 8px;
  color: #6b655c;
  font-size: 13px;
  line-height: 1.45;
}

.auth-origin {
  display: none;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 18px;
  padding: 3px;
  border: 1px solid #d8d2c7;
  border-radius: 12px;
  background: #eee8de;
  box-shadow: none;
}

.auth-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  color: #6b655c;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.auth-tabs button.active {
  color: #0d0e0c;
  background: #fffaf1;
  box-shadow: 0 2px 7px rgba(13, 14, 12, .08);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field > span {
  color: #393630;
  font-size: 12px;
  font-weight: 680;
}

.auth-field input {
  width: 100%;
  height: 48px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #cfc8bd;
  border-radius: 11px;
  color: #0d0e0c;
  background: #fffef9;
  font: inherit;
  font-size: 15px;
  font-weight: 560;
  outline: none;
  box-sizing: border-box;
}

.auth-field input::placeholder {
  color: #999187;
}

.auth-field input:focus {
  border-color: #d84c38;
  box-shadow: 0 0 0 3px rgba(216, 76, 56, .13);
}

.auth-field-hint {
  margin-top: -1px;
  color: #797268;
  font-size: 11px;
  line-height: 1.35;
}

.auth-password {
  position: relative;
}

.auth-password input {
  padding-right: 88px;
}

.auth-password button {
  position: absolute;
  top: 50%;
  right: 7px;
  min-width: 72px;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  color: #bf3d2b;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  transform: translateY(-50%);
  cursor: pointer;
}

.auth-password button:hover {
  background: #fff0ec;
}

.auth-credential-notice {
  margin: -3px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  color: #625b52;
  background: #f1ece3;
  font-size: 11px;
  line-height: 1.4;
}

.auth-submit {
  min-height: 50px;
  margin-top: 3px;
  border: 1px solid #0d0e0c;
  border-radius: 11px;
  color: #fffaf1;
  background: #0d0e0c;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.auth-submit:hover:not(:disabled) {
  color: #0d0e0c;
  background: #ff6b55;
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: .62;
  cursor: wait;
}

.auth-link {
  min-height: 34px;
  padding: 0 5px;
  border: 0;
  border-radius: 7px;
  color: #bf3d2b;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.auth-form-row {
  display: flex;
  justify-content: flex-end;
}

.auth-message {
  min-height: 0;
  margin: 0;
  color: #a4433e;
  font-size: 12px;
  line-height: 1.4;
}

.auth-message:empty {
  display: none;
}

.auth-message.success {
  color: #1f704f;
}

.auth-note {
  margin: 16px 0 0;
  padding-top: 13px;
  border-top: 1px solid #e2ddd3;
  color: #797268;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.auth-legal {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
}

.auth-legal a,
.journey-auth-legal {
  color: #bf3d2b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.auth-legal a:hover,
.journey-auth-legal a:hover {
  text-decoration: underline;
}

.journey-auth-legal {
  margin: 2px 0 0;
  color: #797268;
  text-align: center;
}

.auth-user {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  padding: 9px;
  border: 1px solid #d8d2c7;
  border-radius: 12px;
  background: rgba(255, 254, 249, .64);
}

.auth-user-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  color: #fffaf1;
  background: #d84c38;
  font-size: 13px;
  font-weight: 800;
}

.auth-user-copy {
  min-width: 0;
}

.auth-user-copy strong,
.auth-user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-copy strong {
  color: #0d0e0c;
  font-size: 12px;
}

.auth-user-copy small {
  margin-top: 2px;
  color: #797268;
  font-size: 11px;
}

.auth-logout {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9px;
  color: #6b655c;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
}

.auth-logout:hover {
  color: #0d0e0c;
  background: #eee8de;
}

.auth-gate :is(button, a, input):focus-visible {
  outline: 3px solid rgba(255, 107, 85, .46);
  outline-offset: 2px;
}

@media (min-width: 1001px) and (max-height: 760px) {
  .auth-visual {
    padding-block: 28px;
  }

  .journey-auth-home {
    top: 29px;
  }

  .auth-hero {
    padding-top: 42px;
  }

  .auth-points {
    margin-top: 30px;
  }

  .auth-card {
    margin-block: 14px;
    padding-block: 22px;
  }

  .auth-field input {
    height: 45px;
    min-height: 45px;
  }
}

@media (max-width: 1000px) {
  body.auth-locked {
    overflow: auto;
  }

  .auth-gate {
    position: absolute;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .auth-visual {
    min-height: 270px;
    padding: 30px 28px 34px;
  }

  .journey-auth-home {
    top: 33px;
    right: 28px;
  }

  .auth-hero {
    margin-top: 54px;
    padding-top: 0;
  }

  .auth-hero h1 {
    max-width: 680px;
    margin-block: 14px 10px;
    font-size: clamp(36px, 7vw, 52px);
  }

  .auth-points {
    display: none;
  }

  .auth-panel {
    min-height: auto;
    padding: 24px 20px 42px;
    overflow: visible;
  }

  .auth-card {
    margin: 0 auto;
  }
}

@media (max-width: 560px) {
  .auth-visual {
    min-height: 205px;
    padding: 22px 20px 26px;
  }

  .journey-auth-home {
    top: 24px;
    right: 20px;
    font-size: 12px;
  }

  .auth-brand-mark {
    width: 42px;
    height: 42px;
  }

  .auth-brand {
    padding-right: 112px;
  }

  .auth-hero {
    margin-top: 38px;
  }

  .auth-hero > span,
  .auth-hero p {
    display: none;
  }

  .auth-hero h1 {
    margin: 0;
    font-size: 34px;
  }

  .auth-panel {
    padding: 0;
    background: #fffaf1;
  }

  .auth-card {
    width: 100%;
    max-width: none;
    padding: 26px 20px 38px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-card-head h2 {
    font-size: 28px;
  }

  .auth-field input {
    height: 54px;
    min-height: 54px;
  }

  .auth-submit {
    min-height: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-gate *,
  .auth-gate *::before,
  .auth-gate *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
