/* Nimbus Card™ — live /signup wizard
   Dark ink · neon green · Instrument Serif + Inter
   Strategy A: separate from assets/style.css. Self-contained. */

:root {
  --bg: #0B0F14;
  --surface: #161C24;
  --surface-soft: #12171E;
  --surface-raised: #1A222D;
  --ink: #F2F5F7;
  --muted: #9AA3AD;
  --muted-soft: #6B7480;
  --line: rgba(57, 255, 20, 0.12);
  --line-strong: rgba(242, 245, 247, 0.14);
  --accent: #39FF14;
  --accent-bright: #3DFF2E;
  --accent-deep: #39FF14;
  --accent-ink: #0B0F14;
  --accent-soft: rgba(57, 255, 20, 0.12);
  --accent-mid: rgba(57, 255, 20, 0.28);
  --danger: #FF6B6B;
  --danger-soft: rgba(255, 107, 107, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.4), 0 32px 64px rgba(0, 0, 0, 0.45);
  --max: 960px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Instrument Serif", "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(57, 255, 20, 0.08), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-bright); }
button { font-family: inherit; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* —— Server validation banner —— */
.signup-banner-err {
  max-width: 560px;
  margin: 0 auto 20px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: var(--danger);
  font-size: 0.95rem;
  text-align: center;
}
.signup-banner-err a { color: var(--accent); font-weight: 600; }

.signup-post-form { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

#usernameHintMsg[data-ok="1"] { color: var(--accent); }
#usernameHintMsg[data-ok="0"] { color: var(--danger); }

/* —— Header —— */
.signup-header {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 20, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.signup-header__inner {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.logo:hover { color: var(--ink); }
.logo__mark {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
  mix-blend-mode: screen;
  flex-shrink: 0;
}
.logo__tm {
  color: var(--accent);
  font-size: 0.55em;
  vertical-align: super;
  margin-left: 1px;
}
.signup-header__aside { margin: 0; }

/* —— Shell —— */
.signup-shell {
  width: min(100% - 32px, var(--max));
  margin: 28px auto 48px;
  flex: 1;
}

/* —— Progress —— */
.progress {
  margin-bottom: 28px;
}
.progress__list {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.progress__item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  color: var(--muted-soft);
  font-size: 13px;
  font-weight: 500;
}
.progress__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--surface);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.progress__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress__item.is-active { color: var(--ink); }
.progress__item.is-active .progress__num {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.25);
}
.progress__item.is-done { color: var(--muted); }
.progress__item.is-done .progress__num {
  border-color: var(--accent-mid);
  color: var(--accent);
  background: var(--accent-soft);
}
.progress__bar {
  height: 3px;
  background: var(--line-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress__fill {
  display: block;
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: inherit;
  transition: width 0.35s var(--ease);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
}

/* —— Typography —— */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 14px;
}
.eyebrow span + span::before {
  content: "·";
  margin-right: 8px;
  color: var(--muted-soft);
}
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--ink);
  margin: 0;
}
.display--lg { font-size: clamp(2rem, 4.5vw, 2.75rem); }
.display--md { font-size: clamp(1.55rem, 3vw, 2.1rem); }
.lede {
  font-size: clamp(1.02rem, 1.3vw, 1.15rem);
  color: var(--muted);
  line-height: 1.65;
  margin: 14px 0 0;
  max-width: 38em;
}
.lede--tight { margin-bottom: 22px; }

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  background: transparent;
  color: var(--ink);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.25), 0 0 24px rgba(57, 255, 20, 0.18);
}
.btn--primary:hover {
  background: var(--accent-bright);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.35), 0 0 32px rgba(57, 255, 20, 0.28);
}
.btn--secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--secondary:hover {
  color: var(--accent);
  border-color: var(--accent-mid);
  background: var(--accent-soft);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(242, 245, 247, 0.22);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 14px;
}
.btn--block { width: 100%; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.cta-row--success {
  margin-top: 32px;
  justify-content: center;
}

/* —— Steps —— */
.step[hidden] { display: none !important; }
.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow-md);
  max-width: 560px;
  margin-inline: auto;
}
.step-card--welcome { max-width: 580px; }
.step-card--success { max-width: 640px; text-align: center; }
.step-card--success .lede { margin-inline: auto; }

.value-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.value-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.value-list__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.value-list strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}
.value-list .muted {
  display: block;
  font-size: 0.9rem;
  line-height: 1.45;
}
.login-hint {
  text-align: center;
  margin: 20px 0 0;
}

.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 28px;
}
.step-actions .btn--primary { min-width: 140px; margin-left: auto; }

