/* ==========================================================================
   MYCHWAY 登录页样式 v2  ·  直接替换 catalog/view/static/css/login.css
   --------------------------------------------------------------------------
   约束：不改 HTML、不改 login.js。所有选择器与现有 DOM / JS 依赖保持一致
   （.box-tb .item.active / .get-code-btn.disabled / .login-input / .sign-in / .rows-p）。
   所有原页面元素保留：logo、tab 标题、邮箱、密码登录切换链接、验证码+Get Code、
   Sign In、订阅勾选、条款、OneAll 社交登录、右侧权益文案、版权。
   ========================================================================== */

/* ---------- 1. 基础重置（精简版，替代原文件的长 reset） ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

body, div, dl, dd, ul, ol, li, h1, h2, h3, h4, h5, h6,
p, form, fieldset, input, textarea, figure { margin: 0; padding: 0; }

ol, ul { list-style: none; }
fieldset, img { border: 0; display: block; }
a { text-decoration: none; }
button { background: none; border: none; font-family: inherit; }
button:focus { outline: none; }
table { border-collapse: collapse; border-spacing: 0; }

:root {
  --ink: #1b1522;
  --ink-2: #3d3646;
  --muted: #6e6779;
  --faint: #a29bad;
  --line: #e7e3ee;
  --line-soft: #efebf4;
  --brand: #660099;
  --brand-2: #7b2fbf;
  --brand-deep: #4d007a;
  --radius: 10px;
}

/* ---------- 2. 页面骨架：改成 flex 纵向流式布局 ---------- */
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 50% -160px, #f3e9fb 0%, rgba(247,245,250,0) 70%),
    #f5f4f7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 页面只有一个匿名 div 包裹层（用 first-child 限定，避免误伤其他直接子 div） */
body > div:first-child {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 3. 顶部 logo 条 ---------- */
header {
  flex: 0 0 auto;
  height: 76px;
  line-height: 1;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
}
header .login-img {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 76px;
}
header .login-img img,
header figure img {
  width: 148px;
  height: auto;
}

/* ---------- 4. 卡片容器 ---------- */
.login-bg {
  position: static;               /* 干掉原来的 absolute + top:140px */
  transform: none;
  width: min(920px, calc(100% - 48px));
  margin: auto;                   /* flex 子项 margin:auto 实现水平+垂直居中 */
  background: #fff;
  border: 1px solid #ece7f3;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 32px 72px -36px rgba(43, 7, 82, .28),
    0 2px 10px rgba(27, 21, 34, .03);
}

/* 49% / 41% 的三列 flex 改为 两列 grid，分隔线 .wire 退场 */
.login-pd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  justify-content: initial;
  height: auto;                   /* 原 570px 固定高，内容溢出被裁 */
  min-height: 0;
  padding: 0;
}

/* ---------- 5. 左侧表单列 ---------- */
.login-left {
  grid-column: 1;
  width: auto;
  min-height: 631px;              /* 与验证码表单等高，切换表单时卡片不跳动 */
  padding: 46px 54px 40px;
  display: flex;
  flex-direction: column;
}

/* 标题：原来的“细横线断在半截”改为整列宽度的分隔线 */
.login-tab ul {
  display: block;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 0 18px;
  margin: 0 0 0;
  justify-content: initial;
}
.login-tab ul li.on,
.login-tab ul li {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.02em;
  color: var(--ink);
  cursor: default;
}

/* JS 依赖：.item 默认隐藏 / .active 显示，必须保留 */
.box-tb { padding-top: 24px; }
.box-tb .item { display: none; }
.box-tb .item.active { display: block; font-size: 14px; }

/* ---------- 6. 表单字段 ---------- */
/* 原页面没有 label 文本，用 ::before 补齐（不改 DOM） */
#code-form .label-title::before,
#pwd-form .label-title::before {
  content: attr(data-label);
}
#pwd-form label[for="Password"]::before {
  content: attr(data-label);
}
#code-form .label-title::before,
#pwd-form .label-title::before,
#pwd-form label[for="Password"]::before {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink-2);
}

#code-form .label-title,
#pwd-form .label-title,
#pwd-form label[for="Password"] {
  display: block;
  margin-bottom: 14px;
}
#pwd-form label[for="Password"] { margin-bottom: 12px; }

