/* ================================================
   玄镜 - 认证页面样式（扣子风格）
   ================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #C70039;
  --color-primary-hover: #A3002F;
  --color-primary-light: #FDEFF3;
  --color-text-primary: #14161A;
  --color-text-secondary: #33384A;
  --color-text-tertiary: #656B77;
  --color-border: #E3E6EA;
  --color-border-light: #EFEFF3;
  --color-bg: #FFFFFF;
  --color-success: #00B42A;
  --color-danger: #F53F3F;
  --color-warning: #FF7D00;
}

body.auth-page {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* 容器 */
.auth-container {
  display: flex;
  width: 100%;
  max-width: 1080px;
  height: 640px;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
}

/* 左侧品牌区 */
.auth-brand {
  width: 42%;
  background: linear-gradient(160deg, #C70039 0%, #581845 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 360px;
  height: 360px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -60px;
  width: 240px;
  height: 240px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.brand-inner {
  position: relative;
  z-index: 1;
  padding: 44px 36px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.brand-logo {
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.brand-tagline {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 32px;
}

.brand-features {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.feature-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-text strong {
  font-size: 13px;
  font-weight: 600;
}

.feature-text span {
  font-size: 11px;
  opacity: 0.75;
}

.brand-footer {
  font-size: 12px;
  opacity: 0.6;
  margin-top: auto;
}

/* 右侧表单区 */
.auth-form-wrap {
  width: 58%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-form-inner {
  width: 100%;
  max-width: 360px;
}

.auth-header {
  margin-bottom: 32px;
}

.auth-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 13px;
  color: var(--color-text-tertiary);
}

/* 登录切换tab */
.auth-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border-light);
}

.auth-tabs .tab {
  padding: 10px 0;
  font-size: 14px;
  color: var(--color-text-tertiary);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.auth-tabs .tab.active {
  color: var(--color-primary);
  font-weight: 500;
}

.auth-tabs .tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}

/* 表单 */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

.input-wrapper.error {
  border-color: var(--color-danger);
}

.input-prefix {
  padding: 0 10px 0 14px;
  color: var(--color-text-secondary);
  font-size: 14px;
  border-right: 1px solid var(--color-border-light);
  height: 24px;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--color-text-primary);
  background: transparent;
  border-radius: 8px;
}

.input-wrapper input::placeholder {
  color: var(--color-text-tertiary);
}

.input-wrapper.with-suffix {
  padding-right: 0;
}

.btn-suffix {
  padding: 0 14px;
  height: 32px;
  margin-right: 6px;
  border: none;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}

.btn-suffix:hover {
  background: #D6E8FF;
}

.btn-suffix:disabled {
  color: var(--color-text-tertiary);
  background: var(--color-border-light);
  cursor: not-allowed;
}

.error-msg {
  font-size: 12px;
  color: var(--color-danger);
  min-height: 16px;
}

.debug-code-tip {
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 500;
}

.debug-code-tip span {
  font-family: monospace;
  letter-spacing: 2px;
  font-weight: 600;
}

/* 按钮 */
.btn-primary {
  width: 100%;
  height: 44px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-primary:disabled {
  background: #94BFFF;
  cursor: not-allowed;
}

.btn-primary.loading {
  position: relative;
  color: transparent;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 底部 */
.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}

.auth-footer .link {
  color: var(--color-primary);
  text-decoration: none;
  margin-left: 4px;
}

.auth-footer .link:hover {
  text-decoration: underline;
}

.agreement {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-top: 24px;
}

.link-small {
  color: var(--color-primary);
  text-decoration: none;
}

.link-small:hover {
  text-decoration: underline;
}

/* 响应式 */
@media (max-width: 768px) {
  .auth-container {
    flex-direction: column;
    height: auto;
    max-width: 420px;
  }

  .auth-brand {
    width: 100%;
    padding: 32px 24px;
  }

  .brand-inner {
    padding: 0;
  }

  .brand-title {
    font-size: 28px;
  }

  .brand-tagline {
    margin-bottom: 24px;
  }

  .brand-features {
    display: none;
  }

  .brand-footer {
    display: none;
  }

  .auth-form-wrap {
    width: 100%;
    padding: 32px 24px;
  }
}

/* ================================================
   邮箱链路补充（2026-10-22）：忘记密码 / 找回弹窗
   ================================================ */
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.forgot-link {
  font-size: 12px;
  color: var(--color-primary);
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* 找回密码弹窗 */
.reset-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.reset-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 26, 0.45);
}

.reset-modal-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--color-bg);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(20, 22, 26, 0.16);
  overflow: hidden;
  animation: reset-pop 0.18s ease-out;
}

@keyframes reset-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.reset-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--color-border-light);
}

.reset-modal-head h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.reset-close {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.reset-close:hover {
  color: var(--color-text-primary);
  background: var(--color-border-light);
}

.reset-modal-body {
  padding: 16px 20px 4px;
}

.reset-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 20px;
}

.btn-ghost {
  padding: 10px 18px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.reset-modal-foot .btn-primary {
  width: auto;
  padding: 10px 20px;
}

/* 小屏适配：弹窗贴顶 */
@media (max-width: 480px) {
  .reset-modal { align-items: flex-start; padding-top: 40px; }
}
