/* ============================================================
   User-facing theme — restrained tech / monochrome + one accent
   ============================================================ */
:root {
  --u-ink: #ededf0;
  --u-ink-2: #9b9ba6;
  --u-ink-3: #5e5e6a;
  --u-line: rgba(255, 255, 255, .09);
  --u-line-2: rgba(255, 255, 255, .16);
  --u-surface: rgba(255, 255, 255, .035);

  --u-accent: #5c9eff;           /* single cool accent */
  --u-accent-dim: rgba(92, 158, 255, .16);

  --u-warn: #d9a94f;
  --u-ok: #4fd995;
  --u-err: #e05f6f;

  --u-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --u-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
            "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --u-ease: cubic-bezier(.22, .8, .28, 1);

  --u-fs-caption: 12px;
  --u-fs-small: 12.5px;
  --u-fs-label: 13px;
  --u-fs-sub: 13.5px;
  --u-fs-body: 15px;
  --u-fs-field: 16px;
  --u-fs-button: 14.5px;
  --u-fs-title: 25px;
  --u-fs-progress-title: 31px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; }
body.user {
  margin: 0;
  min-height: 100vh;
  font-family: var(--u-font);
  font-size: var(--u-fs-body);
  line-height: 1.6;
  color: var(--u-ink);
  background: #0a0a0d;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.user a { color: inherit; }
body.user button, body.user input, body.user textarea { font: inherit; color: inherit; }
body.user h1, body.user h2 { margin: 0; font-weight: 700; letter-spacing: 0; }

/* ---------- background: near-black, faint single glow, fine grid ---------- */
.u-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60rem 34rem at 50% -14rem, rgba(92, 158, 255, .09), transparent 65%),
    #0a0a0d;
}
.u-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(100% 70% at 50% 0%, #000 25%, transparent 80%);
  -webkit-mask-image: radial-gradient(100% 70% at 50% 0%, #000 25%, transparent 80%);
}
/* legacy blob nodes render nothing in this theme */
.u-blob { display: none; }

/* ---------- layout ---------- */
.u-wrap {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 18px;
}
.u-shell { width: min(460px, 100%); display: grid; gap: 0; }

/* ---------- card ---------- */
.u-card {
  position: relative;
  border-radius: 18px;
  padding: 34px 30px;
  background: var(--u-surface);
  border: 1px solid var(--u-line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset;
  animation: u-rise .5s var(--u-ease) both;
}
@keyframes u-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.u-submit-shell { width: min(520px, 100%); }
.u-submit-card {
  overflow: hidden;
  padding: 38px 36px 40px;
  animation: none;
  background:
    radial-gradient(24rem 13rem at 50% -8rem, rgba(92,158,255,.075), transparent 74%),
    radial-gradient(18rem 13rem at 105% 100%, rgba(92,158,255,.045), transparent 68%),
    linear-gradient(180deg, rgba(255,255,255,.062), rgba(255,255,255,.026));
  border-color: rgba(255,255,255,.15);
  box-shadow:
    0 1px 0 rgba(255,255,255,.08) inset,
    0 26px 80px rgba(0,0,0,.44),
    0 0 0 1px rgba(92,158,255,.04);
}
.u-submit-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 17px;
  background:
    radial-gradient(20rem 12rem at 50% 0%, rgba(255,255,255,.045), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.018), transparent);
  pointer-events: none;
}
.u-submit-card > * {
  position: relative;
  z-index: 1;
}

.u-head { text-align: center; margin-bottom: 24px; }
.u-head h1 { font-size: var(--u-fs-title); line-height: 1.22; }
.u-head .u-sub, .u-sub { margin: 9px 0 0; color: var(--u-ink-2); font-size: var(--u-fs-sub); }

