/*
 * Onboarding wizard primitives (TextField, Button, DropZone, UploadedImageCard,
 * RequiredBadge/HintBadge, Stepper, FooterNav) plus Screen 1's own layout —
 * `docs/phase-5a.md`'s "ported design system". Class names are plain
 * BEM-ish (`wz-*`) rather than CSS-module-scoped, since there's no bundler here.
 */

.wz-shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.wz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 30px;
  border-bottom: 1px solid var(--color-border-shell);
  position: sticky;
  top: 0;
  background: rgba(16, 15, 19, 0.88);
  backdrop-filter: blur(10px);
  z-index: 9;
  flex-wrap: wrap;
}

.wz-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.wz-brand__dot {
  width: 26px;
  height: 26px;
  background: var(--color-accent);
  border-radius: 7px;
  box-shadow: 0 0 16px rgba(194, 242, 74, 0.5);
}

.wz-brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 22px;
}

.wz-brand__badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--color-accent-ink);
  background: var(--color-pink);
  border: var(--border-width-thin) solid var(--color-accent-ink);
  border-radius: 6px;
  padding: 2px 9px;
  margin-left: 6px;
  font-weight: 700;
  transform: rotate(-4deg);
  display: inline-block;
}

/* Stepper */
.wz-stepper {
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin: 32px 0 0;
}

.wz-stepper__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wz-stepper__connector {
  flex: 1;
  height: var(--border-width-hairline);
  background: var(--color-border-sub);
  margin: 17px 10px 0;
}

.wz-stepper__circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: var(--border-width) solid var(--color-border-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--color-surface);
  color: var(--color-step-upcoming);
  flex: none;
}

.wz-stepper__circle--active {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

.wz-stepper__circle--done {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.wz-stepper__label {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--color-step-upcoming);
  white-space: nowrap;
}

.wz-stepper__label--active {
  font-weight: 700;
  color: var(--color-ink);
}

/* Screen */
.wz-screen {
  margin: 44px auto 0;
}

.wz-screen__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-pink);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wz-screen__title {
  /* Fluid: 52px is right at the 680px shell's full desktop width but dominates
   * ~85% of the column at 768px. Scales with the viewport between 36px and 52px
   * so the display type keeps its drama wide up without overwhelming tablet. */
  font-size: clamp(36px, 5.5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0 10px;
  line-height: 0.98;
}

.wz-screen__intro {
  font-size: 16px;
  color: var(--color-muted);
  margin: 0 0 32px;
  max-width: 52ch;
  line-height: 1.5;
}

/* Field / label row */
.wz-field {
  display: block;
  margin-bottom: 26px;
}

.wz-field__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 9px;
}

.wz-field__label-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.wz-field__label {
  font-weight: 700;
  font-size: 14px;
}

.required-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: var(--color-muted-2);
  border: var(--border-width-hairline) solid var(--color-border-sub);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.hint-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--color-muted-2);
  border: var(--border-width-hairline) solid var(--color-border-sub);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

/* TextField */
.text-field {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-body);
  color: var(--color-ink);
  border: var(--border-width) solid var(--color-border-sub);
  background: var(--color-surface);
  outline: none;
  font-size: var(--text-compact);
  padding: 12px 15px;
  border-radius: var(--radius-md);
}

.text-field:focus {
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

.text-field--large {
  font-size: var(--text-large);
  font-weight: 600;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
}

.text-field--default {
  font-size: var(--text-default);
  padding: 13px 15px;
}

.text-field--mono {
  font-family: var(--font-mono);
  font-size: var(--text-compact-mono);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
}

/* Bio counter */
.wz-bio-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-muted-2);
}

.wz-bio-count--warn {
  color: var(--color-coral);
}

/* Links */
.wz-links__intro {
  font-size: 13px;
  color: var(--color-muted-2);
  margin: 0 0 12px;
}

.wz-links__rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wz-links__row {
  display: flex;
  gap: 9px;
  align-items: center;
}

.wz-links__label-field {
  width: 130px;
  flex: none;
}

.wz-links__url-field {
  flex: 1;
  min-width: 0;
}