/* —— Fields —— */
.field {
  display: block;
  margin-bottom: 18px;
}
.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 8px;
}
.field input,
.field textarea,
.link-row input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}
.field input::placeholder,
.field textarea::placeholder,
.link-row input::placeholder {
  color: var(--muted-soft);
}
.field input:focus,
.field textarea:focus,
.link-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input.is-invalid,
.field textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.field__prefix {
  display: flex;
  align-items: stretch;
}
.field__affix {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  background: var(--surface-raised);
  border: 1.5px solid var(--line-strong);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--muted);
  font-weight: 600;
}
.field__prefix input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.field__hint {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.field__hint strong { color: var(--accent); font-weight: 600; }
.field__error {
  display: block;
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--danger);
}
.field__error[hidden] { display: none; }

.links-fieldset {
  border: 0;
  margin: 0 0 8px;
  padding: 0;
}
.links-fieldset .field__label { margin-bottom: 10px; }
.link-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  margin-bottom: 10px;
}
.soft-note { margin: 4px 0 0; }

/* —— Build layout + phone —— */
.build-layout {
  display: grid;
  gap: 24px;
  align-items: start;
}
.step-card--build {
  max-width: none;
  margin: 0;
}

.preview-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.preview-toggle {
  display: none;
  width: 100%;
  max-width: 320px;
}
.preview-toggle__hide { display: none; }
.preview-toggle[aria-expanded="true"] .preview-toggle__show { display: none; }
.preview-toggle[aria-expanded="true"] .preview-toggle__hide { display: inline; }
.preview-toggle[aria-expanded="false"] + .phone { display: none; }

.phone {
  width: 100%;
  max-width: 300px;
}
.phone__bezel {
  background: #0A0D12;
  border: 2px solid rgba(242, 245, 247, 0.16);
  border-radius: 36px;
  padding: 12px 10px 16px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(57, 255, 20, 0.08);
  position: relative;
}
.phone__notch {
  width: 96px;
  height: 22px;
  background: #05070A;
  border-radius: 0 0 14px 14px;
  margin: 0 auto 10px;
}
.phone__screen {
  background: var(--surface-soft);
  border-radius: 24px;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.card-preview {
  padding: 28px 20px 24px;
  text-align: center;
}
.card-preview__hero {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.card-preview__mark {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 14px;
  mix-blend-mode: screen;
}
.card-preview__name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 400;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  color: var(--ink);
  word-break: break-word;
}
.card-preview__role {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  min-height: 1.3em;
}
.card-preview__bio {
  margin: 0 0 14px;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
  min-height: 2.8em;
}
.card-preview__url {
  margin: 0 0 18px;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted-soft);
}
.card-preview__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.card-preview__links li a,
.card-preview__links li span {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 550;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.card-preview__links li a:hover {
  border-color: var(--accent-mid);
  background: var(--accent-soft);
  color: var(--accent);
}
.preview-pane__caption {
  margin: 0;
  text-align: center;
}

@media (min-width: 900px) {
  .build-layout {
    grid-template-columns: 1fr minmax(280px, 320px);
    gap: 32px;
  }
  .preview-pane {
    position: sticky;
    top: 88px;
  }
}

@media (max-width: 899px) {
  .preview-toggle { display: inline-flex; }
  .progress__label { display: none; }
  .link-row { grid-template-columns: 1fr; }
}

/* —— Success —— */
.success-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 28px rgba(57, 255, 20, 0.35);
}

.live-url-box {
  margin: 24px auto 0;
  padding: 18px 20px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  max-width: 420px;
}
.live-url-box__label { display: block; margin-bottom: 4px; }
.live-url-box__link {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
  margin-bottom: 14px;
}
.live-url-box__link:hover { color: var(--accent-bright); }
.live-url-box__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.qr-placeholder {
  margin: 24px auto 0;
  width: 160px;
  height: 160px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-placeholder__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.qr-placeholder__mark {
  width: 64px;
  height: 64px;
  border: 2px solid var(--accent-mid);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  background:
    linear-gradient(var(--accent-soft), var(--accent-soft)),
    repeating-linear-gradient(0deg, transparent, transparent 6px, rgba(57,255,20,0.15) 6px, rgba(57,255,20,0.15) 7px),
    repeating-linear-gradient(90deg, transparent, transparent 6px, rgba(57,255,20,0.15) 6px, rgba(57,255,20,0.15) 7px);
}

.soft-sell {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.soft-sell__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0 0 6px;
  text-align: center;
}
.soft-sell__lede {
  text-align: center;
  margin: 0 auto 20px;
  max-width: 36em;
}
.soft-sell__grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .soft-sell__grid { grid-template-columns: 1fr 1fr; }
}
.preorder-card {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.preorder-card--featured {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.12), 0 0 24px rgba(57, 255, 20, 0.1);
}
.preorder-card__badge {
  position: absolute;
  top: -10px;
  right: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}
.preorder-card__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.preorder-card__price {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}
.preorder-card__price .muted { font-family: var(--font-body); font-size: 0.85rem; }
.preorder-card__perk {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--muted);
  flex: 1;
}
.preorder-card .btn { margin-top: auto; }

/* —— Footer —— */
.signup-footer {
  text-align: center;
  padding: 20px 16px 32px;
  border-top: 1px solid var(--line);
}
.signup-footer p { margin: 0; }
