/* ============================================================
   login.css - Talk2All 登录页样式（PC + 手机端适配）
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  font-family:
    -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ===== 页面背景：模糊自然风景 ===== */
.login-page {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: url("../assets/images/bg_pc.png") no-repeat center center / cover;
  overflow: hidden;
}

/* ===== 左上角 Logo ===== */
.login-logo {
  position: absolute;
  top: 2vh;
  left: 2.5vw;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
}
.login-logo img {
  display: block;
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.18));
}
.login-logo .logo-name {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

/* ===== 右侧登录卡片（毛玻璃） ===== */
.login-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8vw;
  z-index: 2;
}
.login-card {
  width: 400px;
  padding: 40px 36px 32px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 18px 48px rgba(30, 90, 160, 0.18);
}

/* 标题 + 注册引导 */
.login-card h1 {
  font-size: 30px;
  font-weight: 700;
  color: #333;
  text-align: left;
}
.login-reg {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 10px 0 22px;
  font-size: 14px;
  color: #666;
}
.login-reg .link {
  color: #4080ff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.login-reg .link:hover {
  text-decoration: underline;
}
.login-reg .link .arrow {
  font-size: 13px;
  line-height: 1;
}

/* ===== 登录方式标签栏 ===== */
.login-tabs {
  display: flex;
  height: 36px;
  padding: 3px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: #f5f7fa;
}
.login-tabs .tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #666;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s;
  user-select: none;
}
.login-tabs .tab.active {
  background: #fff;
  color: #333;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ===== 登录表单（form 仅作配对语义，不改变布局） ===== */
.login-form {
  display: block;
}

/* 视觉隐藏但可被屏幕阅读器识别的 label */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== 输入框 ===== */
.field {
  margin-bottom: 16px;
}
.field-input {
  position: relative;
  display: flex;
  align-items: center;
}
.field-input input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  padding-right: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: #333;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.field-input input::placeholder {
  color: #999;
}
.field-input input:focus {
  border-color: #4080ff;
  box-shadow: 0 0 0 3px rgba(64, 128, 255, 0.12);
}

/* ===== 图形验证码输入框 + 图片 ===== */
.field-input.has-captcha {
  gap: 8px;
}
.field-input.has-captcha input {
  flex: 1;
  padding-right: 12px;
}
.captcha-img {
  flex: 0 0 110px;
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  object-fit: cover;
  background: #f5f7fa;
  transition: opacity 0.2s, border-color 0.2s;
}
.captcha-img:hover {
  border-color: #4080ff;
}
/* 密码可见切换图标 */
.field-input .eye-btn {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #999;
}
.field-input .eye-btn:hover {
  color: #666;
}
.field-input .eye-btn img {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}
.eye-btn:hover img {
  opacity: 0.65;
}
/* 获取验证码按钮（手机登录/注册时显示在输入框右侧） */
.field-input .code-btn {
  position: absolute;
  right: 8px;
  height: 30px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: rgba(64, 128, 255, 0.1);
  color: #4080ff;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.field-input .code-btn:hover {
  background: rgba(64, 128, 255, 0.18);
}
.field-input .code-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
/* 带验证码按钮的输入框：留出按钮空间，眼睛图标左移避让 */
.field-input.has-code-btn input {
  padding-right: 104px;
}
.field-input.has-code-btn .eye-btn {
  right: 96px;
}

/* ===== 用户协议行（注册页） ===== */
.protocol-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin: 4px 0 18px;
  font-size: 13px;
  color: #666;
}
.protocol-row .remember-me {
  margin: 0;
  font-size: 13px;
}
.protocol-link {
  color: #4080ff;
  cursor: pointer;
  text-decoration: none;
}
.protocol-link:hover {
  text-decoration: underline;
}

/* ===== 辅助选项行：记住账号 / 忘记密码 ===== */
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 20px;
  font-size: 14px;
}
.remember-me {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
  cursor: pointer;
  user-select: none;
}
.remember-me input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #4080ff;
  cursor: pointer;
}
.forget-link {
  color: #4080ff;
  cursor: pointer;
}
.forget-link:hover {
  text-decoration: underline;
}

