:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #111b41;
  background: #f3f6fc;
  --ink: #111b41;
  --blue: #0735ee;
  --line: #c0cbe0;
  --radius: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.auth-screen { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.auth-art {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  height: clamp(108px, 20svh, 168px);
  background: #061553;
}
.auth-art::before, .auth-art::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}
.auth-art::before {
  background: url("brand/flow-auth-rings.webp") center 48% / cover no-repeat;
  transform: scale(1.08);
  animation: auth-rings 8s ease-in-out infinite;
}
.auth-art::after {
  inset: -14%;
  background: radial-gradient(ellipse at 29% 55%, #54dfff35, transparent 36%),
              radial-gradient(ellipse at 71% 33%, #55a4ff40, transparent 33%);
  mix-blend-mode: screen;
  animation: auth-light 8s ease-in-out infinite;
}
@keyframes auth-rings {
  0%, 100% { transform: translate(-.9%, .3%) scale(1.08); }
  50% { transform: translate(1.4%, -.9%) scale(1.12); }
}
@keyframes auth-light {
  0%, 100% { opacity: .28; transform: translate(-2%, 1%); }
  50% { opacity: .58; transform: translate(5%, -3%); }
}
.auth-content {
  flex: 1;
  min-width: 0;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 23px max(22px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 48% 44%, #f7f9fd, #eff4fc);
}
.auth-panel { width: min(100%, 520px); min-width: 0; }
.auth-header { text-align: center; margin-bottom: 27px; }
.auth-logo { display: block; width: 57px; height: 57px; margin: 0 auto 13px; border-radius: 23%; object-fit: contain; }
.auth-header h1 { margin: 0; font-size: clamp(26px, 4.6vw, 38px); line-height: 1.17; letter-spacing: -.035em; font-weight: 700; }
.auth-form { display: grid; gap: 18px; }
.auth-control { display: grid; gap: 7px; min-width: 0; }
.auth-label-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: 12px; row-gap: 5px; }
.auth-control label { color: #29365e; font-size: 16px; font-weight: 600; }
.auth-label-row a { font-size: 15px; }
.auth-control input {
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fd;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  padding: 10px 13px;
  scroll-margin-block: 18px;
}
.auth-password { position: relative; }
.auth-password input { padding-inline-end: 50px; }
.auth-visibility {
  position: absolute;
  inset: 0 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #576b91;
  cursor: pointer;
}
.auth-visibility:hover { color: var(--ink); }
.auth-eye-slash { display: none; }
.auth-password input[type="text"] + .auth-visibility .auth-eye-slash { display: block; }
.auth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 16px;
  font: inherit;
  font-size: 17px;
  font-weight: 650;
  cursor: pointer;
  scroll-margin-block: 18px;
}
.auth-primary { margin-top: 4px; background: var(--blue); color: white; }
.auth-primary:hover:not(:disabled) { background: #0028cf; }
.auth-primary:disabled { background: #cbd6f0; color: #40547f; cursor: default; }
.auth-secondary { background: #f7f9fd; border-color: var(--line); color: var(--ink); }
.auth-secondary:hover:not(:disabled) { background: #eaf0fc; }
.auth-plane { color: #077bed; flex: none; }
.auth-telegram { margin-top: 16px; }
.auth-footer { margin: 23px 0 0; text-align: center; color: #29365e; line-height: 1.55; }
.auth-footer a { display: inline-block; margin-inline: .2em; }
a { color: #0039de; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid #1055df; outline-offset: 3px; }
.auth-control input[aria-invalid="true"] { border-color: #b31b38; }
.auth-notice { margin: 0 0 15px; padding: 11px 13px; border-radius: 11px; background: #e7eefb; color: #263962; line-height: 1.4; overflow-wrap: anywhere; }
.auth-form .auth-notice, .auth-telegram .auth-notice { margin: 0; }
.auth-wait p { margin: 0 0 4px; }
.auth-error { color: #9f1731; font-size: 14px; line-height: 1.4; }
.auth-error.auth-notice { background: #fcecf0; }
.auth-control .auth-error { margin: 0; }
@media (min-width: 960px) {
  .auth-screen { display: grid; grid-template-columns: minmax(0, 52.25fr) minmax(0, 47.75fr); }
  .auth-art { height: auto; }
  .auth-content { align-items: center; padding: 43px clamp(29px, 5.45vw, 100px); }
  .auth-header { margin-bottom: clamp(28px, 4vh, 42px); }
  .auth-logo { width: clamp(64px, 5.5vw, 88px); height: auto; margin-bottom: 17px; }
  .auth-header h1 { font-size: clamp(27px, 2.65vw, 42px); }
  .auth-control label { font-size: clamp(16px, 1.65vw, 21px); }
  .auth-control input { min-height: clamp(50px, 6.7vh, 63px); }
  .auth-form { gap: clamp(16px, 2.5vh, 25px); }
  .auth-button { min-height: clamp(51px, 7.2vh, 65px); font-size: clamp(17px, 1.55vw, 22px); }
  .auth-primary { margin-top: clamp(4px, 1vh, 11px); }
  .auth-telegram { margin-top: clamp(16px, 2.5vh, 24px); }
  .auth-footer { margin-top: clamp(20px, 3.4vh, 32px); font-size: clamp(16px, 1.43vw, 20px); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-art::before, .auth-art::after { animation: none; }
  .auth-art::before { transform: none; }
  .auth-art::after { opacity: .28; }
}

.auth-art--video { background: #07172f; }
.auth-art--video::before, .auth-art--video::after { content: none; }
.auth-art__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.auth-art__video { visibility: hidden; }
.auth-art__video[data-playing] { visibility: visible; }
@media (prefers-reduced-motion: reduce) {
  .auth-art__video { display: none; }
}

/* Login uses a compact banner in the stacked layout. */
@media (max-width: 959.98px), (orientation: portrait) {
  .auth-screen--login { display: flex; }
  .auth-screen--login .auth-art {
    flex: none;
    height: clamp(140px, 20svh, 180px);
  }
  .auth-screen--login .auth-content {
    flex: 1 0 auto;
    display: flex;
    padding: 20px max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }
  .auth-screen--login .auth-panel {
    width: min(100%, 420px);
    margin: auto;
  }
  .auth-screen--login .auth-header { margin-bottom: clamp(22px, 3.2svh, 30px); }
  .auth-screen--login .auth-header h1 { font-size: clamp(30px, 4.7vw, 36px); }
  .auth-screen--login .auth-art__media {
    inset: 0 auto 0 50%;
    width: auto;
    max-width: 100%;
    aspect-ratio: 1.35;
    transform: translateX(-50%);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  }
}
@media (min-width: 600px) and (orientation: portrait) {
  .auth-screen--login .auth-art { height: clamp(200px, 22svh, 240px); }
}
@media (max-width: 959.98px) and (max-height: 560px) {
  .auth-screen--login .auth-art { height: clamp(84px, 26svh, 138px); }
}

@media (max-width: 1199.98px), (orientation: portrait), (pointer: coarse) {
  .auth-screen--login .auth-logo { margin-bottom: 12px; }
}
