/*
 * LinsGeek ERP —— 登录 / 注册页改版（配合 63-auth-pages.js）
 * 所有规则都挂在 body.lg-auth-on 下面：脚本把左侧内容和表单标题加上之后才生效。
 * 电脑端（>= 1024px）：左半边吉祥物 + 卖点，右半边白底表单。
 * 手机 / 平板（< 1024px）：排版仍由 43-login.css 负责，这里只给表单标题加样式。
 * 只改外观，不改表单结构、按钮逻辑和接口。
 * 回滚：删除 63-auth-pages.css + 63-auth-pages.js。
 */

/* ---------- 防闪：脚本还没换好之前，先不显示原版登录页 ----------
 * 主程序先画原版页面，63-auth-pages.js 随后才加 lg-auth-on，中间那一下会闪出旧插画。
 * 这里在加上 lg-auth-on 之前把两半都设成透明；万一脚本没跑，2 秒后动画照样把页面显示出来。 */
body:not(.lg-auth-on) #app .loginLeftImg,
body:not(.lg-auth-on) #app .loginLeftImg ~ div {
  opacity: 0;
  animation: lg-auth-fallback 0s linear 2s forwards;
}
@keyframes lg-auth-fallback {
  to { opacity: 1; }
}

/* ---------- 表单标题（追加在卡片末尾，用 order 排到最上面） ---------- */
body.lg-auth-on #app .registeY {
  display: flex;
  flex-direction: column;
}
body.lg-auth-on #app .registeY > .lg-auth-head {
  order: -1;
  margin: 0 0 22px;
  text-align: left;
}
body.lg-auth-on #app .lg-auth-head h1 {
  margin: 0;
  color: #1d1d1f;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}
body.lg-auth-on #app .lg-auth-head p {
  margin: 8px 0 0;
  color: #6e6e73;
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- 输入框、按钮（全宽度通用） ---------- */
body.lg-auth-on #app .loginLeftImg ~ div .el-input__wrapper {
  min-height: 46px;
  border-radius: 12px;
  box-shadow: 0 0 0 1px #d8dde2 inset;
  transition: box-shadow 0.2s ease;
}
body.lg-auth-on #app .loginLeftImg ~ div .el-input__wrapper:hover {
  box-shadow: 0 0 0 1px #9fb3ae inset;
}
body.lg-auth-on #app .loginLeftImg ~ div .el-input__wrapper.is-focus {
  box-shadow: 0 0 0 1.5px #0d7b6d inset, 0 0 0 4px rgba(24, 189, 168, 0.14);
}
body.lg-auth-on #app .loginLeftImg ~ div .el-input-group__prepend {
  border-radius: 12px 0 0 12px;
  box-shadow: 0 0 0 1px #d8dde2 inset;
  background: #f5f5f7;
}
body.lg-auth-on #app .loginLeftImg ~ div .el-input-group--prepend > .el-input__wrapper {
  border-radius: 0 12px 12px 0;
}
body.lg-auth-on #app .loginLeftImg ~ div .el-form-item {
  margin-bottom: 16px;
}
/* 区号选择器在输入框前缀里：不要再套一层边框 */
body.lg-auth-on #app .loginLeftImg ~ div .el-input-group__prepend .el-input__wrapper,
body.lg-auth-on #app .loginLeftImg ~ div .el-input-group__prepend .el-select__wrapper {
  min-height: 0;
  background: transparent !important;
  box-shadow: none !important;
}
/* 图形验证码：输入框和图片始终在同一行 */
body.lg-auth-on #app .loginLeftImg ~ div .el-form-item__content:has(> .registeW3) {
  flex-wrap: nowrap !important;
}
body.lg-auth-on #app .loginLeftImg ~ div .el-form-item__content:has(> .registeW3) > .el-input {
  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 0 !important;
}
body.lg-auth-on #app .loginLeftImg ~ div .el-form-item__content > .registeW3 {
  flex: 0 0 120px;
  margin-top: 0 !important;
}
/* 人机验证区：原来固定 80px 高，验证框会压到下面的按钮 */
body.lg-auth-on #app .registeY form > div.my-main {
  height: auto !important;
  margin-bottom: 18px;
}
body.lg-auth-on #app .registeY form > div.my-main > h1 {
  margin-bottom: 6px;
  color: #6e6e73;
  font-size: 13px;
}
/* 图形验证码 */
body.lg-auth-on #app .loginLeftImg ~ div .registeW3 {
  height: 46px !important;
  overflow: hidden;
  border-color: #d8dde2 !important;
  border-radius: 12px !important;
}
/* 「发送验证码」 */
body.lg-auth-on #app .loginLeftImg ~ div .el-form-item__content:has(> .el-input) > .el-button {
  height: 46px !important;
  border-radius: 12px !important;
  background: #0d7b6d !important;
  font-weight: 600;
}
body.lg-auth-on #app .loginLeftImg ~ div .el-form-item__content:has(> .el-input) > .el-button.is-disabled {
  opacity: 0.55;
}

