:root {
  color-scheme: dark;
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  color: #f4f4f5;
  background: #080809;
  font-synthesis: none;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: max(24px, env(safe-area-inset-top)) 22px
    max(24px, env(safe-area-inset-bottom));
  background: #080809;
}

.login-shell {
  width: min(100%, 400px);
  margin: auto;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 24px;
  border-bottom: 1px solid #2c2c31;
}

.login-tabs button {
  position: relative;
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #9b9ba3;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.login-tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
  transition: background-color 150ms ease-out;
}

.login-tabs [aria-pressed="true"] {
  color: #f4f4f5;
}

.login-tabs [aria-pressed="true"]::after {
  background: #f4f4f5;
}

form {
  display: grid;
  gap: 16px;
}

form > div {
  display: grid;
  gap: 8px;
}

.field-group {
  min-width: 0;
}

[hidden] {
  display: none !important;
}

label {
  color: #c7c7cc;
  font-size: 13px;
  font-weight: 500;
}

input,
button {
  font: inherit;
  font-size: 15px;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid #34343a;
  border-radius: 10px;
  background: #202024;
  color: #f4f4f5;
  transition:
    border-color 150ms ease-out,
    background-color 150ms ease-out;
}

input::placeholder {
  color: #9b9ba3;
}

input:focus {
  border-color: #a1a1aa;
  background: #29292e;
  outline: none;
}

::selection {
  background: #f4f4f5;
  color: #080809;
}

input {
  caret-color: #f4f4f5;
}

input:focus-visible,
button:focus-visible {
  outline: 2px solid #f4f4f5;
  outline-offset: 3px;
}

button {
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
}

.primary {
  min-height: 52px;
  margin-top: 2px;
  border: 0;
  background: #f4f4f5;
  color: #080809;
  font-size: 15px;
  font-weight: 600;
  transition:
    background-color 150ms ease-out,
    transform 150ms ease-out;
}

.primary:hover:not(:disabled) {
  background: #dedee2;
}

.primary:active:not(:disabled) {
  transform: scale(0.99);
}

.secondary {
  border: 0;
  background: transparent;
  color: #a1a1aa;
}

.secondary--quiet {
  justify-self: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 13px;
}

#login-error {
  margin: 0;
  color: #f4b5aa;
  font-size: 13px;
  line-height: 1.6;
}

#code-hint {
  margin: 0;
  color: #a1a1aa;
  font-size: 12px;
  line-height: 1.6;
}

button:disabled {
  opacity: 0.52;
  cursor: wait;
}

@media (max-width: 520px) {
  body {
    padding-right: max(20px, env(safe-area-inset-right));
    padding-left: max(20px, env(safe-area-inset-left));
  }
}

@media (max-height: 680px) {
  body {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .login-tabs {
    margin-bottom: 18px;
  }

  form {
    gap: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
