/* 登录 / 注册页样式（支持 LTR / RTL，默认英文） */

:root {
  --ink: #22313f;
  --ink-2: #5d6d7e;
  --ink-3: #93a3b0;
  --line: #dfe6ec;
  --brand: #1a5276;
  --brand-2: #0e3a5c;
  --brand-3: #23648f;
  --ok: #1e8449;
  --err: #c0392b;
  --warn: #b7950b;
  --bg: #f4f7f9;
  --font: "Microsoft YaHei UI", "Segoe UI", Tahoma, Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

.auth-page {
  display: grid;
  grid-template-columns: 52% 48%;
  min-height: 100vh;
}

/* ================= 左侧：banner 铺满 ================= */
.brand-side {
  position: relative;
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 64px 58px;
  background: #0b304d;
}

/* 背景图：铺满整块 */
.brand-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("https://www.inbody-tech.com/api/media/file/banner.webp-1600x900.jpg")
              center / cover no-repeat;
  transform: scale(1.03);
}

/* 深蓝遮罩：保证文字可读，同时保留场景感 */
.brand-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(720px 420px at 18% 22%, rgba(26,96,140,.55), transparent 65%),
    linear-gradient(155deg,
      rgba(7,34,56,.93) 0%,
      rgba(11,53,82,.86) 42%,
      rgba(19,82,122,.74) 100%);
}

.brand-inner {
  position: relative;
  z-index: 2;
  max-width: 470px;
}

.brand-inner h1 {
  margin: 0 0 14px;
  font-size: 33px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: .3px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .3);
}

.brand-sub {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, .76);
  letter-spacing: 1.6px;
  line-height: 1.7;
}

.brand-points {
  margin: 46px 0 0;
  padding: 0;
  list-style: none;
}

.brand-points li {
  position: relative;
  padding-inline-start: 22px;
  margin-bottom: 16px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, .9);
  line-height: 1.65;
}

.brand-points li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #6fc3f0;
  transform: rotate(45deg);
}

/* ================= 语言切换（下拉，可容纳任意数量） ================= */
.lang-select {
  position: absolute;
  top: 22px;
  inset-inline-end: 28px;
  z-index: 8;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 12px;
  font-family: var(--font);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(23, 62, 90, .06);
  transition: all .15s;
}

.lang-current:hover { border-color: #c4d2dc; color: var(--brand); }
.lang-current svg { flex: none; opacity: .72; }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(23, 62, 90, .16);
  padding: 5px;
  display: none;
}

.lang-menu.open { display: block; }

.lang-menu button {
  display: block;
  width: 100%;
  text-align: start;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  padding: 8px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .12s;
}

.lang-menu button:hover { background: #f2f7fa; }

.lang-menu button.active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

/* ================= 右侧表单 ================= */
.form-side {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 40px 26px;
}

.form-box {
  width: 100%;
  max-width: 384px;
}

/* 分段切换 */
.seg {
  display: flex;
  gap: 4px;
  background: #e9eef2;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 26px;
}

.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink-2);
  padding: 9px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all .16s;
}

.seg-btn.active {
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(23, 62, 90, .12);
}

/* 表单 */
.pane { display: none; }
.pane.active { display: block; }

.field {
  display: block;
  margin-bottom: 16px;
}

.field span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field input::placeholder { color: #b6c2cc; }

.field input:focus {
  border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(35, 100, 143, .12);
}

/* 按钮 */
.btn-main {
  width: 100%;
  margin-top: 8px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 12px 0;
  border: none;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: background .16s;
}

.btn-main:hover:not(:disabled) { background: var(--brand-2); }
.btn-main:disabled { background: #c3ced7; cursor: not-allowed; }

.btn-ghost {
  width: 100%;
  font-family: var(--font);
  font-size: 13.5px;
  padding: 10px 0;
  border: 1px dashed #b8c7d2;
  border-radius: 9px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  transition: all .16s;
}

.btn-ghost:hover:not(:disabled) { border-color: var(--brand-3); background: #f6fafd; }
.btn-ghost:disabled { color: var(--ink-3); border-color: #dde5ea; cursor: not-allowed; }

/* 设备验证块 */
.device-check {
  margin: 6px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  transition: all .2s;
}

.device-check.verified {
  border-color: rgba(30, 132, 73, .45);
  background: #f4fbf6;
}

.dc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.dc-status {
  font-size: 12px;
  color: var(--warn);
  background: rgba(183, 149, 11, .12);
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
}

.device-check.verified .dc-status {
  color: var(--ok);
  background: rgba(30, 132, 73, .12);
}

.dc-tip {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
}

.dc-tip b { color: var(--ink-2); }

.dc-dev {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ok);
  min-height: 16px;
  word-break: break-all;
}

/* 提示文字 */
.msg {
  margin: 12px 0 0;
  font-size: 12.5px;
  min-height: 18px;
  line-height: 1.5;
}
.msg.err { color: var(--err); }
.msg.ok { color: var(--ok); }

.form-foot {
  margin-top: 26px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}

/* ================= Arabic 微调 ================= */
html[lang="ar"] body { font-size: 15px; }
html[lang="ar"] .brand-inner h1 { font-size: 30px; line-height: 1.45; }
html[lang="ar"] .brand-sub { letter-spacing: 0; }
html[lang="ar"] .field span { font-size: 13px; }

/* ================= 响应式 ================= */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }

  .brand-side {
    padding: 40px 28px 38px;
    min-height: 220px;
    align-items: flex-end;
  }
  .brand-inner h1 { font-size: 24px; }
  .brand-points { display: none; }

  .lang-select { top: 14px; inset-inline-end: 16px; }

  .form-side { padding: 34px 24px 40px; }
}
