:root {
  --bg: #f0f4f8;
  --card: #ffffff;
  --primary: #1565c0;
  --primary-hover: #0d47a1;
  --border: #d0d4d9;
  --text: #212121;
  --muted: #616161;
  --error: #c62828;
  --success: #2e7d32;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(21, 101, 192, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: linear-gradient(145deg, #e3f2fd 0%, var(--bg) 45%, #eceff1 100%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand h1 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--primary);
}

.auth-brand p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 500;
}

.auth-form .field {
  margin-bottom: 16px;
}

.auth-form input,
.auth-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.15);
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #eceff1;
  color: var(--text);
}

.btn-secondary:hover {
  background: #dfe3e6;
}

.auth-message {
  min-height: 1.4em;
  margin-top: 12px;
  font-size: 0.88rem;
  text-align: center;
}

.auth-message.error {
  color: var(--error);
}

.auth-message.success {
  color: var(--success);
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.88rem;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.role-panel {
  display: none;
}

.role-panel.active {
  display: block;
}

.invite-field {
  display: none;
}

.invite-field.visible {
  display: block;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}
