.auth {
  --snap: cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  min-height: 100svh;
  padding: calc(var(--header) + 32px) 0 clamp(56px, 7vw, 96px);
}

.auth::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at 14px 14px, rgba(20, 20, 32, 0.2) 1px, transparent 1.7px) 0 0 / 28px 28px;
  mask-image: radial-gradient(ellipse 62% 58% at 50% 48%, #000 20%, transparent 78%);
  pointer-events: none;
}

.auth-glow {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 25, 72, 0.11), rgba(255, 25, 72, 0.045) 48%, rgba(255, 25, 72, 0));
  pointer-events: none;
}

.auth-wrap {
  display: grid;
  place-items: center;
}

.auth-card {
  position: relative;
  overflow: hidden;
  width: min(440px, 100%);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.06), 0 40px 90px -44px rgba(17, 17, 17, 0.38);
}

.auth-step {
  display: none;
  padding: clamp(28px, 3vw, 40px);
}

.auth-step.is-active {
  display: block;
}

.auth-head {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-bottom: 26px;
}

.auth-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--red) 10%, var(--paper));
  color: var(--red-text);
  font-size: 24px;
}

.auth-title {
  font-size: clamp(26px, 0.8vw + 18px, 32px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
  outline: 0;
}

.auth-head p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

.auth-head p b {
  font-weight: 600;
  color: var(--ink);
}

.auth-form .row + .row {
  margin-top: 14px;
}

.auth-pass {
  position: relative;
}

.auth-pass input {
  padding-right: 56px;
}

.auth-eye {
  position: absolute;
  top: calc(var(--f-lab) + (var(--f-h) - 44px) / 2);
  right: 1px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 5px;
  border-radius: 13px;
  background-clip: content-box;
  color: var(--ink-2);
  font-size: 20px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.auth-eye::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 0 0 1.5px var(--paper);
  translate: -50% -50%;
  rotate: -45deg;
  scale: 0 1;
  transition: scale 0.2s var(--snap);
}

.auth-eye[aria-pressed="true"]::after {
  scale: 1 1;
}

.auth-eye:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: -2px;
}

.auth-caps {
  display: block;
  margin-top: 6px;
  padding-left: 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--red-text);
}

.auth-caps[hidden] {
  display: none;
}

.auth-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 16px;
}

.auth-line.is-end {
  justify-content: flex-end;
  margin-top: 4px;
}

.auth-line .check {
  align-items: center;
  min-height: 44px;
}

.auth-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(17, 17, 17, 0.25);
  text-underline-offset: 0.24em;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.auth-link:disabled {
  color: var(--ink-2);
  text-decoration-color: transparent;
  cursor: default;
}

.auth-submit {
  position: relative;
  width: 100%;
  margin-top: 24px;
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, scale 0.15s var(--snap);
}

.auth-submit > span {
  transition: opacity 0.2s ease;
}

