/*
 * 达迈佳自建登录页样式（fangce-brand 平台包）
 *
 * 只服务 /branding/login.html，不注入上游页面，因此不受上游 Tailwind / LD 样式影响，
 * 也不必像 brand.css 那样自我克制。零外部请求：字体只用系统字体栈，图片只引本包资源。
 *
 * 品牌要素与取值口径见本包 README 的「品牌要素」一节。
 */

/*
 * 作者样式里的 display 会盖掉 UA 的 [hidden]{display:none}。
 * 本页的页签切换靠 `elem.hidden = true` 控制显隐，
 * 而 `.dmj__form { display: flex }` 正好会把 hidden 顶掉。
 * 补这一条显式规则，用 !important 压过任何作者 display。
 */
[hidden] {
  display: none !important;
}

:root {
  --dmj-primary: #1076fb;
  --dmj-primary-strong: #0f6ff5;
  --dmj-primary-soft: #e8f1ff;
  --dmj-accent: #ffb020;
  --dmj-ink: #0b1b33;
  --dmj-body: #334155;
  --dmj-muted: #64748b;
  --dmj-line: #e2e8f0;
  --dmj-line-strong: #cbd5e1;
  --dmj-danger: #d92d20;
  --dmj-danger-soft: #fef3f2;
  --dmj-success: #067647;
  --dmj-success-soft: #ecfdf3;
  --dmj-navy: #071a33;
  --dmj-radius: 10px;
  --dmj-shadow: 0 10px 30px rgba(11, 27, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: #fff;
  color: var(--dmj-body);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/*
 * 左品牌区 + 右表单区。
 *
 * 关键：整页高度锁死在视口（100dvh 兼顾移动端地址栏伸缩），**不整页滚动**；
 * 内容超高时由右栏自己滚（.dmj__panel 的 overflow-y）。
 * 之前这里写的是 min-height:100vh，于是注册表单把整个栅格撑到视口之外，
 * 表现为「窗口一小，注册按钮就掉到屏幕外，得滚页面才看得到」。
 */
.dmj {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(400px, 1fr);
  grid-template-rows: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---------------------------------------------------------------- 左：品牌区 */

.dmj__hero {
  position: relative;
  display: flex;
  overflow: hidden;
  background: var(--dmj-navy);
  isolation: isolate;
}

/* 实拍大图铺满左栏。竖构图（1400×1867）与高瘦的左栏比例接近，裁切很少，
   background-position 取 50% 48% 让货架通道的灭点居中偏上。 */
.dmj__hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("/branding/login-hero.jpg");
  background-size: cover;
  background-position: 50% 48%;
  background-repeat: no-repeat;
}

/*
 * 遮罩分三层，目的是「照片看得见」与「白字读得清」同时成立：
 *  - 左下的标题/标签靠一层左下径向压边承托（局部重，向右上迅速散开）；
 *  - 左上角 Logo 靠顶部一条窄压边承托；
 *  - 其余地方只留一层品牌色薄纱，把照片统一到深蓝调、但不遮挡细节。
 */
.dmj__hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(115% 85% at 0% 100%, rgba(5, 18, 38, 0.92) 0%, rgba(5, 18, 38, 0.72) 34%, rgba(6, 22, 46, 0) 68%),
    linear-gradient(180deg, rgba(5, 18, 38, 0.62) 0%, rgba(5, 18, 38, 0) 22%),
    linear-gradient(150deg, rgba(7, 26, 51, 0.42) 0%, rgba(11, 52, 104, 0.22) 55%, rgba(16, 118, 251, 0.3) 100%);
}

.dmj__hero-inner {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-height: 0;
  padding: 40px 56px 56px;
  overflow: hidden;
}

.dmj__brand {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background-color 0.18s ease;
}

.dmj__brand:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dmj__brand img {
  display: block;
  height: 42px;
  width: auto;
}

.dmj__hero-copy {
  max-width: 30em;
  color: #fff;
}

.dmj__hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(26px, 2.4vw, 40px);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 12px rgba(7, 26, 51, 0.45);
}

.dmj__hero-sub {
  margin: 0 0 24px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.82);
}

.dmj__hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dmj__hero-tags li {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  backdrop-filter: blur(2px);
}

/* ---------------------------------------------------------------- 右：表单区 */

/*
 * align-items 必须是 flex-start 而不是 center：
 * flex 容器里 align-items:center 遇到「子项比容器高」时，溢出部分会平均分到上下两侧，
 * 而**上方那半截是滚不到的**（滚动只能往下）。改成 flex-start 让内容从顶部开始，
 * 再用子项的 margin:auto 做「有空间就居中、没空间就从头排」—— 两种情形都不会被裁。
 */
.dmj__panel {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 40px 40px;
  background: #fff;
}

