/* ============================================================
   DualStar · 登录/注册页
   ============================================================ */

.auth-view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-elevated);
  border-radius: var(--r-xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: var(--text-inverse);
  margin-bottom: 16px;
}

.auth-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 1px;
  margin: 0 0 6px;
  font-family: var(--font-title);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  letter-spacing: 0.3px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.auth-input::placeholder {
  color: var(--text-tertiary);
}

.auth-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.auth-input-row .auth-input {
  flex: 1;
}

.auth-send-btn {
  padding: 14px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), opacity var(--dur-fast), transform var(--dur-fast);
  font-family: inherit;
}

.auth-send-btn:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent-deep);
}

.auth-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), opacity var(--dur-fast), transform var(--dur-fast);
  min-height: 48px;
  margin-top: 4px;
}

.auth-btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
}

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

.auth-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-link a {
  color: var(--accent-deep);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}

.auth-link a:hover {
  text-decoration: underline;
}

.auth-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  margin: 0;
  min-height: 16px;
  line-height: 1.5;
}

.auth-hint.error {
  color: var(--danger);
}

.auth-hint.success {
  color: var(--accent-deep);
}

/* 注册步骤 */
.auth-step {
  display: none;
}

.auth-step.active {
  display: block;
}

.auth-step-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--dur-fast);
}

.auth-step-dot.active {
  background: var(--accent);
}

.auth-step-dot.done {
  background: var(--accent-deep);
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 16px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.auth-back:hover {
  color: var(--text);
}

.auth-code-input {
  text-align: center;
  letter-spacing: 8px;
  font-size: 20px;
  font-weight: 500;
  font-family: 'SF Mono', 'Menlo', monospace;
}

.auth-success {
  text-align: center;
  padding: 20px 0;
}

.auth-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  margin-bottom: 16px;
}

.auth-success-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

.auth-success-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* 移动端适配 */
@media (max-width: 480px) {
  .auth-card {
    padding: 32px 24px;
    max-width: 100%;
  }

  .auth-title {
    font-size: 22px;
  }
}