.wz-links__add {
  margin-top: 12px;
}

/* Buttons */
.button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  padding: 12px 20px;
}

.button--primary {
  font-weight: 800;
  border: var(--border-width) solid var(--color-accent-ink);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  box-shadow: var(--shadow-offset) var(--color-ink);
}

.button--primary:disabled {
  border-color: var(--color-disabled-border);
  background: var(--color-disabled-bg);
  color: var(--color-disabled-text);
  box-shadow: none;
  cursor: not-allowed;
}

.button--secondary {
  border: var(--border-width) solid var(--color-ink);
  background: var(--color-surface);
  color: var(--color-ink);
}

.button--ghost {
  font-weight: 600;
  font-size: 12.5px;
  padding: 7px 13px;
  border: var(--border-width-thin) solid var(--color-ink);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-ink);
}

.button--ghost-muted {
  font-weight: 600;
  font-size: 12.5px;
  padding: 7px 13px;
  border: var(--border-width-thin) solid var(--color-border-mut);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-muted-2);
}

.button--text {
  font-weight: 700;
  font-size: 13px;
  color: var(--color-accent);
  background: none;
  border: none;
  padding: 4px 0;
}

.button--icon {
  flex: none;
  width: 38px;
  height: 38px;
  border: var(--border-width-thin) solid var(--color-border-mut);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-muted-2);
  font-size: 16px;
  cursor: pointer;
}

/* DropZone */
.drop-zone {
  border: var(--border-width) dashed var(--color-border-sub);
  border-radius: var(--radius-xl);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--color-surface);
}

.drop-zone--dragover {
  border-color: var(--color-accent);
  background: var(--color-accent-wash);
}

.drop-zone__icon {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 10px;
  color: var(--color-accent);
}

.drop-zone__title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 3px;
}

.drop-zone__subtitle {
  font-size: 13.5px;
  color: var(--color-muted);
  margin-bottom: 12px;
}

.drop-zone__browse {
  color: var(--color-accent);
  font-weight: 700;
  text-decoration: underline;
}

.drop-zone__format {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-muted-2);
}

/* UploadedImageCard */
.uploaded-card {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: stretch;
  background: var(--color-surface-2);
  border: var(--border-width) solid var(--color-ink);
  border-radius: var(--radius-xl);
  padding: 12px;
  box-shadow: var(--shadow-offset) var(--color-accent);
}

.uploaded-card__preview {
  position: relative;
  width: 150px;
  flex: none;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  overflow: hidden;
  border: var(--border-width-thin) solid var(--color-border-sub);
  background: var(--color-surface-3);
}

.uploaded-card__preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.uploaded-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 2px 0;
}

.uploaded-card__status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-success);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 5px;
}

.uploaded-card__filename {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uploaded-card__actions {
  display: flex;
  gap: 9px;
  margin-top: 12px;
}

/* FooterNav */
.wz-footer-nav {
  margin: 40px auto 0;
}

.wz-footer-nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

/* Error text — save failures (behavior 3) */
.wz-field__error {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-coral);
  margin-top: 8px;
}

/* --- Screen 2: releases (docs/phase-5b.md) --- */

/* Release tabs */
.release-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.release-tabs__item {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.release-tab {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 14px;
  border: var(--border-width) solid var(--color-border-sub);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-muted);
  cursor: pointer;
  max-width: 220px;
}

.release-tab__label {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-tab--active {
  border-color: var(--color-accent-ink);
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

.release-tab--add {
  border-style: dashed;
  color: var(--color-accent);
}

.release-tab__close {
  flex: none;
  width: 22px;
  margin-left: -6px;
  border: none;
  background: none;
  color: var(--color-muted-2);
  font-size: 13px;
  cursor: pointer;
  opacity: 0.7;
}

.release-tab__close:hover {
  opacity: 1;
  color: var(--color-coral);
}

/* The close button is a sibling of the pill, not a child: only 6px of its 22px
 * overlaps the tab, so it sits on the page background even for the active tab.
 * `--color-accent-ink` here rendered it near-invisible (1.03:1 on `--color-bg`). */
.release-tab--active + .release-tab__close {
  color: var(--color-ink);
  opacity: 0.85;
}

/* Release panels — only the active panel is shown */
.wz-release-panel {
  margin-bottom: 8px;
}

/* TrackRow — three body states (uploading/success/error) */
.track-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--color-surface-2);
  border: var(--border-width) solid var(--color-border-sub);
  border-radius: var(--radius-md);
}