.login-input {
  width: 100%;                    /* 原 94% + padding:3% 的补丁写法 */
  height: 52px;
  margin-bottom: 0;
  padding: 0 16px;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 52px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.login-input::placeholder { color: var(--faint); }
.login-input:hover { border-color: #d6cee3; }
.login-input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(123, 47, 191, .12);
}

/* “Password Sign In / Code Sign In” 切换链接 */
.login-switch-row {
  text-align: right;
  margin: -4px 0 16px;
}
.login-switch {
  display: inline-block;
  margin-top: 0;
  padding-bottom: 1px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease;
}
.login-switch:hover {
  color: var(--brand-deep);
  border-bottom-color: currentColor;
}

/* 验证码一行 */
.code-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.code-row .code-input {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}
.code-row .get-code-btn {
  flex: 0 0 auto;
  height: 52px;
  line-height: 50px;
  margin: 0;
  padding: 0 20px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .01em;
  /* 降级为次要按钮，让 Sign In 独占强调色 */
  color: #6b0fa8;
  background: #f7f2fe;
  border: 1px solid #dccbf2;
  border-radius: var(--radius);
  box-shadow: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.code-row .get-code-btn:hover {
  background: #f0e5fd;
  border-color: #c9a8ee;
  box-shadow: none;
}
.code-row .get-code-btn.disabled,
.code-row .get-code-btn.disabled:hover {
  color: var(--faint);
  background: #f4f2f7;
  border-color: var(--line);
  box-shadow: none;
  cursor: not-allowed;
}

/* 错误提示 / 成功提示（JS 往里写 html） */
.rows-p {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #d92d20;
}
.rows-p:empty { margin: 0; }
.success-lab {
  font-size: 12.5px;
  line-height: 1.5;
  color: #067647;
}
.success-lab:empty { display: none; }

/* ---------- 7. 主按钮 ---------- */
.sign-in {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  margin: 22px 0 18px;
  padding: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #8b32c9 0%, #660099 100%);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 12px 26px -12px rgba(102, 0, 153, .65);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.sign-in:hover {
  color: #fff;
  background: linear-gradient(135deg, #7b2fbf 0%, #5a0086 100%);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -12px rgba(102, 0, 153, .7);
}
.sign-in:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px -10px rgba(102, 0, 153, .6);
}
.sign-in img {                        /* JS 塞进来的 loading 图 */
  width: 20px;
  height: 20px;
  margin-left: 7px;
  display: inline-block;
}
.login-two .sign-in { margin: 26px 0 18px; }

/* ---------- 8. 订阅勾选 / 条款 ---------- */
.newsletter-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 14px;
}
.newsletter-row input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 3px 0 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.consent-p {
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--muted);
}
.consent-p a {
  font-size: 12.5px;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.consent-p a:hover { color: var(--brand-deep); }

/* 密码表单的 Forgot Password */
.login-two .password-p {
  text-align: right;
  margin: -2px 0 16px;
}
.login-two .password-p a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
}
.login-two .password-p a:hover {
  color: var(--brand-deep);
  text-decoration: underline;
}

/* ---------- 9. OneAll 社交登录 ---------- */
/* 保留 OneAll 原有的容器裁剪，隐藏 iframe 底部的服务标识。 */
div[id*="oneall_social_login"] {
  box-sizing: content-box;
  margin: 22px 0 0 !important;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}
