/* Auth Modal — 深色邮箱登录弹窗 */

.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.74);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-modal-overlay.open {
  display: flex;
}

/* 弹窗主体 */

.auth-modal-box {
  position: relative;
  width: 420px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #202020;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 23px;
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 24px 80px rgba(0, 0, 0, 0.72);
}

.auth-modal-overlay.auth-code-step .auth-modal-box {
  width: 520px;
}

/* 关闭按钮 */

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #777777;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.auth-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* 标题 */

.auth-heading {
  padding: 35px 32px 0;
  text-align: center;
}

.auth-heading-icon {
  display: none;
}

.auth-heading-title {
  overflow-wrap: anywhere;
  margin: 0 auto 7px;
  max-width: 460px;
  color: #f7f7f7;
  font-family: 'Geist', 'Noto Sans SC', sans-serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.45px;
  line-height: 1.22;
}

.auth-heading-sub,
.auth-heading-email {
  margin: 0;
  color: #a1a1a1;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
}

.auth-heading-email {
  overflow-wrap: anywhere;
  color: #f2f2f2;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
}

.auth-code-step .auth-heading {
  padding-top: 37px;
}

/* 全局错误提示（密码登录等旧流程使用） */

.auth-error {
  display: none;
  margin: 16px 32px 0;
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.auth-error.visible {
  display: block;
}

.auth-error.success {
  border-color: rgba(34, 197, 94, 0.2);
  background: rgba(34, 197, 94, 0.08);
  color: #4ade80;
}

/* 表单主体 */

.auth-body {
  padding: 20px 16px 25px;
}

.auth-code-step .auth-body {
  padding-right: 42px;
  padding-left: 42px;
}

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

.auth-label {
  margin-top: 14px;
  margin-bottom: 6px;
  color: #8a8a8a;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.auth-label:first-child {
  margin-top: 0;
}

/* 输入框 */

.auth-input {
  box-sizing: border-box;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  outline: none;
  background: #1b1b1b;
  color: #eeeeee;
  padding: 10px 16px;
  font-family: 'Geist', 'Noto Sans SC', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.auth-input::placeholder {
  color: #8b8b8b;
}

.auth-input:focus {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.auth-input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* Google、分隔线与主按钮 */

.auth-google-btn {
  display: flex;
  width: 100%;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 0;
  border: 0;
  border-radius: 9px;
  background: #3b3b3b;
  color: #f2f2f2;
  padding: 9px 14px;
  font-family: 'Geist', 'Noto Sans SC', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.auth-google-btn:hover:not(:disabled) {
  background: #464646;
  transform: translateY(-1px);
}

.auth-google-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.auth-provider-pending {
  margin-top: 16px;
  text-align: center;
  color: #b3b3b3;
  font-size: 13px;
  line-height: 1.5;
}

.auth-google-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    from -45deg,
    #4285f4 0deg 90deg,
    #34a853 90deg 180deg,
    #fbbc05 180deg 250deg,
    #ea4335 250deg 360deg
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-family: Geist, sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 18px 0 20px;
  color: #9a9a9a;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-submit {
  min-height: 41px;
  margin-top: 13px;
  border: 0;
  border-radius: 8px;
  background: #f7f7f7;
  color: #171717;
  padding: 10px 14px;
  font-family: 'Geist', 'Noto Sans SC', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-submit:hover:not(:disabled) {
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* 邮箱验证码第二步 */

.auth-email-row {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 10px;
  background: #292929;
  color: #a4a4a4;
  padding: 0 14px;
  font-size: 14px;
}

.auth-email-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-edit-email,
.auth-resend {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #f2f2f2;
  padding: 2px 0;
  font-family: 'Geist', 'Noto Sans SC', sans-serif;
  font-size: 13px;
  cursor: pointer;
}

.auth-edit-email:hover:not(:disabled),
.auth-resend:hover:not(:disabled) {
  color: #ffffff;
}

.auth-edit-email:disabled,
.auth-resend:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.auth-existing-code {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: center;
}

.auth-email-code-form > .auth-code-input {
  margin-top: 10px;
}

.auth-inline-error {
  margin-top: 7px;
  color: #f0717c;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.auth-email-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: #aaaaaa;
  font-size: 13px;
}

.auth-email-status-text {
  min-width: 0;
}

.auth-email-progress {
  position: relative;
  height: 3px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: #2e74e8;
}

.auth-email-progress::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 78%;
  border-radius: inherit;
  background: #4c8dff;
  content: '';
}

.auth-email-progress.success {
  width: 98px;
  background: #40d49a;
}

.auth-email-progress.success::after {
  display: none;
}

/* 旧密码/注册流程的验证码控件 */

.auth-code-row {
  display: flex;
  gap: 8px;
}

.auth-code-input {
  min-width: 0;
  flex: 1;
}

.auth-code-send {
  flex-shrink: 0;
  min-width: 108px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
  padding: 0 12px;
  font-family: 'Geist', 'Noto Sans SC', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.auth-code-send:hover:not(:disabled) {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.18);
}

.auth-code-send:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* 辅助入口与条款 */

.auth-terms {
  margin: 17px 0 0;
  color: #909090;
  font-size: 11px;
  line-height: 1.8;
  text-align: center;
}

.auth-terms-link {
  color: #a6a6a6;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-terms-link:hover {
  color: #f5f8ff;
}

.auth-mode-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.auth-secondary-links {
  justify-content: center;
  margin-top: 10px;
}

.auth-mode-link,
.auth-back-link {
  border: 0;
  background: transparent;
  color: #a0a0a0;
  padding: 0;
  font-family: 'Geist', 'Noto Sans SC', sans-serif;
  font-size: 12px;
  cursor: pointer;
}

.auth-mode-link:hover,
.auth-back-link:hover {
  color: #ffffff;
}

.auth-back-link {
  margin-top: 16px;
  text-align: center;
}

/* 密码登录备用标签 */

.auth-tabs {
  display: flex;
  margin: 16px 32px 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
}

.auth-tab {
  flex: 1;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #777777;
  padding: 8px 0;
  font-family: 'Geist', 'Noto Sans SC', sans-serif;
  font-size: 13px;
  cursor: pointer;
}

.auth-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: #eeeeee;
}

.auth-tab:hover:not(.active) {
  color: #b4b4b4;
}

.hidden {
  display: none !important;
}

/* 注册积分赠送提示 */

.signup-grant-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 7, 13, 0.78);
  backdrop-filter: blur(12px);
}

.signup-grant-card {
  position: relative;
  box-sizing: border-box;
  width: 241px;
  min-height: 306px;
  max-width: 100%;
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  flex: 0 1 241px;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  border: 1px solid #ffffff;
  border-radius: 24px;
  background:
    radial-gradient(115% 84% at 106% -6%, rgba(189, 195, 255, 0.9) 0%, rgba(226, 251, 251, 0) 64%),
    radial-gradient(145% 118% at -8% 102%, #ffffff 38%, rgba(224, 223, 251, 0) 72%),
    linear-gradient(145deg, #dbeaff 0%, #f7f8ff 48%, #eeebff 100%);
  color: #041a39;
  padding: 28px 24px 24px;
  transform: translate(-6.5px, 14px);
  box-shadow: 0 4px 50px rgba(102, 107, 198, 0.5);
}

.signup-grant-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #50586b;
  font-size: 18px;
  line-height: 26px;
  cursor: pointer;
}

.signup-grant-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
}

.signup-grant-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
  width: 100%;
  min-height: 24px;
  margin-bottom: 24px;
}

