:root {
  color-scheme: light;
  --ink: var(--color-text);
  --muted: var(--color-text-muted);
  --hollow: #7b8492;
  --line: var(--color-border);
  --hover: var(--color-surface-soft);
  --paper: var(--color-surface);
  --mist: var(--color-surface-soft);
  --accent: var(--color-primary);
  --accent-strong: var(--color-primary-strong);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.43 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
}

.auth-header {
  align-items: center;
  display: flex;
  left: 24px;
  position: absolute;
  top: 24px;
}

.auth-logo {
  align-items: center;
  background: transparent;
  border-radius: 50%;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
  width: 38px;
}

.auth-logo img {
  display: block;
  height: 38px;
  width: 38px;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  padding: 88px 20px 40px;
  place-items: center;
}

.auth-panel {
  width: min(400px, 100%);
}

.auth-panel h1 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.33;
  margin: 0 0 8px;
  text-align: center;
}

.auth-intro {
  color: var(--muted);
  font-size: 14px;
  margin: 0 auto 28px;
  max-width: 340px;
  text-align: center;
}

.auth-label {
  display: block;
  font-weight: 500;
  margin-bottom: 14px;
}

.auth-label span {
  display: block;
  margin-bottom: 6px;
}

.auth-input {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  min-height: 52px;
  padding: 12px 14px;
  width: 100%;
}

.auth-input:hover {
  border-color: #aeb8c7;
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.auth-input--code {
  font-size: 20px;
  letter-spacing: .16em;
  text-align: center;
}

.auth-button {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--paper);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-weight: 600;
  justify-content: center;
  min-height: 52px;
  padding: 12px 16px;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
  width: 100%;
}

.auth-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.auth-button:active { transform: scale(.98); }

.auth-button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.auth-button--secondary {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}

.auth-button--secondary:hover {
  background: var(--hover);
}

.auth-button + .auth-button {
  margin-top: 10px;
}

.provider-mark {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: inline-flex;
  font-weight: 700;
  height: 24px;
  justify-content: center;
  margin-right: 10px;
  width: 24px;
}

.auth-button--secondary .provider-mark {
  background: var(--color-direct-soft);
  border-color: #ead688;
  color: #5a4710;
}

.auth-divider {
  align-items: center;
  color: var(--hollow);
  display: grid;
  font-size: 12px;
  gap: 12px;
  grid-template-columns: 1fr auto 1fr;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  border-top: 1px solid var(--line);
  content: "";
}

.auth-message {
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.auth-message.error::before {
  content: "! ";
  font-weight: 700;
}

.auth-message.error { border-left: 3px solid var(--color-danger); }

.auth-email {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .auth-header {
    left: 16px;
    top: 16px;
  }

  .auth-shell {
    align-items: start;
    padding-top: 104px;
  }

  .auth-input {
    font-size: 16px;
  }

  .auth-input--code {
    font-size: 20px;
  }
}
