:root {
  --flow-bg: #070811;
  --flow-panel: rgba(17, 19, 32, 0.88);
  --flow-line: rgba(255, 255, 255, 0.09);
  --flow-line-strong: rgba(124, 92, 255, 0.38);
  --flow-text: #f6f5ff;
  --flow-copy: #a8acc0;
  --flow-muted: #72778f;
  --flow-purple: #7c5cff;
  --flow-purple-light: #ad9bff;
  --flow-cyan: #4aa8ff;
  --flow-green: #55d6a7;
  --flow-red: #ff7185;
  --flow-orange: #ffb45c;
  --flow-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body.account-flow {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: block;
  color: var(--flow-text);
  font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(124, 92, 255, 0.2), transparent 32%),
    radial-gradient(circle at 82% 80%, rgba(74, 168, 255, 0.1), transparent 28%),
    var(--flow-bg);
}
body.account-flow::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}
.flow-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 0;
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.15fr);
  align-items: center;
  gap: clamp(36px, 8vw, 110px);
}
.flow-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--flow-text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.flow-brand img { width: 35px; height: 35px; filter: drop-shadow(0 0 16px rgba(124, 92, 255, 0.42)); }
.flow-brand em { color: var(--flow-purple-light); font-style: normal; }
.release-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin-top: 44px;
  padding: 7px 11px;
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: 999px;
  color: #c7bdff;
  background: rgba(124, 92, 255, 0.1);
  font: 700 10px/1 'Space Mono', monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.release-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--flow-cyan);
  box-shadow: 0 0 12px rgba(74, 168, 255, 0.75);
}
.flow-intro h1 {
  max-width: 590px;
  margin: 20px 0 16px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}
