:root {
  --bg: #070708;
  --bg-2: #101012;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --muted: #8d8d93;
  --red: #ff0033;
  --red-deep: #c40028;
  --ok: #3dd68c;
  --err: #ff6b6b;
  --radius: 22px;
  --font: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px 36px;
  overflow-x: hidden;
}

.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
}
.orb-a {
  width: 340px; height: 340px;
  top: -140px; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 0, 51, 0.45), transparent 68%);
}
.orb-b {
  width: 260px; height: 260px;
  right: -80px; bottom: -60px;
  background: radial-gradient(circle, rgba(90, 20, 40, 0.7), transparent 70%);
}
.grain {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  opacity: 0.25;
}

.shell {
  position: relative;
  width: min(440px, 100%);
  padding: 28px 28px 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(22,22,24,0.92), rgba(10,10,12,0.96));
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark svg { display: block; filter: drop-shadow(0 8px 16px rgba(255, 0, 51, 0.35)); }

.top-copy { flex: 1; min-width: 0; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
}
.top-copy h1 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.lang { position: relative; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.lang-btn:hover { border-color: rgba(255, 0, 51, 0.5); }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 132px;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #161618;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  z-index: 5;
}
.lang-menu li {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}
.lang-menu li:hover,
.lang-menu li[aria-selected="true"] {
  background: var(--red);
}

.hero { margin-bottom: 26px; }
.lead {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.twofa-hint {
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  max-height: 240px;
  overflow-y: auto;
}

.panel { display: grid; gap: 14px; }
.field { display: grid; gap: 8px; }
.field span {
  font-size: 13px;
  font-weight: 600;
}
.field input {
  height: 54px;
  padding: 0 16px;
  border: 1px solid #2a2a2e;
  border-radius: 16px;
  background: #0c0c0e;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  letter-spacing: 0.04em;
}
.field input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 0, 51, 0.14);
}
.field input:disabled { opacity: 0.55; }
.field.is-bad input {
  border-color: var(--err);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.14);
}
.field input[type="password"],
.field input[type="email"] { letter-spacing: normal; }
#totp { letter-spacing: 0.18em; font-variant-numeric: tabular-nums; }
#totp.is-email { letter-spacing: normal; font-variant-numeric: normal; }
.twofa { margin-bottom: 18px; }
.twofa-choices:not([hidden]) {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0 0 16px;
}
#twofaInput[hidden],
.twofa-choices[hidden] { display: none; }
#twofaInput {
  display: grid;
  gap: 14px;
  margin: 0;
  width: 100%;
}
#twofaCta {
  width: 100%;
  height: 48px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  align-self: stretch;
}
#twofaCta.is-email {
  height: 46px;
  border-radius: 999px;
}
#twofaResendWrap[hidden] { display: none; }
#twofaResendWrap {
  margin: 12px 0 0;
  width: 100%;
}
#twofaResend {
  margin-top: 0;
  width: 100%;
  height: 44px;
}
#twofaResend:disabled { cursor: progress; opacity: 0.7; }
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.choice:hover { border-color: rgba(255, 0, 51, 0.45); }
.choice.is-on {
  border-color: var(--red);
  background: rgba(255, 0, 51, 0.12);
  box-shadow: 0 0 0 3px rgba(255, 0, 51, 0.12);
}
.choice:disabled { opacity: 0.55; cursor: progress; }
.choice-idx {
  width: 22px; height: 22px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.1);
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}
.choice.is-on .choice-idx { background: var(--red); color: #fff; }
.choice-copy { font-size: 13px; font-weight: 600; line-height: 1.3; }

.cta {
  position: relative;
  overflow: hidden;
  height: 54px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff2a4d, var(--red-deep));
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.18em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(255, 0, 51, 0.28);
}
.cta:hover:not(:disabled) { filter: brightness(1.06); }
.cta:disabled { cursor: progress; filter: saturate(0.7) brightness(0.85); }
.cta.is-busy .cta-label { letter-spacing: 0.08em; }
.cta-shine {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.18) 48%, transparent 62%);
  transform: translateX(-120%);
}
.cta:hover:not(:disabled) .cta-shine { animation: shine 0.9s ease; }

.status {
  min-height: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.status.is-err { color: var(--err); }
.status.is-ok { color: var(--ok); }

.result {
  text-align: center;
  padding: 12px 0 4px;
}
.result .badge { margin-bottom: 16px; }
.result h2 { font-size: 26px; margin-bottom: 10px; }
.result-msg { color: var(--muted); font-size: 14px; line-height: 1.6; }
.result-email {
  margin-top: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.ghost {
  margin-top: 22px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.ghost:hover { border-color: #fff; }
.overwrite .ghost {
  margin-top: 0;
  width: 100%;
}
.overwrite .ghost:disabled,
.overwrite .cta:disabled { cursor: progress; opacity: 0.7; }
.cancel-run {
  width: 100%;
  margin-top: 14px;
}

@keyframes shine {
  to { transform: translateX(120%); }
}

@media (max-width: 420px) {
  .shell { padding: 22px 18px 26px; border-radius: 22px; }
  .top-copy h1 { font-size: 18px; }
}