.signup-grant-badge {
  display: inline-flex;
  box-sizing: border-box;
  max-width: 193px;
  min-width: 0;
  min-height: 24px;
  align-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(136, 97, 203, 0.1);
  color: rgba(25, 11, 79, 0.8);
  padding: 6px 8px;
  font-family: 'Geist', 'PingFang SC', 'Noto Sans SC', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.signup-grant-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border: 0;
  background: url('../signup-grant-icon.svg?v=20260821a') center / contain no-repeat;
  color: transparent;
  font-size: 0;
}

.signup-grant-title {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 72px;
  margin: 0;
  overflow-wrap: anywhere;
  color: #041a39;
  font-family: 'Geist', 'PingFang SC', 'Noto Sans SC', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 36px;
}

.signup-grant-description {
  display: none;
}

.signup-grant-confirm {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  margin-top: 48px;
  padding: 14px 10px;
  flex: 0 0 auto;
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background:
    radial-gradient(ellipse 92px 18px at 0% 100%, rgba(139, 116, 209, 0.62), rgba(113, 161, 255, 0.32) 42%, transparent 76%),
    radial-gradient(ellipse 93px 16px at 100% 0%, rgba(0, 85, 255, 0.95), rgba(72, 133, 255, 0.54) 42%, transparent 76%),
    #050509;
  color: #ffffff;
  font-family: 'Geist', 'PingFang SC', 'Noto Sans SC', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
}

.signup-grant-confirm:hover,
.signup-grant-confirm:focus-visible {
  outline: none;
  background:
    radial-gradient(ellipse 92px 18px at 0% 100%, rgba(139, 116, 209, 0.72), rgba(113, 161, 255, 0.4) 42%, transparent 76%),
    radial-gradient(ellipse 93px 16px at 100% 0%, rgba(23, 100, 255, 1), rgba(87, 146, 255, 0.66) 42%, transparent 76%),
    #0a0a12;
}

@media (max-width: 560px) {
  .auth-modal-overlay {
    padding: 8px;
  }

  .auth-modal-box,
  .auth-modal-overlay.auth-code-step .auth-modal-box {
    width: 100%;
    border-radius: 20px;
  }

  .auth-heading,
  .auth-code-step .auth-heading {
    padding-top: 30px;
  }

  .auth-heading-title {
    font-size: 21px;
  }

  .auth-heading-email {
    font-size: 18px;
  }

  .auth-code-step .auth-body {
    padding-right: 16px;
    padding-left: 16px;
  }

  .signup-grant-overlay {
    padding: 14px;
  }
}
