﻿/* ===== 前台登录/注册弹窗：唯一一套样式 ===== */
.home-login-dialog{
  --bs-modal-width: min(92vw, 440px);
}

/* 独立页面只补齐认证弹窗布局，避免引入 Bootstrap 的全局重置。 */
.home-auth-standalone :is(#home-login-modal, #home-register-modal){
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
  font-size: 16px;
  line-height: 1.5;
}

.home-auth-standalone .home-login-dialog{
  position: relative;
  display: flex;
  align-items: center;
  width: var(--bs-modal-width);
  max-width: calc(100vw - 28px);
  min-height: calc(100% - 56px);
  margin: 28px auto;
  pointer-events: none;
}

.home-auth-standalone .home-login-modal{
  position: relative;
  width: 100%;
  pointer-events: auto;
}

.home-auth-standalone .home-login-modal,
.home-auth-standalone .home-login-modal *{
  box-sizing: border-box;
}

.home-auth-standalone .home-login-modal .modal-body > div:first-child{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.home-auth-standalone .home-login-modal p{ margin: 0; }
.home-auth-standalone .home-login-modal .mb-2{ margin-bottom: 8px; }
.home-auth-standalone .home-login-modal .mb-3{ margin-bottom: 16px; }
.home-auth-standalone .home-login-modal .mt-3{ margin-top: 16px; }
.home-auth-standalone .home-login-modal .small{ font-size: 14px; }

.home-auth-standalone .home-login-modal .form-control{
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 8px 16px;
  font: inherit;
  outline: 0;
}

.home-auth-standalone .home-login-modal .input-group{ display: flex; }
.home-auth-standalone .home-login-modal .input-group > .form-control{ flex: 1; min-width: 0; }
.home-auth-standalone .home-login-modal .brand-mark img{ display: block; width: 100%; height: 100%; object-fit: contain; }
.home-auth-standalone .home-login-modal .prompt-box{ padding: 10px 12px; }
.home-auth-standalone .home-login-modal .home-auth-submit{ cursor: pointer; }

.home-auth-standalone > .modal-backdrop{
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: #000;
  opacity: 0.5;
}

/* 用 id 提权，压过全局 .modal-content 的 !important 规则 */
#home-login-modal .home-login-modal,
#home-register-modal .home-login-modal{
  border: 1px solid #e4ebf5 !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 24px 60px rgba(10, 35, 80, 0.18) !important;
  color: #1f2328;
  color-scheme: light;
  overflow: hidden;
}

.home-login-modal .modal-body{
  padding: 30px 34px 28px !important;
}

/* 品牌区 */
.home-login-modal .brand-lockup{
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.home-login-modal .brand-mark-large{
  width: 40px;
  height: 40px;
}

.home-login-modal .brand-wordmark{
  font-size: 20px;
  font-weight: 800;
  color: #063fb4;
  letter-spacing: 0.02em;
}

.home-login-modal .muted-text{
  color: #6b7a90;
}

/* 字段 */
.home-login-modal .field-label{
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #5b6b86;
}

.home-login-modal .form-control{
  border: 1px solid #d5deeb !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #172033 !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  caret-color: #1769e8;
}

.home-login-modal .form-control::placeholder{
  color: #98a5b8;
  opacity: 1;
}

.home-login-modal .form-control:hover{
  border-color: #aebed3 !important;
}

.home-login-modal .form-control:focus{
  border-color: #1769e8 !important;
  background: #ffffff !important;
  color: #172033 !important;
  box-shadow: 0 0 0 3px rgba(23, 105, 232, 0.14) !important;
}

.home-login-modal .form-control:-webkit-autofill,
.home-login-modal .form-control:-webkit-autofill:hover,
.home-login-modal .form-control:-webkit-autofill:focus{
  -webkit-text-fill-color: #172033 !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  caret-color: #1769e8;
}

/* 登录方式切换 */
.home-login-modal .home-auth-tabs{
  display: flex;
  width: 100%;
  margin-bottom: 16px;
  border: 1px solid #cbd7ea;
  border-radius: 10px;
  overflow: hidden;
}

.home-login-modal .home-auth-tab{
  flex: 1;
  padding: 9px 12px;
  border: 0;
  background: #ffffff;
  color: #50627d;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.home-login-modal .home-auth-tab + .home-auth-tab{
  border-left: 1px solid #cbd7ea;
}

.home-login-modal .home-auth-tab.active{
  background: #1769e8;
  color: #ffffff;
}

.home-login-modal .home-auth-tab:not(.active):hover{
  background: #f4f8ff;
  color: #1456bd;
}

/* 主按钮：保留品牌蓝紫渐变 */
.home-login-modal .home-auth-submit{
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 16px;
  border: 0;
  border-radius: 10px !important;
  background-image: var(--hx-workbench-ai-gradient, linear-gradient(110deg, #168bff 0%, #397cf4 45%, #7657dc 76%, #a855b8 100%));
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(57, 124, 244, 0.22);
  transition: filter 0.15s, box-shadow 0.15s;
}

.home-login-modal .home-auth-submit:hover{
  filter: brightness(1.05);
  box-shadow: 0 10px 26px rgba(57, 124, 244, 0.3);
}

.home-login-modal .home-auth-submit:active{
  filter: brightness(0.96);
}

.home-login-modal .home-auth-submit:disabled{
  opacity: 0.7;
  cursor: not-allowed;
}

/* 验证码按钮：登录与注册共用，保证可见度 */
.home-login-modal .input-group{
  gap: 8px;
}

.home-login-modal .input-group > .home-auth-code-btn{
  margin-left: 0;
}

.home-login-modal .home-auth-code-btn{
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid #cfe0ff;
  border-radius: 10px !important;
  background: #eef4ff;
  color: #1769e8;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.home-login-modal .home-auth-code-btn:hover{
  border-color: #a9c9ff;
  background: #e1edff;
  color: #0f55c4;
}

.home-login-modal .home-auth-code-btn:focus-visible{
  outline: 2px solid rgba(23, 105, 232, 0.35);
  outline-offset: 1px;
}

.home-login-modal .home-auth-code-btn:disabled{
  opacity: 0.6;
  cursor: not-allowed;
}

/* 状态提示与底部切换链接 */
.home-login-modal .prompt-box{
  border: 1px solid #e4ebf5;
  border-radius: 10px;
  background: #f6f8fc;
  color: #5b6b86;
}

.home-login-modal .home-auth-alt{
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  color: #5b6b86;
  font-size: 13px;
}

.home-login-modal .home-auth-alt a{
  color: #0b63ce;
  font-weight: 600;
  text-decoration: none;
}

.home-login-modal .home-auth-alt a:hover{
  text-decoration: underline;
}

@media (max-width: 575.98px){
  .home-login-dialog{
    --bs-modal-width: calc(100vw - 28px);
  }

  .home-login-modal .modal-body{
    padding: 24px 22px !important;
  }
}