.flow-intro > p { max-width: 530px; margin: 0; color: var(--flow-copy); font-size: 16px; line-height: 1.75; }
.flow-points { display: grid; gap: 12px; margin-top: 32px; }
.flow-point { display: flex; align-items: center; gap: 12px; color: #c9ccda; font-size: 13px; }
.flow-point span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--flow-line);
  border-radius: 9px;
  color: var(--flow-purple-light);
  background: rgba(255, 255, 255, 0.03);
}
.flow-card {
  width: 100%;
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid var(--flow-line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(22, 24, 40, 0.94), rgba(13, 15, 27, 0.92));
  box-shadow: var(--flow-shadow);
  backdrop-filter: blur(22px);
}
.flow-card-header { margin-bottom: 28px; }
.flow-kicker {
  margin-bottom: 10px;
  color: var(--flow-purple-light);
  font: 700 10px/1 'Space Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.flow-card h2 { margin: 0; font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.045em; }
.flow-card-header p { margin: 10px 0 0; color: var(--flow-copy); font-size: 14px; line-height: 1.65; }
.flow-field { margin-top: 18px; }
.flow-field label, .form-group label {
  display: block;
  margin-bottom: 8px;
  color: #c7cad8;
  font-size: 12px;
  font-weight: 700;
}
.flow-input,
.flow-card input:not([type="color"]):not([type="range"]) {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--flow-line);
  border-radius: 11px;
  outline: none;
  color: var(--flow-text);
  background: rgba(7, 8, 17, 0.66);
  font: 500 14px/1 'Inter', sans-serif;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.flow-input:focus,
.flow-card input:not([type="color"]):not([type="range"]):focus {
  border-color: var(--flow-line-strong);
  background: rgba(9, 10, 20, 0.9);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.1);
}
.flow-input::placeholder, .flow-card input::placeholder { color: #62677c; }
.flow-button,
.flow-card .btn {
  min-height: 50px;
  border: 0;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, #8d70ff, var(--flow-purple));
  box-shadow: 0 14px 30px rgba(124, 92, 255, 0.22);
  font: 800 13px/1 'Inter', sans-serif;
  transition: transform 0.18s, filter 0.18s, opacity 0.18s;
}
.flow-button { width: 100%; margin-top: 22px; }
.flow-button:hover:not(:disabled), .flow-card .btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.flow-button:disabled, .flow-card .btn:disabled { cursor: not-allowed; opacity: 0.55; }
.flow-card .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: flow-spin 0.7s linear infinite;
}
.flow-card .loading .spinner { display: block; }
@keyframes flow-spin { to { transform: rotate(360deg); } }
.flow-card .msg, .flow-card .status {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 10px;
  font: 500 12px/1.55 'Space Mono', monospace;
}
.flow-card .msg.error, .flow-card .status.err { color: var(--flow-red); border-color: rgba(255, 113, 133, 0.28); background: rgba(255, 113, 133, 0.08); }
.flow-card .msg.success, .flow-card .status.ok { color: var(--flow-green); border-color: rgba(85, 214, 167, 0.28); background: rgba(85, 214, 167, 0.08); }
.flow-card .status.loading { color: #c7bdff; border-color: rgba(124, 92, 255, 0.28); background: rgba(124, 92, 255, 0.08); }
.flow-back { margin: 20px 0 0; text-align: center; color: var(--flow-muted); font-size: 12px; }
.flow-back a, .flow-card a { color: var(--flow-purple-light); text-decoration: none; }
.flow-back a:hover, .flow-card a:hover { color: white; }
.pw-strength { display: flex; gap: 5px; margin-top: 9px; }
.pw-bar { height: 3px; flex: 1; border-radius: 3px; background: var(--flow-line); transition: background 0.2s; }
.pw-label { min-height: 16px; margin: 5px 0 0; color: var(--flow-muted); font: 500 10px/1.4 'Space Mono', monospace; }
.invalid-state { padding: 18px 0 4px; text-align: center; }
.invalid-state p { margin: 0; color: var(--flow-copy); font-size: 13px; line-height: 1.7; }

.setup-shell { grid-template-columns: minmax(250px, 0.72fr) minmax(480px, 1.3fr); }
.wizard { width: 100%; max-width: 680px; justify-self: end; }
.wizard-header { margin-bottom: 18px; }
.wizard-header { text-align: left; }
.wizard-title { font-size: clamp(30px, 4vw, 43px); font-weight: 800; letter-spacing: -0.045em; }
.wizard-sub { margin-top: 8px; color: var(--flow-copy); font-size: 14px; line-height: 1.6; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 22px 0 14px; }
.step-dot { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.09); transition: background 0.2s, box-shadow 0.2s; }
.step-dot.active { background: var(--flow-purple); box-shadow: 0 0 16px rgba(124, 92, 255, 0.6); }
.step-dot.done { background: var(--flow-green); }
.flow-card .step { display: none; }
.flow-card .step.active { display: block; animation: flow-enter 0.28s ease both; }
@keyframes flow-enter { from { opacity: 0; transform: translateY(8px); } }
.step-num { margin-bottom: 10px; color: var(--flow-purple-light); font: 700 10px/1 'Space Mono', monospace; letter-spacing: 0.12em; text-transform: uppercase; }
.step-title { font-size: clamp(25px, 4vw, 34px); font-weight: 800; letter-spacing: -0.04em; }
.step-desc { margin: 10px 0 24px; color: var(--flow-copy); font-size: 14px; line-height: 1.7; }
.form-group { margin-bottom: 18px; }
.help { margin-top: 7px; color: var(--flow-muted); font-size: 11px; line-height: 1.6; }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }
.flow-card .btn { width: auto; min-height: 46px; padding: 0 20px; text-decoration: none; }
.flow-card .btn-ghost { color: var(--flow-copy); border: 1px solid var(--flow-line); background: rgba(255, 255, 255, 0.03); box-shadow: none; }
.flow-card .btn-success { color: #07120e; background: var(--flow-green); box-shadow: 0 14px 30px rgba(85, 214, 167, 0.16); }
.skip { border: 0; color: var(--flow-muted); background: none; cursor: pointer; font: 600 12px/1 'Inter', sans-serif; }
.skip:hover { color: white; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--flow-line); color: #d6d8e4; font-size: 13px; line-height: 1.5; }
.check-row:last-child { border-bottom: 0; }
.check-icon { flex: 0 0 30px; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: rgba(124, 92, 255, 0.09); }

@media (max-width: 860px) {
  .flow-shell, .setup-shell { display: block; width: min(620px, calc(100% - 32px)); padding: 28px 0 52px; }
  .flow-intro { margin-bottom: 28px; }
  .flow-intro h1 { font-size: 44px; }
  .flow-intro > p, .flow-points { display: none; }
  .release-chip { margin-top: 24px; }
  .wizard { max-width: none; }
}
@media (max-width: 560px) {
  .flow-shell, .setup-shell { width: min(100% - 24px, 560px); padding-top: max(20px, env(safe-area-inset-top)); }
  .flow-intro h1 { margin-top: 14px; font-size: 36px; }
  .flow-card { padding: 25px 20px; border-radius: 18px; }
  .release-chip { margin-top: 18px; }
  .actions { align-items: stretch; flex-direction: column-reverse; }
  .actions > span:empty { display: none; }
  .actions > div { width: 100%; flex-wrap: wrap; }
  .flow-card .btn { width: 100%; }
  .skip { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
