/* Onboarding wizard (pages/onboarding.cljs) and the audience picker it
   shares with Product (components/audience_picker.cljs, audience_card.cljs):
   each step's fields in one white panel on the grey page, the step's
   primary action the one amber button (docs/design-system.md, Surfaces). The
   shell itself lives in shell.css. */

.wizard-shell--loading,
.wizard-shell--failed {
  align-items: center;
  justify-content: center;
}

.wizard__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.wizard__panels {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.wizard__tab-panel {
  margin-top: var(--space-6);
}

.wizard__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.audience-picker__note {
  margin: 0;
  font-size: var(--text-note);
  color: var(--color-text-muted);
}

.wizard__muted,
.audience-picker__muted {
  margin: 0;
  color: var(--color-text-muted);
}

/* A failed load: its message and Try again under it. */
.wizard__failure,
.audience-picker__error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

/* The empty product image is the one thing still blocking Next: its drop
   zone is outlined in the warning color with a note above it. */
.wizard__required {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.wizard__required-note {
  margin: 0;
  font-size: var(--text-note);
  color: var(--color-warning);
}

.wizard__required .file-drop-zone {
  border-color: var(--color-warning);
}

.wizard__required .file-drop-zone:hover,
.wizard__required .file-drop-zone--dragover {
  border-color: var(--color-text);
}

/* The Promo slide screen: the upload as the card's one control. After the
   upload the drop zone stays at the top and the pool's photos are listed
   under it, six to a row, wrapping. */
.wizard-promo__upload .file-drop-zone {
  box-sizing: border-box;
  padding: var(--space-12) var(--space-10);
}

.wizard-promo__pool {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.wizard-promo__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.wizard-promo__label {
  margin: 0;
  font-size: var(--text-note);
  color: var(--color-text-muted);
}

.wizard-promo__thumbs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
}

.wizard-promo__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--color-bg-page);
  border-radius: var(--radius-thumb);
}

.wizard__fonts-error {
  margin: 0 0 var(--space-4);
}

/* The cards of the Batch screen, spaced as Studio's step cards. */
.wizard__steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.wizard__done {
  text-align: center;
}

/* The loading rule (docs/design-system.md, Wizard): while a screen waits,
   its final layout stands as a skeleton under one muted status line, the
   placeholders pulsing on the spots where the values land. Under reduced
   motion they stand still. */
.wizard-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-note);
  color: var(--color-text-muted);
}

.wizard-status::before {
  content: '';
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-text);
  animation: wizard-pulse 1.2s var(--ease-default) infinite;
}

.wizard-skeleton {
  display: block;
  background: var(--color-bg-control);
  border-radius: var(--radius-media);
  animation: wizard-pulse var(--duration-skeleton-pulse) var(--ease-default) infinite;
}

@keyframes wizard-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .wizard-status::before,
  .wizard-skeleton {
    animation: none;
  }
}

/* The sizes of the controls they stand for: the text input, the
   six-row description, the type chip (`ui/Tag`), the choice row. */
.wizard-skeleton--field,
.wizard-skeleton--row    { height: var(--control-height); border-radius: var(--border-radius); }
.wizard-skeleton--textarea { height: 164px; border-radius: var(--border-radius); }
.wizard-skeleton--chip   { height: 36px; border-radius: var(--border-radius); }
.wizard-skeleton--line   { height: 14px; }
.wizard-skeleton--icon   { width: 16px; height: 16px; flex-shrink: 0; }
.wizard-skeleton--name   { height: 18px; }
.wizard-skeleton--count  { width: 56px; height: 14px; }
.wizard-skeleton--slide  { aspect-ratio: 9 / 16; }
.wizard-skeleton--button { height: 26px; }

.wizard-skeleton__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.wizard-skeleton__rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.wizard-skeleton__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
}

.wizard-skeleton__label {
  font-size: var(--text-note);
  color: var(--color-text-muted);
}

.wizard-skeleton__value {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-1) 0 0;
}

/* The chosen audience on the Audience screen: each field its label over
   its value, the pencil at its right; an edited field holds its text box
   and Save / Cancel in the value's place. The fields and the own audience's
   form fill the detail column (640). */
.wizard-audience__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
}

.wizard-audience__field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: var(--space-3);
}

.wizard-audience__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.wizard-audience__label {
  font-size: var(--text-note);
  color: var(--color-text-muted);
}

.wizard-audience__value {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  color: var(--color-text);
}

.wizard-audience__value--strong {
  font-weight: var(--weight-semibold);
}

.wizard-audience__edit-actions {
  display: flex;
  gap: var(--space-2);
}

.wizard-skeleton__result {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

/* Result: three cards across the work area, a third each. */
.wizard-result__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

@media (max-width: 860px) {
  .wizard-result__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.wizard-skeleton__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--color-bg-surface);
  border-radius: var(--radius-media);
}

.wizard-skeleton__actions {
  display: flex;
  gap: var(--space-2);
}

/* Audience picker: four candidate panels two across, the picker's
   actions under them. */
.audience-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.audience-picker__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.audience-picker__loading {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.audience-picker__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: var(--space-6);
  background: var(--color-bg-surface);
  border-radius: var(--border-radius);
  font-size: var(--text-note);
  color: var(--color-text-muted);
}

.audience-picker__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.audience-picker__actions--custom {
  justify-content: space-between;
}

/* A candidate audience: a panel of label-and-value rows and the sample
   hook under them. The selected one is outlined in ink, the color of a
   selected chip: amber marks only previews. */
.audience-card {
  position: relative;
  height: 100%;
  border-radius: var(--border-radius);
}

.audience-card--selected {
  box-shadow: 0 0 0 2px var(--color-text);
}

.audience-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.audience-card__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.audience-card__row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-2);
}

.audience-card__label {
  font-size: var(--text-note);
  color: var(--color-text-muted);
}

.audience-card__value {
  color: var(--color-text);
}

.audience-card__value--strong {
  font-weight: var(--weight-semibold);
}

.audience-card__hook {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.audience-card__hook-text {
  font-style: italic;
  color: var(--color-text);
}

.audience-card__edit {
  position: absolute;
  right: var(--space-4);
  bottom: var(--space-4);
}

@media (max-width: 860px) {
  .audience-picker__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