.auth-submit .dots {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.auth-submit .dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.auth-submit.is-loading {
  pointer-events: none;
}

.auth-submit.is-loading > span {
  opacity: 0;
}

.auth-submit.is-loading .dots {
  opacity: 1;
}

.auth-submit.is-loading .dots i {
  animation: auth-dot 0.9s ease-in-out infinite;
}

.auth-submit.is-loading .dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.auth-submit.is-loading .dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes auth-dot {
  0%, 100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

.auth-help {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--paper-2);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

.auth-help i {
  flex: none;
  margin-top: 1px;
  font-size: 18px;
  color: var(--ink);
}

.auth-help a {
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.auth-foot {
  margin-top: 22px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

.auth-foot a {
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(17, 17, 17, 0.25);
  text-underline-offset: 0.24em;
  transition: text-decoration-color 0.2s ease;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  transition: color 0.2s ease;
}

.auth-back i {
  font-size: 16px;
  transition: translate 0.25s var(--snap);
}

.auth-step[data-method="email"] :is(.auth-for-app, .auth-for-sms):not(.auth-for-email),
.auth-step[data-method="app"] :is(.auth-for-email, .auth-for-sms):not(.auth-for-app),
.auth-step[data-method="sms"] :is(.auth-for-email, .auth-for-app):not(.auth-for-sms) {
  display: none;
}

.auth-ways {
  display: grid;
  gap: 10px;
}

.auth-ways button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--paper-2);
  text-align: left;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, scale 0.15s var(--snap);
}

.auth-ways button > i:first-child {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--paper);
  font-size: 20px;
  color: var(--ink);
}

.auth-ways span {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.auth-ways b {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.auth-ways small {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
}

.auth-ways button > i:last-child {
  flex: none;
  font-size: 16px;
  color: var(--ink-2);
}

.auth-ways button[aria-current="true"] {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.auth-ways button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.auth-ways button:active {
  scale: 0.98;
}

.auth-ways + .auth-back {
  margin-top: 18px;
}

.auth-otp {
  position: relative;
  display: block;
}

.auth-otp input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: none;
  font-size: 16px;
  color: transparent;
  caret-color: transparent;
  opacity: 0;
}

.auth-cells {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.auth-cells i {
  display: grid;
  place-items: center;
  height: 60px;
  border-radius: 14px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1.5px transparent;
  font-size: 24px;
  font-style: normal;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-cells i.is-full {
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.14);
}

.auth-otp:focus-within .auth-cells i.is-on {
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.row.is-error .auth-cells i {
  box-shadow: inset 0 0 0 1.5px var(--red);
}

.auth-rules {
  display: grid;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.auth-rules li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-2);
  transition: color 0.2s ease;
}

.auth-rules i {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 12px;
  color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.auth-rules li.is-ok {
  color: var(--ink);
}

.auth-rules li.is-ok i {
  background: var(--ink);
  box-shadow: none;
  color: var(--paper);
}

.auth-done {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 8px 0;
  text-align: center;
}

.auth-done p {
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

.auth-done .btn {
  margin-top: 14px;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth .cta-rows {
  margin-top: 0;
  box-shadow: inset 0 0 0 1px var(--line);
}

.auth .cta-row {
  min-height: 72px;
}

html.motion .auth-submit:active {
  scale: 0.98;
}

html.motion .auth-card {
  animation: page-rise 0.7s var(--ease) 0.1s backwards;
}

@media (hover: hover) and (pointer: fine) {
  .auth-eye:hover {
    background-color: color-mix(in srgb, var(--ink) 6%, var(--paper));
    color: var(--ink);
  }

  .auth-link:hover,
  .auth-foot a:hover {
    text-decoration-color: currentColor;
  }

  .auth-ways button:hover {
    background: color-mix(in srgb, var(--ink) 6%, var(--paper-2));
  }

  .auth-back:hover {
    color: var(--ink);
  }

  html.motion .auth-back:hover i {
    translate: -3px 0;
  }
}

@media (max-width: 767px) {
  .auth {
    align-items: start;
    min-height: 0;
    padding-top: calc(var(--header) + 16px);
  }

  .auth-card {
    border-radius: 24px;
  }

  .auth-step {
    padding: 28px 20px 24px;
  }

  .auth-cells {
    gap: 6px;
  }

  .auth-cells i {
    height: 54px;
    border-radius: 12px;
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit.is-loading .dots i {
    animation: none;
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) {
    animation: auth-fade-out 0.24s cubic-bezier(0.4, 0, 1, 1) both;
  }

  ::view-transition-new(root) {
    animation: auth-fade-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
  }

  ::view-transition-old(pn-side) {
    animation: auth-to-left 0.36s cubic-bezier(0.4, 0, 1, 1) both;
  }

  ::view-transition-old(pn-top) {
    animation: auth-to-top 0.3s cubic-bezier(0.4, 0, 1, 1) both;
  }

  ::view-transition-old(pn-tabs) {
    animation: auth-to-bottom 0.3s cubic-bezier(0.4, 0, 1, 1) both;
  }
}

@keyframes auth-fade-out {
  to {
    opacity: 0;
    scale: 0.985;
  }
}

@keyframes auth-fade-in {
  from {
    opacity: 0;
    translate: 0 12px;
  }
}

@keyframes auth-to-left {
  to {
    translate: -100% 0;
  }
}

@keyframes auth-to-top {
  to {
    translate: 0 -100%;
  }
}

@keyframes auth-to-bottom {
  to {
    translate: 0 100%;
  }
}

.auth-facts {
  display: grid;
  margin: 24px 0 0;
  padding: 4px 16px;
  border-radius: 16px;
  background: var(--paper-2);
}

.auth-facts > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 10px 0;
}

.auth-facts > div + div {
  border-top: 1px solid var(--line);
}

.auth-facts dt {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  font-size: 14px;
  color: var(--ink-2);
}

.auth-facts dt i {
  font-size: 18px;
  color: var(--ink);
}

.auth-facts dd {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.auth-facts dd.is-code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.auth-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.auth-state.is-ok {
  background: var(--ink);
  color: var(--paper);
}

.auth-state.is-off {
  background: color-mix(in srgb, var(--red) 12%, var(--paper));
  color: var(--red);
}

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}

.auth-note i {
  flex: none;
  margin-top: 2px;
  font-size: 16px;
  color: var(--ink);
}

.auth-back {
  gap: 8px;
  margin-top: 8px;
  color: var(--ink);
  text-decoration: none;
}

.auth-back i {
  font-size: 16px;
  transition: transform 0.2s ease;
}

@media (hover: hover) {
  .auth-back:hover {
    color: var(--ink-2);
  }

  .auth-back:hover i {
    transform: translateX(-3px);
  }
}

.auth-state.is-ok i {
  font-size: 17px;
  color: var(--red);
}

.auth-open i {
  font-size: 22px;
}
