:root {
  color-scheme: light;
  --ink: #0f172a;
  --ink-soft: #64748b;
  --line: #dbe4f5;
  --brand: #3b82f6;
  --brand-deep: #2563eb;
  --card: rgba(255, 255, 255, 0.74);
  --shadow: rgba(37, 99, 235, 0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 620px at 12% -8%, #e8f1ff 0%, rgba(232,241,255,0) 58%),
    radial-gradient(900px 560px at 100% 6%, #e0e7ff 0%, rgba(224,231,255,0) 55%),
    radial-gradient(760px 760px at 50% 118%, #e6f6ef 0%, rgba(230,246,239,0) 60%),
    linear-gradient(180deg, #f7fbff 0%, #eef4ff 52%, #f4f9f6 100%);
}

.card {
  width: 100%;
  max-width: 380px;
  padding: 34px 30px 28px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 20px 60px var(--shadow),
    0 2px 8px rgba(36, 26, 51, 0.06);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

.brand {
  text-align: center;
  margin-bottom: 22px;
}

.bear {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px var(--shadow));
  user-select: none;
  -webkit-user-drag: none;
}

.title {
  margin: 12px 0 2px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.step { display: block; }
.step.hidden { display: none; }

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

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

input[type="text"],
input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--ink);
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.20);
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 2px 0 18px;
  cursor: pointer;
  user-select: none;
}

.remember input { width: 15px; height: 15px; accent-color: var(--brand-deep); }

.btn {
  display: block;
  width: 100%;
  height: 46px;
  line-height: 46px;
  text-align: center;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  box-shadow: 0 10px 24px var(--shadow);
  transition: transform 0.08s, box-shadow 0.15s, opacity 0.15s;
}

.btn:hover { box-shadow: 0 12px 28px rgba(37, 99, 235, 0.34); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: default; }

.btn.ghost {
  margin-top: 10px;
  color: var(--brand-deep);
  background: transparent;
  box-shadow: none;
  font-weight: 500;
}

.btn.ghost:hover { text-decoration: underline; box-shadow: none; }

.hidden { display: none !important; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: var(--ink-soft);
  font-size: 12.5px;
  user-select: none;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn.passkey {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--brand-deep);
  background: #ffffff;
  border: 1.5px solid var(--brand);
  box-shadow: none;
  font-weight: 600;
}
.btn.passkey:hover {
  background: #f2f6ff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.16);
}
.passkey-icon { flex: none; }

.hint {
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  margin: 4px 0 16px;
  line-height: 1.6;
}

.totp-input {
  width: 100%;
  height: 54px;
  text-align: center;
  font-size: 26px;
  letter-spacing: 12px;
  padding-left: 12px;
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

.msg {
  min-height: 18px;
  margin: 14px 2px 0;
  font-size: 13px;
  text-align: center;
  color: #d14343;
}

.msg.ok { color: #2f9e69; }