.track-row__grip,
.wz-artist-row__grip {
  flex: none;
  width: 22px;
  color: var(--color-muted-2);
  font-size: 16px;
  cursor: grab;
  touch-action: none; /* let pointermove drive reorder, not scroll */
  user-select: none;
  text-align: center;
}

.track-row__grip:active,
.wz-artist-row__grip:active {
  cursor: grabbing;
}

.track-row__main {
  flex: 1;
  min-width: 0;
}

/* The title is a rename field, but a row should still read as a row: no chrome
   until you reach for it, full `.text-field` treatment on hover/focus. */
.track-row__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-ink);
  padding: 2px 4px;
  border-color: transparent;
  background: transparent;
  border-radius: var(--radius-sm);
}

.track-row__title:hover,
.track-row__title:focus {
  border-color: var(--color-border-sub);
  background: var(--color-surface);
}

.track-row__meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  margin-top: 3px;
}

.track-row__meta--uploading {
  color: var(--color-muted-2);
}

.track-row__meta--success {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--color-success);
  font-weight: 700;
}

.track-row__meta--error {
  color: var(--color-coral);
}

.track-row__progress {
  height: 5px;
  margin-top: 7px;
  border-radius: var(--radius-pill);
  background: var(--color-border-sub);
  overflow: hidden;
}

.track-row__progress-bar {
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
  transition: width 0.12s linear;
}

.track-row__actions {
  flex: none;
  display: flex;
  gap: 7px;
}

/* Drag state — lime border + hard shadow + lift while dragging */
.track-row.dragging,
.wz-artist-row.dragging {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-offset) var(--color-accent);
  background: var(--color-accent-wash);
  z-index: 2;
  position: relative;
}

/* Release-artist rows — same shape as link rows, plus a reorder grip */
.wz-artist-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wz-artist-row {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 6px 10px 6px 4px;
  background: var(--color-surface-2);
  border: var(--border-width) solid var(--color-border-sub);
  border-radius: var(--radius-md);
}

.wz-artist-row__name {
  flex: 1;
  min-width: 0;
}

/* FooterNav — per-screen; the hint sits above the row */
.wz-footer-nav__hint {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--color-muted-2);
  text-align: right;
  margin-bottom: 10px;
}

.wz-footer-nav__hint--ready {
  color: var(--color-success);
}

/* Stepper clickable circles (5b makes step 2 real, 5c-1 adds step 3) */
.wz-stepper__circle--clickable {
  cursor: pointer;
}

.wz-stepper__circle--clickable:hover {
  border-color: var(--color-accent);
}

/* --- Screen 3: look/theme (docs/phase-5c-1.md) --- */

.theme-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 560px) {
  .theme-cards {
    grid-template-columns: 1fr;
  }
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  text-align: left;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border-sub);
  border-radius: var(--radius-xl);
  cursor: pointer;
}

.theme-card--selected {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-offset) var(--color-accent);
}

.theme-card__mock {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: var(--border-width-thin) solid var(--color-border-sub);
  border-radius: var(--radius-md);
}

.theme-card__mock--auto {
  background: linear-gradient(135deg, #f3f0e9 50%, #100f13 50%);
}

.theme-card__mock--light {
  background: #f3f0e9;
}

.theme-card__mock--dark {
  background: #100f13;
}

.theme-card__mock-bar {
  width: 40%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}

.theme-card__mock-line {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(128, 128, 128, 0.4);
}

.theme-card__mock-line--short {
  width: 60%;
}

.theme-card__name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.theme-card__name {
  font-weight: 700;
  font-size: 14px;
}

.theme-card__check {
  color: var(--color-accent);
  font-weight: 800;
}

.theme-card__desc {
  font-size: 12.5px;
  color: var(--color-muted);
  line-height: 1.4;
  margin-top: 4px;
}

.wz-footer-nav__actions {
  display: flex;
  gap: 10px;
}

/* --- Success screen (docs/phase-5c-3.md) --- */

.success-url-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
}