/* ---------- form ---------- */
.u-form { display: grid; gap: 18px; }
.u-field { display: grid; gap: 8px; }
.u-field > label { color: var(--u-ink-2); font-size: var(--u-fs-label); font-weight: 600; }
.u-input, .u-textarea {
  width: 100%;
  border: 1px solid var(--u-line-2);
  border-radius: 11px;
  padding: 12px 14px;
  font-size: var(--u-fs-field);
  color: var(--u-ink);
  background: rgba(0,0,0,.32);
  outline: none;
  transition: border-color .18s var(--u-ease), box-shadow .18s var(--u-ease);
  -webkit-appearance: none; appearance: none;
}
.u-input::placeholder, .u-textarea::placeholder { color: var(--u-ink-3); }
.u-input:focus, .u-textarea:focus {
  border-color: var(--u-accent);
  box-shadow: 0 0 0 3px var(--u-accent-dim);
}
.u-textarea { min-height: 150px; resize: vertical; line-height: 1.7; }
.u-code { font-family: var(--u-mono); font-size: var(--u-fs-field); letter-spacing: .09em; text-transform: uppercase; }
.u-hint { margin: 0; color: var(--u-ink-3); font-size: var(--u-fs-small); }

/* ---------- button ---------- */
.u-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: var(--u-fs-button);
  font-weight: 650;
  color: #ffffff;
  cursor: pointer;
  background: #2f7df6;
  transition: background .16s var(--u-ease), transform .16s var(--u-ease), opacity .16s var(--u-ease);
}
.u-btn:hover:not(:disabled) { background: #4b91ff; transform: translateY(-1px); }
.u-btn:active:not(:disabled) { transform: none; }
.u-btn:disabled { opacity: .7; cursor: default; }
.u-btn-label { color: inherit; }
.u-btn-ghost {
  background: transparent;
  border-color: var(--u-line-2);
  color: var(--u-ink);
}
.u-btn-ghost:hover { background: rgba(255,255,255,.06); }

.u-spin {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.32);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: u-rot .7s linear infinite;
}
@keyframes u-rot { to { transform: rotate(360deg); } }

/* ---------- notice ---------- */
.u-notice {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 11px;
  font-size: var(--u-fs-sub);
  color: var(--u-err);
  background: rgba(224,95,111,.08);
  border: 1px solid rgba(224,95,111,.25);
}
.u-notice[hidden] { display: none; }
.u-notice svg { width: 18px; height: 18px; flex: 0 0 18px; }
.u-notice-ok {
  color: #0f7f63;
  background: rgba(15, 127, 99, .08);
  border-color: rgba(15, 127, 99, .22);
}
.u-refill {
  margin: 8px 0 20px;
  text-align: left;
  width: 100%;
}
.u-refill-tip {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--u-ink-2, #5f6b7a);
}
.u-refill-form .u-field { margin-bottom: 12px; }
.u-refill-form .u-input:disabled {
  opacity: .85;
  cursor: not-allowed;
}
.u-contact-tip {
  text-align: center;
  padding: 8px 4px 4px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--u-ink, #1f2937);
}

/* ---------- progress page ---------- */
/* full-screen confetti layer */
.u-confetti {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.u-confetti.is-on { opacity: 1; }

/* smooth state swap: icon / title / hint fade out, update, fade back in */
.u-status-ico,
.u-progress-card h1,
.u-progress-card .u-sub {
  transition: opacity .22s var(--u-ease), transform .22s var(--u-ease), color .4s var(--u-ease);
}
.u-swapping {
  opacity: 0 !important;
  transform: translateY(6px);
}

/* celebration: the card itself reacts — a soft bounce,
   a green ring bursting out of the icon, confetti rises from the card */
.u-progress-card.is-celebrate {
  animation: u-card-pop .55s var(--u-ease);
}
@keyframes u-card-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.015); }
  100% { transform: scale(1); }
}
.u-progress-card.is-celebrate .u-status-ico {
  animation: u-pop .6s var(--u-ease) both;
}
.u-progress-card.is-celebrate .u-status-ico::before {
  animation: none;
  opacity: .3;
}
@keyframes u-pop {
  0%   { transform: scale(.5); opacity: 0; }
  55%  { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); }
}
.u-progress-card.is-celebrate h1 {
  animation: u-rise .5s .15s var(--u-ease) both;
}

