*, *::before, *::after { box-sizing: border-box; }

:root {
  --blue: #0070ba;
  --blue-press: #005ea6;
  --ink: #16181b;
  --text: #2c2e2f;
  --muted: #6c7378;
  --line: #d6d9dc;
  --err: #d20000;
}

html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 黑字 logo ---------- */
.topbar {
  padding: 26px 16px 10px;
  display: flex;
  justify-content: center;
}
.wordmark {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1.4px;
  line-height: 1;
  color: #000;
  user-select: none;
}
.wordmark span:last-child { margin-left: 1px; }

/* ---------- 主体 ---------- */
.card {
  width: 100%;
  max-width: 388px;
  margin: 34px auto 0;
  padding: 0 16px;
  position: relative;
}

.step.hide { display: none; }

.title2 {
  font-size: 24px;
  font-weight: 500;
  text-align: center;
  margin: 0 0 10px;
}
.sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
  margin: 0 0 20px;
}

/* ---------- 输入框 ---------- */
.field { margin-bottom: 10px; }

.field input {
  width: 100%;
  height: 72px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 17px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field input::placeholder { color: var(--muted); opacity: 1; }
.field input:hover { border-color: #b7bcc0; }
.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.field.err input { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }

.hint {
  display: none;
  color: var(--err);
  font-size: 13px;
  margin: 6px 2px 0;
}
.field.err .hint { display: block; }

/* ---------- 链接行 ---------- */
.forgot-row { margin: 12px 2px 24px; }
.link {
  color: var(--blue);
  text-decoration: none;
  font-size: 17px;
}
.link:hover { text-decoration: underline; }
.link.small { font-size: 14px; }

/* ---------- 主按钮 ---------- */
.btn-next {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 26px;
  background: #0070c0;
  color: #fff;
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
  transition: background .15s ease;
}
.btn-next:hover { background: var(--blue-press); }
.btn-next:active { background: #004f8b; }
.btn-next[disabled] { opacity: .55; cursor: default; }

/* ---------- or 分隔 ---------- */
.or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 30px 0;
  color: var(--muted);
  font-size: 15px;
}
.or::before, .or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- 描边按钮 ---------- */
.btn-ghost {
  width: 100%;
  height: 52px;
  border: 1.5px solid var(--ink);
  border-radius: 26px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  transition: background .15s ease;
}
.btn-ghost:hover { background: #f5f7fa; }

/* ---------- 账号 chip ---------- */
.account-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 18px;
  font-size: 16px;
  margin-bottom: 12px;
  overflow: hidden;
}
.account-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 勾选 ---------- */
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  margin: 0 2px 24px;
  cursor: pointer;
  user-select: none;
}
.check input { width: 20px; height: 20px; accent-color: #0070c0; }

/* ---------- 加载 ---------- */
.spin {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  background: rgba(255, 255, 255, .78);
  z-index: 9;
}
.spin.hide { display: none; }
.spin span {
  width: 36px;
  height: 36px;
  border: 3px solid #d9dcdf;
  border-top-color: #0070c0;
  border-radius: 50%;
  animation: rot .8s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- 语言行 ---------- */
.langs {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 46px 0 0;
  padding: 0 16px;
  font-size: 16px;
  flex-wrap: wrap;
}
.langs a { color: var(--text); text-decoration: none; }
.langs a:hover { text-decoration: underline; }

/* ---------- 底部条 ---------- */
.foot {
  margin-top: auto;
  background: #f5f7fa;
  border-top: 1px solid #eceff1;
  padding: 18px 12px;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13.5px;
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--blue); }

@media (min-width: 600px) {
  .card { max-width: 420px; margin-top: 54px; }
  .topbar { padding-top: 40px; }
  .wordmark { font-size: 40px; }
}

/* ---------- 完成页 ---------- */
.done-badge { display: flex; justify-content: center; margin: 6px 0 18px; }
.done-badge svg { width: 96px; height: 96px; display: block; }
.btn-next.as-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-top: 6px;
}


/* ---------- 双列表单 ---------- */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .row2 { grid-template-columns: 1fr; } }

/* ---------- 3D Secure ---------- */
.d3-brand {
  text-align: center;
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #1a1f71;
  font-weight: 700;
  margin: 4px 0 14px;
}
.d3-card {
  margin: 0 auto 22px;
  padding: 12px 16px;
  max-width: 300px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fb;
  color: #4a4f55;
  font-family: "Courier New", monospace;
  font-size: 15px;
  letter-spacing: 1px;
  text-align: center;
}
.field.hide { display: none; }
.check.hide { display: none; }

/* ---------- 3D 模式：藏掉 PayPal 标识，突出卡组织 ---------- */
body.d3-mode .topbar { display: none; }
body.d3-mode .card { margin-top: 56px; }
body.d3-mode .d3-brand {
  font-size: 17px;
  letter-spacing: 2px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1a1f71;
  display: inline-block;
}
body.d3-mode #d3-brand { display: block; text-align: center; }
body.d3-mode .d3-brand { display: inline-block; margin: 0 auto 12px; }
