/* 认证页独立样式（登录 / 注册 / 忘记密码），不依赖 styles.css */

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1f2937;
  background: #f5f5f5;
  -webkit-font-smoothing: antialiased;
}

.signin {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 28px 32px 32px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.auth-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: -8px 0 8px -8px;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
  transition: background 0.15s ease;
}

.auth-back:hover {
  background: #f3f4f6;
}

.signin-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  text-decoration: none;
  color: inherit;
}

.signin-logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.signin-logo-icon svg {
  width: 22px;
  height: 22px;
}

.signin-logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-title {
  margin: 0 0 24px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  padding: 0 8px;
}

.auth-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 56px;
  font-size: 12px;
  color: #9ca3af;
}

.auth-step-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d1d5db;
}

.auth-step-icon svg {
  width: 22px;
  height: 22px;
}

.auth-step.is-active {
  color: #10b981;
}

.auth-step.is-active .auth-step-icon {
  color: #10b981;
}

.auth-step.is-done {
  color: #10b981;
}

.auth-step.is-done .auth-step-icon {
  color: #10b981;
}

.auth-step-line {
  flex: 1;
  height: 2px;
  min-width: 24px;
  max-width: 48px;
  margin: 0 4px;
  margin-bottom: 20px;
  background: #e5e7eb;
}

.auth-step-line.is-done {
  background: #10b981;
}

.signin-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  font-size: 13px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
}

.signin-error[hidden],
.signin-ok[hidden] {
  display: none;
}

.signin-ok {
  margin-bottom: 14px;
  padding: 10px 12px;
  font-size: 13px;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
}

.signin-field {
  display: flex;
  align-items: center;
  height: 48px;
  margin-bottom: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.signin-field:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.signin-field-icon {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.signin-field-icon svg {
  width: 20px;
  height: 20px;
}

.signin-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px 0 0;
  border: none;
  background: transparent;
  font-size: 15px;
  color: #1f2937;
  outline: none;
}

.signin-field input::placeholder {
  color: #9ca3af;
}

.signin-field-toggle {
  flex-shrink: 0;
  margin-right: 8px;
  padding: 6px;
  border: none;
  background: none;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.signin-field-toggle:hover {
  color: #6b7280;
}

.signin-field-toggle svg {
  width: 20px;
  height: 20px;
}

.signin-field-extra {
  flex-shrink: 0;
  margin-right: 10px;
  padding: 0 8px;
  border: none;
  background: none;
  font-size: 13px;
  color: #10b981;
  cursor: pointer;
  white-space: nowrap;
}

.signin-field-extra:disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

/* 发送验证码：默认可点（透明绿），冷却中灰色不可点 */
.signin-send-code {
  border: 1px solid rgba(16, 185, 129, 0.5) !important;
  background: rgba(16, 185, 129, 0.1) !important;
  color: #10b981 !important;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.signin-send-code:hover:not(:disabled):not(.is-waiting) {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: #10b981 !important;
}

.signin-send-code.is-waiting,
.signin-send-code:disabled.is-waiting {
  border: 1px solid #e5e7eb !important;
  background: #f3f4f6 !important;
  color: #9ca3af !important;
  cursor: not-allowed !important;
}

.signin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 20px;
  font-size: 14px;
  color: #6b7280;
}

.signin-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.signin-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #10b981;
  cursor: pointer;
}

.signin-link {
  color: #10b981;
  text-decoration: none;
  font-weight: 500;
}

.signin-link:hover {
  text-decoration: underline;
}

.signin-submit {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 8px;
  background: #10b981;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.signin-submit:hover:not(:disabled) {
  background: #059669;
}

.signin-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.signin-foot {
  margin: 22px 0 0;
  text-align: right;
  font-size: 14px;
  color: #374151;
}

.signin-hint {
  margin: -6px 0 12px;
  font-size: 12px;
  color: #6b7280;
}

.signin-hint.is-error {
  color: #b91c1c;
}

.auth-panel[hidden] {
  display: none !important;
}

.signin-captcha-q {
  flex-shrink: 0;
  padding: 0 12px;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  white-space: nowrap;
  border-right: 1px solid #e5e7eb;
}

.signin-captcha-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px 0 0;
  border: none;
  background: transparent;
  font-size: 15px;
  color: #1f2937;
  outline: none;
}

.signin-captcha-field input::placeholder {
  color: #9ca3af;
}

.signin-code-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.signin-code-row .signin-field {
  flex: 1;
  margin-bottom: 0;
}

.signin-code-btn {
  flex-shrink: 0;
  height: 48px;
  min-width: 108px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 22px 20px 26px;
  }

  .auth-steps {
    padding: 0;
  }

  .auth-step-line {
    min-width: 16px;
  }
}
