/* 登录/注册页面样式 */
:root {
  --destructive: #dc2626;
}

.auth-page {
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(139, 92, 246, 0.04) 50%, var(--background) 100%);
}

.auth-wrapper {
  width: 100%;
  max-width: 28rem;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
}

.auth-header .subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.375rem;
}

/* Tab 切换 */
.auth-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--muted);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab:hover {
  color: var(--foreground);
}

.auth-tab.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.auth-panel {
  display: none;
}

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

/* 表单 */
.auth-form .form-group {
  margin-bottom: 1.25rem;
}

.auth-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.auth-form input,
.auth-form select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus,
.auth-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.auth-form input::placeholder {
  color: var(--muted-foreground);
}

/* 手机号输入行 */
.phone-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.phone-row .country-picker {
  position: relative;
  flex-shrink: 0;
}

.phone-row .country-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-width: 5rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--foreground);
  font-family: inherit;
}

.phone-row .country-trigger:hover {
  border-color: var(--muted-foreground);
}

.phone-row .country-chevron {
  flex-shrink: 0;
  opacity: 0.6;
  transition: transform 0.2s;
}

.country-picker:has(.country-dropdown-open) .country-chevron {
  transform: rotate(180deg);
}

.phone-row .country-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  min-width: 12rem;
  max-height: 12rem;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 50;
  display: none;
}

.phone-row .country-dropdown.country-dropdown-open {
  display: block;
}

.phone-row .country-option {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

.phone-row .country-option:hover {
  background: var(--muted);
}

.phone-row .mobile-input {
  flex: 1;
}

/* 验证码行 */
.captcha-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

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

.captcha-img-wrap {
  flex-shrink: 0;
  width: 7rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--muted);
}

.captcha-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.send-code-row {
  display: flex;
  gap: 0.5rem;
}

.send-code-row .code-input {
  flex: 1;
}

.btn-send-code {
  flex-shrink: 0;
  padding: 0 1rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

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

/* 错误提示 */
.auth-error {
  font-size: 0.8125rem;
  color: var(--destructive);
  margin-top: 0.5rem;
  min-height: 1.25rem;
}

/* 主按钮 */
.auth-submit {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* 分割线 */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  padding: 0 1rem;
}

/* Google 登录按钮 */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  width: 100%;
  padding: 0 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: #333;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-google:hover {
  background: #fff;
  border-color: var(--muted-foreground);
}

.btn-google.btn-block { width: 100%; }

.google-icon {
  font-weight: 700;
  font-size: 1.1rem;
}

/* 底部链接 */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

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