@media (min-width: 1024px) {
  /* ---------- 左半边：吉祥物 + 卖点 ---------- */
  body.lg-auth-on #app .loginLeftImg > .bg-center {
    display: none !important;
  }
  body.lg-auth-on #app .loginLeftImg {
    position: relative;
    overflow: hidden;
    background:
      radial-gradient(ellipse 70% 46% at 50% 34%, rgba(24, 189, 168, 0.22), transparent 70%),
      linear-gradient(165deg, #e8f7f4 0%, #f5f5f7 62%, #ffffff 100%) !important;
    padding: 48px;
    box-sizing: border-box;
  }
  body.lg-auth-on #app .lg-auth-side {
    width: min(460px, 100%);
    text-align: center;
  }
  body.lg-auth-on #app .lg-auth-mascot {
    display: block;
    width: auto;
    height: clamp(220px, 34vh, 340px);
    margin: 0 auto 28px;
    filter: drop-shadow(0 22px 26px rgba(13, 60, 54, 0.18));
    pointer-events: none;
    user-select: none;
  }
  body.lg-auth-on #app .lg-auth-title {
    margin: 0;
    color: #1d1d1f;
    font-size: clamp(26px, 2.5vw, 36px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.025em;
  }
  body.lg-auth-on #app .lg-auth-desc {
    margin: 14px 0 0;
    color: #6e6e73;
    font-size: 17px;
    line-height: 1.5;
  }
  body.lg-auth-on #app .lg-auth-points {
    display: inline-flex;
    flex-direction: column;
    gap: 10px;
    margin: 26px 0 0;
    padding: 0;
    color: #1d1d1f;
    font-size: 16px;
    list-style: none;
    text-align: left;
  }
  body.lg-auth-on #app .lg-auth-points li {
    display: flex;
    align-items: center;
    gap: 9px;
  }
  body.lg-auth-on #app .lg-auth-points svg {
    flex-shrink: 0;
    color: #18bda8;
  }
  body.lg-auth-on #app .lg-auth-offer {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 28px 0 0;
    border-radius: 999px;
    background: #fff6dd;
    padding: 9px 18px 9px 14px;
    color: #7a5200;
    font-size: 15px;
    font-weight: 600;
  }
  body.lg-auth-on #app .lg-auth-offer svg {
    flex-shrink: 0;
    color: #ffb400;
  }

  /* ---------- 右半边：表单 ---------- */
  body.lg-auth-on #app .loginLeftImg ~ div {
    background: #ffffff !important;
    padding: 72px 24px 16px;
    box-sizing: border-box;
  }
  /* 语言切换固定在右上角 */
  body.lg-auth-on #app .loginLeftImg ~ div > .loginRight {
    position: absolute;
    top: 22px;
    right: 28px;
    width: auto !important;
    padding: 0 !important;
  }
  body.lg-auth-on #app .loginLeftImg ~ div > .loginRight .iconfont {
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #6e6e73;
    font-size: 22px !important;
    transition: background 0.2s ease;
  }
  body.lg-auth-on #app .loginLeftImg ~ div > .loginRight .iconfont:hover {
    background: #f0f2f1;
  }
  /* LOGO：缩小，标语已经放到左边 */
  body.lg-auth-on #app .loginLeftImg ~ div > .flex.flex-col.justify-center.items-center {
    align-items: flex-start !important;
    width: 440px;
    max-width: 100%;
    margin: 0 auto 30px !important;
  }
  body.lg-auth-on #app .loginLeftImg ~ div > .flex.flex-col.justify-center.items-center .icon-linsgeeklogo {
    font-size: 34px !important;
    line-height: 1.2;
  }
  body.lg-auth-on #app .loginLeftImg ~ div > .flex.flex-col.justify-center.items-center > div {
    display: none;
  }
  body.lg-auth-on #app .loginLeftImg ~ div > .flex.justify-center.items-center {
    margin-bottom: 36px !important;
  }

  /* 主按钮（登录 / 完成注册） */
  body.lg-auth-on #app .loginLeftImg ~ div .el-form-item__content:not(:has(.el-input)) > .el-button {
    height: 52px !important;
    border-radius: 999px !important;
    background: #0d7b6d !important;
    border-color: #0d7b6d !important;
    font-size: 17px;
    font-weight: 600;
    transition: background 0.2s ease;
  }
  body.lg-auth-on #app .loginLeftImg ~ div .el-form-item__content:not(:has(.el-input)) > .el-button:not(.is-disabled):hover {
    background: #0a6357 !important;
  }
  body.lg-auth-on #app .loginLeftImg ~ div .el-form-item__content:not(:has(.el-input)) > .el-button.is-disabled {
    opacity: 0.5;
  }
  body.lg-auth-on #app .loginLeftImg ~ div .el-form-item:has(.el-form-item__content:not(:has(.el-input)) > .el-button) {
    margin-bottom: 14px;
  }
  /* 登录页底部的「注册」入口 */
  body.lg-auth-on #app .registeY > .border-main {
    margin-top: 22px !important;
    padding: 13px 0 !important;
    border-radius: 999px;
    color: #0d7b6d;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
  }
  body.lg-auth-on #app .registeY > .border-main:hover {
    background: #e6f7f4;
  }
}

/* ---------- 手机 / 平板：标题居中，和 43-login.css 的卡片配合 ---------- */
@media (max-width: 1023px) {
  body.lg-auth-on #app .registeY > .lg-auth-head {
    margin-bottom: 18px;
    text-align: center;
  }
  body.lg-auth-on #app .lg-auth-head h1 {
    font-size: 22px;
  }
  body.lg-auth-on #app .lg-auth-head p {
    font-size: 14px;
  }
}
