/* ===================== 基础重置 & 字体 ===================== */
* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
}

body {
  margin: 0;
  background: var(--theme-bg);
  min-height: 100vh;
  color: var(--theme-text);
}

/* ================= 页面整体 & 背景 ================= */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;

  background-image:
    linear-gradient(
      rgba(5, 10, 25, 0.45),  /* 👈 关键：降低遮罩 */
      rgba(5, 10, 25, 0.65)
    ),
    url('/user/assets/img/denglu.jpg');

  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}


/* ================= 卡片（登录 / 注册） - 玻璃透明 ================= */
/* 覆盖登录与注册的各种可能类名，保证两个页面都生效 */
.login-card,
.register-card,
.auth-card,
.card {
  width: 340px;
  padding: 28px;
  border-radius: 16px;

  /* 卡片透明与虚化（你要的是卡片透明） */
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  /* 细边框和投影增加层次 */
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

/* 如果你的页面里有强背景规则，本段使用 !important 提升优先级（谨慎） */
.login-card.force-glass,
.register-card.force-glass,
.auth-card.force-glass {
  background: rgba(2, 6, 23, 0.55) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
}

/* ================= 标题 ================= */

.title {
  text-align: center;
  margin-bottom: 6px;
  font-weight: 700;
}

.subtitle {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.6);
  margin-bottom: 20px;
}

/* ================= Tabs（高亮修正版） ================= */

.login-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.login-tabs .tab {
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.65);
  transition: all .2s ease;
}

/* 只有 active 才白底高亮 */
.login-tabs .tab.active {
  background: rgba(255,255,255,.95);
  color: #000;
  font-weight: 600;
}

.login-tabs .tab:not(.active):hover {
  background: rgba(255,255,255,.16);
}

/* ================= 输入框 - 统一视觉与高度 ================= */
/*
  关键点：
  - .input-group 负责整行高度与内边距
  - phone-group 不直接用固定高度，而是继承 input-group 的 padding (从而与邮箱一致)
*/

.input-group {
  background: rgba(255,255,255,.03);   /* 轻微玻璃感 */
  border-radius: 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  padding: 12px;                        /* 这是统一高度/内边距的来源 */
  border: 1px solid rgba(255,255,255,0.04);
  transition: background .18s ease, box-shadow .18s ease, border-color .18s ease;
}

/* 内部文本输入样式（保留透明背景） */
.input-group input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  width: 100%;
  font-size: 15px;
  line-height: 1;
}

/* 聚焦时整块高亮 */
.input-group:focus-within {
  background: rgba(255,255,255,.04);
  border-color: rgba(16,185,129,0.95); /* 绿色边 */
  box-shadow: 0 6px 20px rgba(16,185,129,0.06);
}

/* 占位文字颜色 */
.input-group input::placeholder {
  color: rgba(255,255,255,0.54);
}
.input-group:focus-within input::placeholder {
  color: rgba(255,255,255,0.42);
}

/* ================= 手机号区号 - 与邮箱输入整行保持一致 ================= */
/* 重要：不要用固定高度（40px），而用 align-self: stretch，使其撑满 input-group 的高度 */

.input-group.phone-group {
  /* 与普通 input-group 完全一致，使两行高度一致 */
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 区号容器（左侧） */
.phone-prefix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-right: 1px solid rgba(255,255,255,.12);
  cursor: pointer;
  user-select: none;

  /* 关键：由 input-group 控制高度（stretch）而不是固定高度 */
  align-self: stretch;
  height: auto;          /* 防止旧规则强制 40px */
  box-sizing: border-box;
}

/* 区号文字 */
.phone-prefix span {
  font-size: 14px;
}

/* 箭头（三角形） - 强制覆盖旧规则，确保垂直居中 */
.phone-prefix .arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(255,255,255,.95);
  display: inline-block;
  transform: translateY(1px);
  margin-left: 6px;
}

/* 手机号输入框占满剩余空间并与邮箱输入样式一致 */
.phone-group input {
  flex: 1;
  height: auto;         /* 由 padding 控制视觉高度 */
  background: transparent;
  border: none;
  outline: none;
  padding: 0 12px;      /* 内部横向留白，垂直空间由父容器 padding 提供 */
  font-size: 15px;
  color: #fff;
  box-sizing: border-box;
}

/* 保持邮箱 input 的视觉一致（如果单独存在 .email-group） */
.email-group input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  width: 100%;
  font-size: 15px;
  padding: 0 12px;
  box-sizing: border-box;
}

/* ================= 按钮 ================= */

.login-btn {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #10b981;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s ease;
}

.login-btn:hover {
  background: #059669;
}

/* ================= 底部链接 ================= */

.login-links {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
}

.login-links a {
  font-size: 13px;
  color: #60a5fa;
  text-decoration: none;
}

.login-links a:hover {
  text-decoration: underline;
}

/* ================= 国家区号弹层 ================= */

.country-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  align-items: flex-end;
  z-index: 999;
}

.country-modal.show {
  display: flex;
}

.country-panel {
  width: 100%;
  background: #020617;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.country-panel h3 {
  margin: 0 0 12px;
}
.country-panel input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,.08);
  color: #fff;
  margin-bottom: 14px;
}

.country-item {
  padding: 12px 6px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08);
  cursor: pointer;
}

.country-item:hover {
  background: rgba(255,255,255,.06);
}

/* ================= 错误态 ================= */

.login-error {
  margin-top: 8px;
  font-size: 13px;
  color: #ff4d4f;
  line-height: 1.4;
  display: none;
}

.input-error {
  border: 1px solid #ff4d4f !important;
  box-shadow: 0 0 0 1px rgba(255, 77, 79, 0.25);
}

.input-error::placeholder {
  color: rgba(255, 77, 79, 0.6);
}

/* ================= 响应式微调 ================= */

@media (max-width: 480px) {
  .login-card,
  .register-card,
  .auth-card,
  .card {
    width: calc(100% - 40px);
    padding: 18px;
    border-radius: 12px;
  }

  .input-group,
  .input-group.phone-group {
    padding: 10px;
  }

  .phone-prefix {
    padding: 0 10px;
  }

  .login-btn {
    padding: 10px;
  }
}

/* ================= 兼容旧样式的强制覆盖（如果页面有更高优先级样式） */
/* 这部分仅在前面所有修改未生效时才会介入（谨慎） */
.login-card.override,
.register-card.override,
.auth-card.override {
  background: rgba(2, 6, 23, 0.55) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
}




/* ================= Toast 提示（登录 / 注册通用） ================= */

.toast {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 80%;
  padding: 12px 18px;
  border-radius: 999px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
  z-index: 9999;

  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: rgba(16,185,129,0.9);
}

.toast.error {
  background: rgba(239,68,68,0.9);
}