.dmj__card {
  width: 100%;
  max-width: 400px;
  margin: auto 0;
}

.dmj__tabs {
  display: flex;
  gap: 28px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--dmj-line);
}

.dmj__tab {
  position: relative;
  padding: 0 2px 12px;
  border: 0;
  background: none;
  color: var(--dmj-muted);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease;
}

.dmj__tab:hover {
  color: var(--dmj-body);
}

.dmj__tab.is-active {
  color: var(--dmj-ink);
}

.dmj__tab.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--dmj-primary);
}

.dmj__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dmj__field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dmj__field > label {
  color: var(--dmj-ink);
  font-size: 13px;
  font-weight: 600;
}

.dmj__field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--dmj-line-strong);
  border-radius: var(--dmj-radius);
  background: #fff;
  color: var(--dmj-ink);
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.dmj__field input::placeholder {
  color: #9aa8bd;
}

.dmj__field input:hover {
  border-color: #a9bad0;
}

.dmj__field input:focus {
  border-color: var(--dmj-primary);
  box-shadow: 0 0 0 3px rgba(16, 118, 251, 0.14);
  outline: none;
}

.dmj__input-wrap {
  position: relative;
  display: flex;
}

.dmj__input-wrap input {
  padding-right: 58px;
}

.dmj__peek {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--dmj-muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.dmj__peek:hover {
  background: var(--dmj-primary-soft);
  color: var(--dmj-primary-strong);
}

/* 图形验证码：输入框 + 可点击刷新的图。图固定 132×44，与输入框等高 */
.dmj__captcha {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.dmj__captcha input {
  flex: 1;
  min-width: 0;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.dmj__captcha-img {
  width: 132px;
  height: 44px;
  flex: none;
  border: 1px solid var(--dmj-line);
  border-radius: var(--dmj-radius);
  background: var(--dmj-primary-soft);
  cursor: pointer;
  object-fit: cover;
  user-select: none;
}

.dmj__captcha-img:hover {
  border-color: var(--dmj-line-strong);
}

.dmj__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -4px;
}

.dmj__check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--dmj-muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.dmj__check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--dmj-primary);
  cursor: pointer;
}

.dmj__hint {
  color: var(--dmj-muted);
  font-size: 12px;
}

.dmj__submit {
  height: 46px;
  margin-top: 4px;
  border: 0;
  border-radius: var(--dmj-radius);
  background: var(--dmj-primary-strong);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: var(--dmj-shadow);
  transition: background-color 0.18s ease, transform 0.06s ease;
}

.dmj__submit:hover:not(:disabled) {
  background: #0b62dd;
}

.dmj__submit:active:not(:disabled) {
  transform: translateY(1px);
}

.dmj__submit:disabled {
  cursor: not-allowed;
  opacity: 0.66;
}

.dmj__alert {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  background: var(--dmj-danger-soft);
  color: var(--dmj-danger);
  font-size: 13px;
}

.dmj__alert.is-ok {
  border-color: #abefc6;
  background: var(--dmj-success-soft);
  color: var(--dmj-success);
}

.dmj__notice {
  margin: 0;
  color: var(--dmj-muted);
  font-size: 12px;
  line-height: 1.7;
}

.dmj__foot {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--dmj-line);
  color: var(--dmj-muted);
  font-size: 12px;
  text-align: center;
}

.dmj__foot a {
  color: var(--dmj-muted);
  text-decoration: none;
}

.dmj__foot a:hover {
  color: var(--dmj-primary-strong);
  text-decoration: underline;
}

/* ---------------------------------------------------------------- 响应式 */

/*
 * 窄屏：左栏压成一条品牌横幅，表单优先。
 * 行轨道要显式写成 auto + minmax(0,1fr)：让横幅只占内容高度，
 * 剩余空间全给表单区，表单区再自己滚；否则 1fr/1fr 会让横幅吃掉一半屏幕。
 */
@media (max-width: 900px) {
  .dmj {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .dmj__hero-inner {
    gap: 14px;
    padding: 18px 22px 20px;
  }

  .dmj__brand img {
    height: 30px;
  }

  .dmj__hero-copy h1 {
    font-size: 19px;
    margin-bottom: 6px;
  }

  .dmj__hero-sub,
  .dmj__hero-tags {
    display: none;
  }

  .dmj__hero-media {
    background-position: 50% 42%;
  }

  .dmj__panel {
    padding: 26px 22px 34px;
  }

  .dmj__card {
    max-width: 100%;
  }
}

/* 窗口特别矮（横屏手机、分屏）时收紧留白，先把表单塞进首屏 */
@media (max-height: 620px) and (min-width: 901px) {
  .dmj__panel {
    padding: 24px 40px;
  }

  .dmj__hero-inner {
    padding: 24px 40px 28px;
  }

  .dmj__hero-tags {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