div[id*="oneall_social_login"]::before {
  content: none;
  display: block;
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
div[id*="oneall_social_login"] iframe {
  display: block;
  width: 100% !important;
  max-width: 100%;
  border: 0;
}

/* 原 1px 竖线在双色分栏后多余 */
.wire { display: none; }

/* ---------- 10. 右侧品牌权益区 ---------- */
/* 配色集中在自定义属性里，body[data-mod] 可整体切换深浅，无需改结构 */
.login-right {
  --panel-bg: #faf9fc;
  --panel-ink: #2b1638;             /* 权益清单：最深一档 */
  --panel-body: #4c3b5c;            /* 说明文案 */
  --panel-eyebrow: #7b45b8;
  --panel-rule: rgba(102, 0, 153, .12);
  --panel-glow: rgba(147, 51, 234, .20);
  --panel-edge: inset 1px 0 0 rgba(102, 0, 153, .08);
  --panel-tag-bg: rgba(102, 0, 153, .08);
  --panel-card-bg: #fff;
  --panel-card-brd: #ece7f1;
  --panel-card-shadow: 0 8px 24px rgba(43, 7, 82, .04);

  grid-column: 2;
  position: relative;
  isolation: isolate;
  width: auto;
  padding: 54px 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;          /* 整组内容垂直居中，形成一块完整品牌信息区 */
  color: var(--panel-ink);
  background: var(--panel-bg);
  box-shadow: var(--panel-edge);
}

/* 变体一：中紫（比原版亮两档，仍保留白字） */
body[data-mod="mid"] .login-right {
  --panel-bg: linear-gradient(160deg, #6c1eb9 0%, #7f2ba8 52%, #9c3a78 100%);
  --panel-ink: #ffffff;
  --panel-body: rgba(255, 255, 255, .92);
  --panel-eyebrow: rgba(255, 255, 255, .8);
  --panel-rule: rgba(255, 255, 255, .24);
  --panel-glow: rgba(255, 255, 255, .26);
  --panel-edge: none;
  --panel-tag-bg: rgba(255, 255, 255, .16);
  --panel-card-bg: rgba(255, 255, 255, .1);
  --panel-card-brd: rgba(255, 255, 255, .2);
  --panel-card-shadow: none;
}

/* 变体二：原深紫（保留作为对照） */
body[data-mod="deep"] .login-right {
  --panel-bg: linear-gradient(158deg, #44097e 0%, #6512a6 54%, #8a1b7e 100%);
  --panel-ink: #ffffff;
  --panel-body: rgba(255, 255, 255, .9);
  --panel-eyebrow: rgba(255, 255, 255, .58);
  --panel-rule: rgba(255, 255, 255, .18);
  --panel-glow: rgba(255, 255, 255, .22);
  --panel-edge: none;
  --panel-tag-bg: rgba(255, 255, 255, .14);
  --panel-card-bg: rgba(255, 255, 255, .08);
  --panel-card-brd: rgba(255, 255, 255, .16);
  --panel-card-shadow: none;
}

/* 通过细线点缀品牌色，保持权益区背景干净。 */
.login-right::before {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  margin-bottom: 20px;
  border-radius: 3px;
  background: var(--brand);
}
.login-right p {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--panel-body);
}
.login-right .get-free {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  padding: 18px 20px;
  border: 1px solid var(--panel-card-brd);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: var(--panel-card-bg);
  box-shadow: var(--panel-card-shadow);
  font-size: 13px;
  line-height: 2.2;
  color: var(--panel-ink);
}

/* ---------- 11. 页脚 ---------- */
footer { flex: 0 0 auto; }
.copyright {
  position: static;
  transform: none;
  left: auto;
  bottom: auto;
  padding: 26px 20px 34px;
  font-size: 12px;
  line-height: 1.6;
  color: #918a9c;
  text-align: center;
}

/* ---------- 12. 响应式 ---------- */
@media screen and (max-width: 1100px) {
  .login-pd { grid-template-columns: minmax(0, 1fr) 320px; }
  .login-left { padding: 42px 40px 36px; }
  .login-right { padding: 44px 30px; }
}

@media screen and (max-width: 960px) {
  body { background: #f5f4f7; }
  header, header .login-img { height: 64px; }
  header .login-img img, header figure img { width: 130px; }

  .login-bg {
    width: calc(100% - 28px);
    margin: 20px auto 0;
    border-radius: 16px;
  }
  .login-pd { display: flex; flex-direction: column; }
  .login-left { order: 1; min-height: 0; padding: 28px 22px 26px; }
  .login-tab ul { padding-bottom: 14px; }
  .login-tab ul li.on { font-size: 22px; }

  /* 品牌区在移动端统一转为浅色卡尾，避免大块深色压屏（各变体都被压平） */
  .login-right {
    order: 2;
    padding: 24px 22px 28px;
    --panel-bg: #faf9fc;
    --panel-ink: #1b1522;
    --panel-body: #57505f;
    --panel-eyebrow: #8b7fa0;
    --panel-rule: var(--line-soft);
    --panel-edge: none;
    --panel-tag-bg: rgba(102, 0, 153, .07);
    --panel-card-bg: #ffffff;
    --panel-card-brd: var(--line-soft);
    --panel-card-shadow: 0 10px 24px -22px rgba(43, 7, 82, .4);
    border-top: 1px solid var(--line-soft);
  }
  .login-right::after { display: none; }
  .login-right::before { margin-bottom: 10px; }
  .login-right p { font-size: 13px; line-height: 1.75; }
  .login-right .get-free {
    margin-top: 16px;
    padding: 16px 18px;
    line-height: 2;
  }
  .copyright { padding: 18px 16px 26px; font-size: 11px; }
}

@media screen and (max-width: 420px) {
  .login-bg { width: calc(100% - 20px); }
  .login-left { padding: 24px 16px 22px; }
  .login-input,
  .code-row .get-code-btn { height: 48px; line-height: 46px; }
  .sign-in { height: 50px; font-size: 15px; }
  .code-row .get-code-btn { padding: 0 14px; font-size: 13px; }
}
