:root {
  color-scheme: dark;
  --bg: #08070d;
  --surface: #121019;
  --surface-2: #191621;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f7f4fb;
  --muted: #b9b1c3;
  --faint: #81798c;
  --accent: #a879e6;
  --accent-strong: #c09af1;
  --accent-ink: #160d20;
  --danger: #ff9d9d;
  --success: #b8e8ce;
  --radius: 16px;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100dvh; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-strong); text-underline-offset: 3px; }

.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.ambient span { position: absolute; width: 40vw; height: 40vw; border-radius: 50%; filter: blur(90px); opacity: .15; }
.ambient span:first-child { top: -16vw; right: -8vw; background: var(--accent); }
.ambient span:last-child { bottom: -18vw; left: -10vw; background: #6d4c94; }

.shell { position: relative; z-index: 1; width: min(1180px, calc(100% - 40px)); min-height: 100dvh; margin: 0 auto; padding: 30px 0 44px; display: grid; grid-template-columns: minmax(0, .9fr) minmax(520px, 1.1fr); grid-template-rows: auto 1fr; column-gap: clamp(54px, 8vw, 112px); }
.brand { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; min-height: 48px; }
.brand img { display: block; width: 42px; height: 42px; border-radius: 12px; }
.brand div { display: grid; gap: 2px; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand span { color: var(--faint); font-size: 12px; }

.intro { align-self: center; padding: 70px 0 30px; }
.eyebrow { margin: 0 0 20px; color: var(--accent-strong); font-size: 11px; font-weight: 800; letter-spacing: .28em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 540px; margin-bottom: 20px; font-size: clamp(42px, 5vw, 68px); line-height: 1.04; letter-spacing: -.055em; }
.lead { max-width: 460px; margin-bottom: 34px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.reward { padding: 25px 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.reward > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.reward strong { display: block; color: var(--accent-strong); font-size: clamp(58px, 7vw, 84px); line-height: 1; letter-spacing: -.06em; }
.reward small { margin-left: 10px; font-size: 16px; letter-spacing: 0; }
.reward p { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.route-note { display: grid; grid-template-columns: 28px 1fr; gap: 9px 14px; margin-top: 26px; color: var(--muted); }
.route-note span { color: var(--accent-strong); font: 700 11px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.route-note p { margin: 0; font-size: 13px; line-height: 1.7; }

.form-panel { align-self: center; margin-top: 28px; padding: clamp(24px, 4vw, 42px); border: 1px solid var(--line); border-radius: var(--radius); background: rgba(18, 16, 25, .94); box-shadow: 0 30px 90px rgba(3, 2, 7, .42); }
.form-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.form-heading h2 { margin-bottom: 7px; font-size: 27px; letter-spacing: -.03em; }
.form-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.secure-label { flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--success); font-size: 11px; }
.notice { margin-bottom: 20px; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.55; }
.notice.success { color: var(--success); background: rgba(93, 171, 130, .1); border: 1px solid rgba(119, 206, 160, .22); }
.notice.error { color: var(--danger); background: rgba(202, 84, 84, .09); border: 1px solid rgba(255, 138, 138, .22); }

form { display: grid; gap: 18px; }
.inviter-summary { display: flex; align-items: baseline; gap: 3px; margin-bottom: -5px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.inviter-summary strong { min-width: 0; color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; }
.field { display: grid; align-content: start; gap: 8px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { color: #e8e2ef; font-size: 13px; font-weight: 650; }
.field input, .field select { width: 100%; height: 46px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: var(--surface-2); color: var(--text); padding: 0 13px; transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.field input::placeholder { color: #746c7f; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168, 121, 230, .18); background: #1d1926; }
.field input[readonly] { color: var(--accent-strong); background: rgba(168, 121, 230, .08); }
.hint { min-height: 18px; color: var(--faint); font-size: 11px; line-height: 1.55; }
.input-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.secondary-button { min-width: 112px; border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; color: var(--text); padding: 0 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.secondary-button:hover:not(:disabled) { border-color: var(--accent); background: rgba(168, 121, 230, .09); }
.secondary-button:disabled { color: var(--faint); cursor: not-allowed; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 52px; }
.text-button { border: 0; background: transparent; color: var(--accent-strong); cursor: pointer; }
.password-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); padding: 8px; font-size: 11px; }

.captcha { position: relative; height: 48px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); touch-action: none; user-select: none; outline: 0; }
.captcha:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168, 121, 230, .18); }
.captcha-fill { position: absolute; inset: 0 auto 0 0; width: 7%; background: rgba(168, 121, 230, .12); transition: width 160ms ease; }
.captcha.dragging .captcha-fill, .captcha.dragging .captcha-thumb { transition: none; }
.captcha-text { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; pointer-events: none; }
.captcha-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: 42px; border: 0; border-radius: 8px; background: var(--accent); cursor: grab; transition: transform 160ms ease, background 160ms ease; }
.captcha-thumb::after { content: ">"; color: var(--accent-ink); font-weight: 900; }
.captcha.dragging .captcha-thumb { cursor: grabbing; }
.captcha.verifying .captcha-thumb { cursor: wait; }
.captcha.verified { border-color: rgba(119, 206, 160, .5); }
.captcha.verified .captcha-fill { width: 100% !important; background: rgba(93, 171, 130, .16); }
.captcha.verified .captcha-thumb { background: #8ed4ad; }
.captcha.verified .captcha-thumb::after { content: "✓"; }
.captcha.failed { border-color: rgba(255, 138, 138, .42); }
.captcha.disabled { opacity: .64; }

.agreements { display: grid; gap: 10px; padding-top: 2px; }
.agreements label { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 12px; line-height: 1.6; cursor: pointer; }
.agreements input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.form-status { min-height: 20px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.form-status.error { color: var(--danger); }
.form-status.working { color: var(--accent-strong); }
.primary-button { width: 100%; min-height: 50px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 850; cursor: pointer; transition: transform 140ms ease, background 140ms ease; }
.primary-button:hover:not(:disabled) { background: var(--accent-strong); }
.primary-button:active:not(:disabled) { transform: translateY(1px) scale(.995); }
.primary-button:disabled { background: #3b3542; color: #807789; cursor: not-allowed; }
.after-submit { margin: -6px 0 0; color: var(--faint); text-align: center; font-size: 11px; }

.success-screen { position: fixed; z-index: 20; inset: 0; place-items: center; padding: 20px; background: rgba(8, 7, 13, .94); opacity: 0; transition: opacity 240ms ease; }
.success-screen.visible { display: grid; opacity: 1; }
.success-screen > div { width: min(430px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; box-shadow: 0 30px 90px rgba(0, 0, 0, .48); }
.success-mark { display: grid; width: 54px; height: 54px; margin: 0 auto 22px; place-items: center; border-radius: 50%; background: rgba(93, 171, 130, .15); }
.success-mark::after { content: "✓"; color: var(--success); font-size: 26px; font-weight: 900; }
.success-screen h2 { margin-bottom: 10px; font-size: 30px; }
.success-screen p { color: var(--muted); line-height: 1.7; }
.success-screen a { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; margin-top: 8px; padding: 0 20px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; text-decoration: none; }

@media (max-width: 920px) {
  .shell { width: min(700px, calc(100% - 32px)); grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .intro { padding: 58px 0 18px; }
  .intro h1 { max-width: 620px; }
  .lead { max-width: 560px; }
  .route-note { grid-template-columns: repeat(6, auto); justify-content: start; gap: 8px 10px; align-items: center; }
  .form-panel { margin-top: 32px; }
}

@media (max-width: 620px) {
  .shell { width: 100%; padding: 18px 14px 28px; }
  .brand { min-height: 42px; }
  .brand img { width: 38px; height: 38px; border-radius: 10px; }
  .intro { padding-top: 44px; }
  .eyebrow { margin-bottom: 14px; }
  h1 { font-size: clamp(37px, 12vw, 50px); }
  .lead { font-size: 14px; }
  .reward strong { font-size: 58px; }
  .route-note { grid-template-columns: 26px 1fr; }
  .form-panel { margin: 28px -2px 0; padding: 22px 16px; }
  .form-heading { align-items: center; }
  .secure-label { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .input-action { grid-template-columns: minmax(0, 1fr) 105px; }
  .secondary-button { min-width: 0; padding: 0 9px; }
  .success-screen > div { padding: 34px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