.u-progress-shell { width: min(590px, 100%); }
.u-progress-card {
  overflow: hidden;
  text-align: center;
  padding: 44px 52px 46px;
  background:
    radial-gradient(24rem 13rem at 50% -8rem, rgba(92,158,255,.075), transparent 74%),
    radial-gradient(18rem 13rem at 105% 100%, rgba(92,158,255,.045), transparent 68%),
    linear-gradient(180deg, rgba(255,255,255,.062), rgba(255,255,255,.026));
  border-color: rgba(255,255,255,.15);
  box-shadow:
    0 1px 0 rgba(255,255,255,.08) inset,
    0 26px 80px rgba(0,0,0,.44),
    0 0 0 1px rgba(92,158,255,.04);
}
.u-progress-card::before {
  content: "";
  position: absolute;
  inset: -35%;
  background:
    radial-gradient(circle at 50% 50%, rgba(92,158,255,.045), transparent 30%);
  pointer-events: none;
}
.u-progress-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 17px;
  background:
    radial-gradient(20rem 12rem at 50% 0%, rgba(255,255,255,.045), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.018), transparent);
  pointer-events: none;
}
.u-progress-card > * {
  position: relative;
  z-index: 1;
}
.u-progress-card h1 {
  font-size: var(--u-fs-progress-title);
  line-height: 1.18;
}
.u-progress-card .u-sub {
  margin-top: 16px;
  font-size: var(--u-fs-body);
}
.u-status-ico {
  position: relative;
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  display: grid; place-items: center;
  border-radius: 16px;
  color: var(--u-accent);
  background: #131318;
  border: 1px solid var(--u-line-2);
  transition: color .4s var(--u-ease);
}
.u-progress-card .u-status-ico {
  width: 76px;
  height: 76px;
  margin-bottom: 30px;
  border-radius: 50%;
  color: var(--u-warn);
  background:
    radial-gradient(circle at 50% 38%, rgba(255,255,255,.05), transparent 55%),
    #14161d;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
/* clean breathing glow — a blurred outer ring via box-shadow, no hard edge */
.u-progress-card .u-status-ico::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 22px 1px currentColor;
  opacity: .16;
  animation: u-halo 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes u-halo {
  0%, 100% { opacity: .09; }
  50%      { opacity: .24; }
}
.u-status-ico svg {
  position: relative;
  width: 30px;
  height: 30px;
  z-index: 1;
}
.u-progress-card .u-status-ico svg { width: 34px; height: 34px; }
.u-status-ico.is-pending { color: var(--u-warn); }
.u-status-ico.is-processing { color: var(--u-accent); }
/* loading / processing: three equalizer bars.
   delays are exactly 1/3 of the period so the bars stay evenly
   phased — one is always up, so the loop never "stalls" */
.u-status-ico.is-loading { color: var(--u-accent); }
.u-status-ico.is-loading svg .eq,
.u-status-ico.is-processing svg .eq {
  transform-box: fill-box;
  transform-origin: center;
  animation: u-eq 1.05s ease-in-out infinite;
}
.u-status-ico.is-loading svg .eq:nth-of-type(2),
.u-status-ico.is-processing svg .eq:nth-of-type(2) { animation-delay: -.35s; }
.u-status-ico.is-loading svg .eq:nth-of-type(3),
.u-status-ico.is-processing svg .eq:nth-of-type(3) { animation-delay: -.7s; }
@keyframes u-eq {
  0%, 100% { transform: scaleY(.5); opacity: .6; }
  50%      { transform: scaleY(1.12); opacity: 1; }
}
.u-status-ico.is-done { color: var(--u-ok); }
.u-status-ico.is-done::before { animation: none; opacity: .16; }
.u-status-ico.is-canceled { color: var(--u-ink-3); }
.u-status-ico.is-canceled::before { display: none; }

.u-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  color: var(--u-ink-2);
  background: rgba(255,255,255,.035);
  font-size: var(--u-fs-caption);
  line-height: 1;
}
.u-live span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--u-accent);
  box-shadow: 0 0 0 4px rgba(92,158,255,.12);
  animation: u-live-pulse 1.55s ease-in-out infinite;
}
@keyframes u-live-pulse {
  0%, 100% { opacity: .55; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1); }
}

/* horizontal progress rail */
/* rail: track & fill share one coordinate system —
   the line runs exactly from dot-1 center to dot-3 center,
   so 0% / 50% / 100% land precisely on the dot centers */
