.auth {
  --col: 440px;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-x: clip;
}

.auth:has(.auth-panel-wide) {
  --col: 720px;
}

.auth-frame {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, var(--dash) 50%, transparent 50%) calc(50% - var(--col) / 2) 0 / 1px 32px repeat-y,
    linear-gradient(to bottom, var(--dash) 50%, transparent 50%) calc(50% + var(--col) / 2) 0 / 1px 32px repeat-y,
    linear-gradient(to right, var(--dash) 50%, transparent 50%) 0 72px / 32px 1px repeat-x,
    linear-gradient(to right, var(--dash) 50%, transparent 50%) 0 calc(100% - 72px) / 32px 1px repeat-x;
  animation: auth-in 2s var(--ease-out) 100ms both;
}

.auth-dots {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(50% - var(--col) / 2 - 1px);
  background-image: radial-gradient(var(--dots) 1px, transparent 1.2px);
  background-size: 8px 8px;
}

.auth-dots-l {
  left: 0;
  mask-image: linear-gradient(to right, transparent, #000);
}

.auth-dots-r {
  right: 0;
  mask-image: linear-gradient(to left, transparent, #000);
}

@keyframes auth-in {
  from {
    opacity: 0;
  }
}

.auth-bar {
  flex: none;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 max(24px, calc(50% - 684px));
}

.auth-bar .mark {
  width: 26px;
  height: 26px;
}

.auth-bar .wordmark-name {
  font-size: 20px;
}

.auth-host {
  color: var(--text-muted);
  font-size: 12.5px;
}

.auth-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 56px 16px 128px;
}

.auth-panel {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-panel-wide {
  max-width: 640px;
}

.auth-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.auth-title {
  font: 500 40px/1 var(--font-display);
  letter-spacing: -0.025em;
}

.auth-lede {
  max-width: 60ch;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.3;
}

.auth-login {
  color: var(--text);
  overflow-wrap: anywhere;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-form .field-label {
  font-size: 14px;
}

.auth-form .input {
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-lg);
  background: var(--surface-1);
  font-size: 15px;
}

.auth-form .btn-block {
  margin-top: 4px;
}

.auth-alt {
  display: flex;
  justify-content: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.auth-back {
  align-self: center;
  font-size: 12.5px;
}

.auth-foot {
  padding-top: 16px;
  border-top: 1px dashed var(--line-2);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.auth-form .code-input {
  height: 56px;
  padding: 0 0 0 0.4em;
  font: 500 28px/1 var(--font-mono);
  letter-spacing: 0.4em;
  text-align: center;
}

.code-input::placeholder {
  color: var(--line-strong);
}

.totp-pair {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.totp-qr {
  width: 200px;
  height: 200px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: #ffffff;
}

.totp-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13.5px;
}

.totp-steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
}

.totp-steps > li::before {
  content: counter(step);
  color: var(--text-faint);
  font: 500 11px/20px var(--font-mono);
}

.totp-key {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}

.totp-steps .code-input {
  width: 220px;
  max-width: 100%;
  height: 48px;
  font-size: 22px;
  letter-spacing: 0.35em;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.auth-note {
  color: var(--text-faint);
  font-size: 12.5px;
}

@media (max-width: 639px) {
  .auth-frame,
  .auth-dots {
    display: none;
  }

  .auth-bar {
    padding: 0 16px;
  }

  .auth-main {
    place-items: start center;
    padding-top: 40px;
  }

  .totp-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}