.success-url-bar__input {
  flex: 1;
  min-width: 0;
  cursor: text;
}

.success-url-bar__copy {
  flex: none;
  white-space: nowrap;
}

.success-preview {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--color-surface-2);
  border: var(--border-width) solid var(--color-ink);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-offset) var(--color-accent);
  margin-bottom: 32px;
}

.success-preview__cover {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-border-mut);
  border: var(--border-width-thin) solid var(--color-border-sub);
}

.success-preview__body {
  flex: 1;
  min-width: 0;
}

.success-preview__band {
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 3px;
}

.success-preview__release {
  font-size: 13.5px;
  color: var(--color-muted);
  margin-bottom: 10px;
}

.success-preview__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.success-view-link {
  display: inline-flex;
  text-decoration: none;
}

/* --- Publish progress overlay (plan §5) --- */

.publish-progress {
  margin-top: 8px;
}

.publish-progress__bar {
  height: 8px;
  border-radius: 999px;
  background: var(--color-surface-2);
  border: var(--border-width-thin) solid var(--color-border-sub);
  overflow: hidden;
}

.publish-progress__fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--color-accent) 0%,
    var(--color-border-mut) 50%,
    var(--color-accent) 100%
  );
  background-size: 200% 100%;
  animation: publish-progress-shimmer 1.4s ease-in-out infinite;
}

@keyframes publish-progress-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.publish-progress__stage {
  margin-top: 14px;
  font-size: 14px;
  color: var(--color-muted);
}

/* Field hint — a one-line explainer under a field label (phase 3). */
.wz-field__hint {
  font-size: 13px;
  color: var(--color-muted-2);
  margin: 0 0 12px;
}

/* Subdomain / web-address picker (phase 3) */
.subdomain-field {
  display: flex;
  align-items: stretch;
}

.subdomain-field__input {
  flex: 1 1 auto;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  font-family: var(--font-mono);
}

.subdomain-field__suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  font-family: var(--font-mono);
  font-size: var(--text-compact-mono);
  color: var(--color-muted-2);
  background: var(--color-surface-2);
  border: var(--border-width) solid var(--color-border-sub);
  border-left: none;
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  white-space: nowrap;
}

.subdomain-field__status {
  margin-top: 8px;
  font-size: 13px;
  min-height: 1.2em;
  color: var(--color-muted-2);
}

.subdomain-field__status[data-state="checking"] {
  color: var(--color-muted);
}

.subdomain-field__status[data-state="available"] {
  color: var(--color-success);
}

.subdomain-field__status[data-state="taken"],
.subdomain-field__status[data-state="error"] {
  color: var(--color-coral);
}

/* --- Claim dialog (stage 2 task C) — the voluntary early login/signup --- */

.wz-header__account {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Touch tier — 768px is iPad-portrait, a touch device, but every control
 *   here was sized for the desktop mouse path. Grow the smallest ones to a
 *   tappable size on narrow widths (phones and tablets). Gated by width, not
 *   `(pointer: coarse)`, so the 768px screenshot harness — fine-pointer desktop
 *   Chromium — actually reflects the change (a coarse-pointer query would be
 *   invisible to it). --- */
@media (max-width: 820px) {
  /* The "⋮" row-menu trigger (dashboard rows, wizard). 38px is under the
   * 44px touch minimum; 44px is the standard icon-button size. */
  .button--icon {
    width: 44px;
    height: 44px;
  }

  /* Ghost buttons ("View live", modal "Cancel", …) are ~33px tall at their
   * 7px vertical padding. Symmetric padding reaches ~44px while keeping the
   * label vertically centred — no `display`/`flex` change, so the inline
   * layouts these buttons live in aren't disturbed. */
  .button--ghost,
  .button--ghost-muted {
    padding-top: 13px;
    padding-bottom: 13px;
  }
}
