:root {
  color-scheme: light;
  --auth-bg: #f5f6f4;
  --auth-panel: #fff;
  --auth-ink: #17211f;
  --auth-muted: #707d79;
  --auth-line: #dfe5e1;
  --auth-primary: #0b7a67;
  --auth-primary-dark: #075b4d;
  --auth-danger: #a5423e;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--auth-ink);
  background: var(--auth-bg);
}

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

.auth-panel {
  width: min(100%, 420px);
  padding: 30px;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  background: var(--auth-panel);
  box-shadow: 0 1px 2px rgba(16,24,22,.05), 0 18px 56px rgba(16,24,22,.1);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.auth-brand strong {
  display: block;
  font-size: 19px;
  font-weight: 850;
  letter-spacing: 0;
}

.auth-brand small {
  display: block;
  margin-top: 3px;
  color: var(--auth-muted);
  font-size: 13px;
}

.auth-mark {
  display: flex;
  width: 40px;
  height: 40px;
  overflow: hidden;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.auth-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-body h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0;
}

.auth-body p {
  margin: 8px 0 22px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  background: #f7f8f6;
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--auth-muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.auth-tabs button.active {
  color: #fff;
  background: var(--auth-primary);
  box-shadow: 0 8px 18px rgba(11,122,103,.16);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #334b44;
  font-size: 13px;
  font-weight: 750;
}

.auth-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--auth-line);
  border-radius: 7px;
  color: var(--auth-ink);
  background: #fff;
  font: inherit;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(11,122,103,.1);
}

.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  margin-top: 6px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--auth-primary);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

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

.auth-button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.auth-hint {
  margin: -4px 0 0;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-message {
  min-height: 18px;
  margin-top: 14px;
  color: var(--auth-danger);
  font-size: 13px;
  line-height: 1.45;
}

.auth-loading {
  color: var(--auth-muted);
  font-size: 14px;
}

.pwa-install-button {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: none;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--auth-primary);
  box-shadow: 0 14px 38px rgba(11,122,103,.22);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.pwa-install-button.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 520px) {
  html,
  body {
    min-height: 100%;
    min-height: -webkit-fill-available;
  }

  .auth-shell {
    padding: 14px 14px max(14px, env(safe-area-inset-bottom));
    place-items: stretch;
  }

  .auth-panel {
    align-self: center;
    padding: 22px;
    border-radius: 8px;
  }

  .pwa-install-button {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}