.u-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(470px, 100%);
  margin: 42px auto 4px;
  --dot: 36px;
}
.u-track {
  position: absolute;
  z-index: 0;
  left: calc(100% / 6);
  right: calc(100% / 6);
  top: calc(var(--dot) / 2 - 2px);
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
}
.u-rail-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4d92ff, #8ebbff);
  box-shadow: 0 0 12px rgba(92,158,255,.55);
  transition: width .9s var(--u-ease);
  overflow: hidden;
}
.u-rail-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent);
  animation: u-fill-flow 1.4s linear infinite;
}
@keyframes u-fill-flow {
  from { transform: translateX(-120%); }
  to   { transform: translateX(280%); }
}

/* the segment AHEAD of the current step: a faint light drifts toward
   the next node, signalling "moving to the next stage" */
.u-rail-next {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  overflow: hidden;
  opacity: 0;
  transition: opacity .4s var(--u-ease), left .9s var(--u-ease);
  pointer-events: none;
}
.u-rail-next.is-on { opacity: 1; }
.u-rail-next::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 55%;
  background: linear-gradient(90deg, transparent, rgba(92,158,255,.45), transparent);
  animation: u-next-drift 1.7s ease-in-out infinite;
}
@keyframes u-next-drift {
  from { transform: translateX(-100%); }
  to   { transform: translateX(220%); }
}

.u-node {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 0;
}
.u-dot {
  position: relative;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: #14161d;
  border: 2px solid rgba(255,255,255,.16);
  display: grid;
  place-items: center;
  transition: border-color .3s var(--u-ease), background .3s var(--u-ease);
}
.u-dot-core {
  grid-area: 1 / 1;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--u-accent);
  opacity: 0;
  transition: opacity .25s var(--u-ease);
  box-shadow: 0 0 12px rgba(92,158,255,.6);
}
.u-dot svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  opacity: 0;
  stroke: var(--u-accent);
  transition: opacity .25s var(--u-ease);
}
.u-node-label { font-size: var(--u-fs-small); color: var(--u-ink-3); transition: color .3s var(--u-ease); white-space: nowrap; }

.u-node.done .u-dot { border-color: rgba(92,158,255,.8); }
.u-node.done .u-dot svg { opacity: 1; }
.u-node.done .u-dot-core { opacity: 0; }
.u-node.done .u-node-label { color: var(--u-ink-2); }
.u-node[data-step="done"].done .u-dot { border-color: rgba(79,217,149,.85); }
.u-node[data-step="done"].done .u-dot svg { stroke: var(--u-ok); }

.u-node.active .u-dot {
  border-color: var(--u-accent);
  animation: u-nodepulse 1.8s ease-in-out infinite;
}
.u-node.active .u-dot-core {
  opacity: 1;
  animation: u-core-breathe 1.3s ease-in-out infinite;
}
.u-node.active .u-node-label { color: var(--u-ink); font-weight: 650; }
@keyframes u-nodepulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(92,158,255,.28); }
  50%      { box-shadow: 0 0 0 7px rgba(92,158,255,0); }
}
@keyframes u-core-breathe {
  0%, 100% { transform: scale(.85); }
  50%      { transform: scale(1.15); }
}

/* success check */
.u-check-wrap {
  width: 76px; height: 76px;
  margin: 0 auto 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #131318;
  border: 1px solid var(--u-line-2);
}
.u-check { width: 38px; height: 38px; stroke: var(--u-ok); stroke-width: 3.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.u-check path { stroke-dasharray: 50; stroke-dashoffset: 50; animation: u-draw .55s .2s var(--u-ease) forwards; }
@keyframes u-draw { to { stroke-dashoffset: 0; } }

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

/* mobile */
@media (max-width: 520px) {
  :root {
    --u-fs-sub: 13px;
    --u-fs-body: 14px;
    --u-fs-field: 16px;
    --u-fs-button: 14px;
    --u-fs-title: 23px;
    --u-fs-progress-title: 27px;
  }
  .u-wrap { padding: 24px 14px; }
  .u-card { padding: 26px 20px; }
  .u-submit-card { padding: 30px 20px 32px; }
  .u-progress-card {
    padding: 38px 18px 40px;
  }
  .u-progress-card .u-status-ico { width: 70px; height: 70px; margin-bottom: 26px; }
  .u-progress-card .u-sub { margin-top: 14px; }
  .u-live { margin-top: 12px; }
  .u-rail { width: 100%; margin-top: 38px; }
}