/* ===== 登录按钮 ===== */
.login-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 8px;
  background: #4080ff;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 6px;
  text-indent: 6px; /* 抵消字距，保证视觉居中 */
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s,
    box-shadow 0.2s,
    opacity 0.2s;
  box-shadow: 0 6px 16px rgba(64, 128, 255, 0.3);
}
.login-btn:hover {
  background: #3573f0;
}
.login-btn:active {
  transform: scale(0.985);
}
.login-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.login-btn.loading {
  opacity: 0.75;
  cursor: wait;
}

/* ===== 第三方登录 ===== */
.third-login {
  margin-top: 26px;
}
.third-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #999;
  font-size: 12px;
}
.third-divider::before,
.third-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}
.third-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
}
.third-icons .icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s;
}
.third-icons .icon-btn:hover {
  background: rgba(64, 128, 255, 0.08);
  transform: translateY(-2px);
}
.third-icons .icon-btn img {
  width: 26px;
  height: 26px;
  display: block;
  pointer-events: none;
}

/* Toast 轻提示样式已抽到 css/toast.css，各页面共用 */

/* ============================================================
   手机端适配（≤768px）
   ============================================================ */
@media (max-width: 768px) {
  .login-slogan {
    display: none;
  } /* 手机端隐藏左侧 Slogan */
  .login-logo {
    top: 16px;
    left: 16px;
  }
  .login-logo img {
    width: 24px;
    height: 24px;
  }
  .login-logo .logo-name {
    font-size: 20px;
  }
  .login-wrap {
    justify-content: center;
    padding-right: 0;
    padding: 0 16px;
  }
  .login-card {
    width: 100%;
    max-width: 400px;
    padding: 32px 24px 26px;
  }
  .login-card h1 {
    font-size: 26px;
  }
  .login-slogan .slogan-line1 {
    font-size: 34px;
  }
  .login-slogan .slogan-line2 {
    font-size: 24px;
  }
}

/* ============================================================
   注册弹窗（居中，宽 800px：左品牌区 + 右注册表单）
   ============================================================ */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 32, 60, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.modal-mask.open {
  opacity: 1;
  visibility: visible;
}
.modal-box {
  position: relative;
  display: flex;
  width: 800px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(10, 30, 60, 0.28);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s;
}
.modal-mask.open .modal-box {
  transform: none;
}

/* 关闭按钮 */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #999;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #333;
}

/* 左侧品牌区 */
.modal-brand {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 36px;
  background: linear-gradient(160deg, #4a90ff 0%, #2b62c8 100%);
  border-radius: 16px 0 0 16px;
  color: #fff;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 600;
}
.brand-logo img {
  display: block;
  width: 26px;
  height: 26px;
}
.brand-slogan {
  margin-top: 28px;
  font-weight: 700;
  line-height: 1.35;
}
.brand-slogan .brand-line1 {
  font-size: 32px;
}
.brand-slogan .brand-line2 {
  font-size: 32px;
  margin-top: 4px;
}
.brand-desc {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}

/* 右侧注册表单区 */
.modal-form {
  flex: 1;
  min-width: 0;
  padding: 36px 40px 32px;
}
.modal-form h2 {
  font-size: 24px;
  font-weight: 700;
  color: #333;
}
.modal-form .login-tabs {
  margin: 14px 0 18px;
}

/* ===== 手机端适配（≤768px）：弹窗变全宽，隐藏品牌区 ===== */
@media (max-width: 768px) {
  .modal-mask {
    padding: 12px;
  }
  .modal-box {
    width: 100%;
    max-height: calc(100vh - 24px);
  }
  .modal-brand {
    display: none;
  }
  .modal-form {
    padding: 28px 20px 24px;
  }
  .modal-form h2 {
    font-size: 22px;
  }
}
