.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: end center;
  background: #f2f2f2;
}

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

.auth-gate__card {
  width: min(100%, 520px);
  max-height: 100dvh;
  overflow-y: auto;
  box-sizing: border-box;
  border-radius: 24px 24px 0 0;
  background: #fff;
  color: #202124;
  padding: 32px 20px max(24px, env(safe-area-inset-bottom));
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.12);
}

.auth-gate__title {
  margin: 0 0 20px;
  text-align: center;
  font-size: 22px;
  line-height: 1.2;
}

.auth-gate__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-gate__step-title {
  max-width: 360px;
  margin: 0 0 12px;
  color: #202124;
  font-size: 24px;
  line-height: 1.2;
}

.auth-gate__step-copy {
  max-width: 360px;
  margin: 0 0 22px;
  color: #6f6f75;
  line-height: 1.5;
}

.auth-gate__field,
.auth-gate__primary,
.auth-gate__secondary {
  width: 100%;
  box-sizing: border-box;
}

.auth-gate__field {
  margin-bottom: 12px;
  border: 1px solid #d8d8dd;
  border-radius: 12px;
  padding: 13px 14px;
  background: #fff;
  color: inherit;
  font: inherit;
}

.auth-gate__primary,
.auth-gate__secondary {
  min-height: 46px;
  border-radius: 12px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
}

.auth-gate__primary {
  border: 0;
  background: #111;
  color: #fff;
}

.auth-gate__secondary {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #111;
}

.auth-gate__message {
  margin: 10px 4px 0;
  color: #6f6f75;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
}

.auth-gate__verify {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-gate__mail-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  color: #111;
}

.auth-gate__verify-title {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.2;
}

.auth-gate__verify-copy {
  margin: 0 0 12px;
  color: var(--muted, #6f6f75);
  line-height: 1.5;
}

.auth-gate__verify-email {
  color: var(--text, #202124);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.auth-gate__sender-note {
  margin: 4px 0 20px;
  color: var(--muted, #6f6f75);
  font-size: 13px;
}

.auth-gate__primary:disabled {
  cursor: default;
  opacity: 0.58;
}

.auth-gate :focus-visible {
  outline: 3px solid rgba(17, 17, 17, 0.45);
  outline-offset: 2px;
}

html[data-auth-state="checking"] body > :not(.auth-gate),
html[data-auth-state="locked"] body > :not(.auth-gate) {
  pointer-events: none;
  user-select: none;
}

html[data-auth-state="checking"] .screen,
html[data-auth-state="locked"] .screen { visibility: hidden; }

.auth-gate__profile { display: flex; flex-direction: column; gap: 12px; }
.auth-gate__profile label { font-size: 15px; font-weight: 600; }
.auth-gate__profile .auth-gate__field { margin: 0; }
.auth-gate__profile .auth-gate__message { margin: 0; color: #555; }
.auth-gate__profile label:not(:first-child) { margin-top: 10px; }
.auth-gate__profile .auth-gate__secondary:disabled { opacity: .58; cursor: default; }
