/* ============================================================
   NRCrobo 联核机器人 — 对外客户注册/登录页（PC 优先）
   依赖 design-system.css 的 token；本文件仅承载页面布局与表单
   ============================================================ */

/* ---------- 整体布局：左右分栏 ---------- */
.reg-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-primary);
}
@media (max-width: 960px) {
  .reg-wrap { grid-template-columns: 1fr; }
}

/* ---------- 左侧品牌区（深蓝 hero） ---------- */
.reg-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 12% 8%, rgba(255, 107, 53, 0.16) 0%, rgba(255, 107, 53, 0) 46%),
    radial-gradient(120% 90% at 92% 100%, rgba(59, 130, 246, 0.18) 0%, rgba(59, 130, 246, 0) 50%),
    linear-gradient(155deg, #1A365D 0%, #142B4A 58%, #0F1F38 100%);
  color: var(--text-inverse);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* 细网格纹理 */
.reg-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 100% at 30% 20%, #000 30%, transparent 78%);
  pointer-events: none;
}
.reg-hero > * { position: relative; z-index: 1; }

/* 品牌 logo：橙色圆角块(白字 NRCrobo) + 右侧「联核机器人」，钉在 hero 顶部 */
.brand-logo {
  position: absolute; top: 48px; left: 56px; z-index: 2;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand-mark {
  height: 34px; padding: 0 12px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-orange), #FF8A5C);
  color: #fff; font-weight: 800; font-size: 16px; letter-spacing: 1.5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.35);
}
.brand-name { font-size: 17px; font-weight: 700; color: var(--text-inverse); letter-spacing: 0.5px; }

.reg-hero-body {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
}
.reg-hero h1 {
  font-size: 38px; line-height: 1.25; font-weight: 800; letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.reg-hero h1 .accent { color: var(--brand-orange); }
.reg-hero p.lead {
  font-size: 15px; line-height: 1.8; color: rgba(255, 255, 255, 0.78);
  max-width: 420px; margin-bottom: 32px;
}


/* ---------- 右侧表单区 ---------- */
.reg-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px;
}
.reg-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 40px 32px;
}
.reg-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; }
.reg-card-head h2 { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.reg-card-head .login-link { font-size: 13px; color: var(--text-secondary); }
.reg-card-head .login-link a { color: var(--primary); font-weight: 600; }
.reg-card-head .login-link a:hover { color: var(--primary-hover); text-decoration: underline; }

/* 客户类型切换（企业 / 家庭个人） */
.reg-type {
  display: flex; gap: 4px; padding: 4px;
  background: var(--secondary-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
}
.reg-type .rt {
  flex: 1; height: 38px;
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  background: transparent; border: none; border-radius: 6px;
  cursor: pointer; transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.reg-type .rt.active {
  color: var(--text-primary); background: #fff;
  box-shadow: 0 1px 3px rgba(15, 31, 56, 0.12);
}

/* 字段 */
.reg-field { margin-bottom: 18px; }
.reg-field.hidden { display: none; }
.reg-field > label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 7px;
}
.reg-field .req { color: var(--danger); margin-left: 2px; }

.reg-input {
  width: 100%; height: 46px;
  padding: 0 14px;
  font-size: 14px; color: var(--text-primary);
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.reg-input::placeholder { color: var(--text-muted); }
.reg-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}
.reg-input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.reg-err { display: none; font-size: 12px; color: var(--danger); margin-top: 6px; }
.reg-field.error .reg-err { display: block; }

/* 手机号 + 区号 */
.reg-phone { display: flex; gap: 10px; }
.reg-phone .prefix {
  flex-shrink: 0; height: 46px; padding: 0 14px;
  display: flex; align-items: center; gap: 6px;
  background: var(--secondary-bg); color: var(--text-primary);
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
}
.reg-phone .prefix svg { width: 16px; height: 16px; }

/* 验证码行 */
.reg-code { display: flex; gap: 10px; }
.reg-code .reg-input { flex: 1; }
.reg-code-btn {
  flex-shrink: 0; min-width: 116px; height: 46px;
  padding: 0 14px; font-size: 13px; font-weight: 600;
  color: var(--primary); background: var(--primary-bg);
  border: 1px solid #FFD9C7; border-radius: var(--radius-sm);
  transition: background 0.18s, color 0.18s;
}
.reg-code-btn:hover:not(:disabled) { background: #FFE6DA; }
.reg-code-btn:disabled { color: var(--text-muted); background: var(--bg-primary); border-color: var(--border-light); cursor: not-allowed; }

/* 协议勾选 */
.reg-agree { display: flex; align-items: flex-start; gap: 9px; margin: 22px 0 22px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.reg-agree input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.reg-agree a { color: var(--primary); font-weight: 600; }
.reg-agree a:hover { text-decoration: underline; }
.reg-agree.error { color: var(--danger); }

/* 提交按钮 */
.reg-submit {
  width: 100%; height: 48px;
  font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand-orange), #FF8A5C);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 18px rgba(255, 107, 53, 0.32);
  transition: transform 0.12s, box-shadow 0.18s, filter 0.18s;
}
.reg-submit:hover { filter: brightness(1.04); box-shadow: 0 8px 22px rgba(255, 107, 53, 0.4); }
.reg-submit:active { transform: translateY(1px); }

/* ---------- 成功态 ---------- */
.reg-success { text-align: center; padding: 18px 0 6px; display: none; }
.reg-success.show { display: block; }
.reg-success .check {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px;
  background: var(--success-bg); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  animation: pop 0.4s ease;
}
.reg-success .check svg { width: 32px; height: 32px; stroke: var(--success); fill: none; stroke-width: 3; }
.reg-success h3 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.reg-success p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 22px; }
.reg-success .reg-submit { display: inline-block; width: auto; padding: 0 28px; }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* 小屏：表单占满 */
@media (max-width: 960px) {
  .reg-hero { padding: 36px 28px; min-height: auto; }
  .reg-hero h1 { font-size: 30px; }
  .reg-hero-body { margin-top: 28px; }
  .reg-panel { padding: 28px 20px; }
  .reg-card { padding: 32px 24px 26px; box-shadow: none; border: none; }
}
