*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --surface: #f4f4f5;
  --border: #e8e8ea;
  --text: #0d0d0d;
  --text-secondary: #353740;
  --muted: #6e6e80;
  --accent: #10a37f;
  --accent-hover: #0d8f6e;
  --danger: #e53935;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei",
    sans-serif;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

.auth-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.auth-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.auth-sub {
  margin: 0 0 20px;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-radius: 10px;
  background: var(--surface);
  padding: 4px;
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
}

.tab.active {
  background: #fff;
  color: var(--text-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.panel .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.panel .field span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.panel input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
}

.panel input:focus {
  outline: 2px solid rgba(16, 163, 127, 0.35);
  outline-offset: 0;
  border-color: var(--accent);
}

.hint {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.err {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--danger);
}

.btn-primary {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.foot {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.875rem;
}

.foot a {
  color: var(--accent);
  text-decoration: none;
}

.foot a:hover {
  text-decoration: underline;
}

.field-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.field-row .grow {
  flex: 1;
  min-width: 0;
}

.btn-send-code {
  flex-shrink: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.btn-send-code:hover:not(:disabled) {
  background: #eaeaeb;
}

.btn-send-code:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
