/* ════════════════════════════════════════════════════════════════════════
   UBILD · job builder wizard
   ════════════════════════════════════════════════════════════════════════ */

.wizard {
  max-width: 720px; margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) clamp(18px, 4vw, 24px) 80px;
  min-height: calc(100svh - 72px);
  display: flex; flex-direction: column;
}

/* ── progress ────────────────────────────────────────────────────────────── */

.progress { margin-bottom: 26px; }
.progress-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.progress-top .step-name { color: var(--primary-deep); font-weight: 500; }
.progress-track {
  height: 6px; border-radius: 999px; background: var(--surface-3);
  overflow: hidden; border: 1px solid var(--line);
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--primary-soft), var(--primary));
  border-radius: 999px;
  transition: width 0.5s var(--ease-out);
}

/* ── card ────────────────────────────────────────────────────────────────── */

.card-stage { position: relative; flex: 1; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: clamp(26px, 4vw, 40px);
  box-shadow: var(--shadow-md);
  transition: opacity 0.32s var(--ease-out), transform 0.32s var(--ease-out);
}
.card.leaving { opacity: 0; transform: translateY(-12px); }
.card.entering { opacity: 0; transform: translateY(16px); }

.card-icon {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--primary-wash); color: var(--primary-deep);
  margin-bottom: 18px;
}
.card-icon svg { width: 24px; height: 24px; }
.card-eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 8px;
}
.card h2 { font-size: clamp(1.5rem, 3.4vw, 2.05rem); margin-bottom: 8px; text-wrap: balance; }
.card .helper { color: var(--muted); margin: 0 0 24px; font-size: 0.98rem; }

/* inputs inside the card */
.card .big-input,
.card textarea.big-input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text);
  padding: 14px 16px; font: inherit; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.card .big-input:focus { border-color: var(--primary); background: var(--surface); box-shadow: var(--ring); }
.card textarea.big-input { min-height: 220px; resize: vertical; line-height: 1.6; }
.card .input-suffix { display: flex; align-items: center; gap: 12px; }
.card .input-suffix .big-input { max-width: 180px; }
.card .input-suffix .suffix-label { color: var(--muted); font-size: 0.96rem; }
.dates-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dates-grid label { display: grid; gap: 7px; font-size: 0.84rem; font-weight: 600; color: var(--text-soft); }
@media (max-width: 520px) { .dates-grid { grid-template-columns: 1fr; } }

.field-note { font-size: 0.84rem; color: var(--faint); margin: 12px 0 0; }
.inline-err { color: var(--bad); font-size: 0.86rem; margin: 12px 0 0; }
.inline-err[hidden] { display: none; }

.rv-empty { color: var(--muted); font-style: italic; }

/* ── card controls ───────────────────────────────────────────────────────── */

.card-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 30px;
}
.card-controls .right { display: flex; align-items: center; gap: 10px; }

/* ── review ──────────────────────────────────────────────────────────────── */

.review-list { display: grid; gap: 2px; margin-bottom: 8px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.review-row {
  display: grid; grid-template-columns: 168px 1fr auto; gap: 16px; align-items: start;
  padding: 16px 18px; background: var(--surface-2);
}
.review-row + .review-row { border-top: 1px solid var(--line); }
.review-row dt {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin: 2px 0 0;
}
.review-row dd { margin: 0; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.review-row dd.empty { color: var(--faint); font-style: italic; }
.review-row dd ul { margin: 0; padding-left: 18px; }
.review-row dd ul li { margin-bottom: 4px; }
.review-edit {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  color: var(--primary-deep); font-size: 0.78rem; font-weight: 600;
  padding: 5px 13px; white-space: nowrap;
  transition: all 0.2s;
}
.review-edit:hover { border-color: var(--primary-soft); background: var(--primary-wash); }
@media (max-width: 560px) {
  .review-row { grid-template-columns: 1fr auto; }
  .review-row dt { grid-column: 1; }
  .review-row .review-edit { grid-column: 2; grid-row: 1; }
  .review-row dd { grid-column: 1 / -1; }
  .review-row .rv-err { grid-column: 1 / -1; }
}

/* inline editing: the Edit button becomes Save, the value becomes an editor */
.review-row.editing { background: var(--surface); }
.review-edit.is-save {
  background: var(--primary-ink); color: #fff; border-color: transparent;
}
.review-edit.is-save:hover { background: var(--primary-deep); border-color: transparent; }
.rv-input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text);
  padding: 10px 12px; font: inherit; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.rv-input:focus { border-color: var(--primary); background: var(--surface); box-shadow: var(--ring); }
.rv-textarea { resize: vertical; line-height: 1.6; min-height: 120px; }
.rv-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rv-dates label { display: grid; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--text-soft); }
@media (max-width: 460px) { .rv-dates { grid-template-columns: 1fr; } }
.rv-err { grid-column: 1 / -1; color: var(--bad); font-size: 0.84rem; margin: 8px 0 0; }
.rv-err[hidden] { display: none; }

/* ── option cards (worker selection step) ────────────────────────────────── */

.delivery-option {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  border: 1.5px solid var(--primary); background: var(--primary-wash);
  border-radius: var(--r-md); padding: 16px 18px; cursor: default;
}
/* Worker selection: two cards, pick one. Unpicked cards sit on the surface. */
.select-options { display: flex; flex-direction: column; gap: 12px; }
.select-option { cursor: pointer; border-color: var(--line-strong); background: var(--surface); font: inherit; transition: border-color .15s, background .15s; }
.select-option:hover { border-color: var(--primary-soft); }
.select-option:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.select-option.is-on { border-color: var(--primary); background: var(--primary-wash); }
.select-option:not(.is-on) .do-icon { background: var(--primary-wash); color: var(--primary-deep); }
.delivery-option .do-icon {
  flex: none; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; background: var(--primary-ink); color: #fff;
}
.delivery-option .do-icon svg { width: 21px; height: 21px; }
.delivery-option .do-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.delivery-option .do-title { font-weight: 700; color: var(--text); font-size: 1rem; }
.delivery-option .do-desc { color: var(--text-soft); font-size: 0.88rem; line-height: 1.45; }

.review-cta { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.review-cta .hint { text-align: center; color: var(--faint); font-size: 0.86rem; margin: 0; }

/* ── multi-site (location step) + per-day site assignment (dates step) ───── */

.ms-toggle {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 14px; font-weight: 600; font-size: 0.94rem; color: var(--text-soft);
  cursor: pointer; user-select: none;
}
.ms-toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
.ms-row input[type='text'] {
  flex: 1; min-height: 44px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text);
  padding: 11px 13px; font: inherit; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.ms-row input[type='text']:focus { border-color: var(--primary); background: var(--surface); box-shadow: var(--ring); }
.ms-row .ac-wrap { flex: 1; }
.ms-row .ac-wrap input[type='text'] { width: 100%; }

.site-assign-head { margin-top: 18px; font-weight: 600; color: var(--text-soft); }
.site-assign { display: grid; gap: 8px; margin-top: 10px; }
.site-assign-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); padding: 8px 12px; font-size: 0.9rem;
}
.site-assign-row > span { font-weight: 600; color: var(--text-soft); white-space: nowrap; }
.site-assign-sites { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 72%; }
.site-assign-row select {
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); padding: 7px 9px; font: inherit; font-size: 0.86rem;
}
.site-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); padding: 5px 6px 5px 11px; font-size: 0.82rem;
}
.site-chip button {
  border: 0; background: none; color: var(--text-soft); font-size: 1rem;
  line-height: 1; padding: 0 4px; cursor: pointer;
}
.site-chip button:hover { color: var(--text); }
.site-assign-row select.site-add {
  border-style: dashed; color: var(--text-soft); max-width: 110px;
}

/* ── parse loading state ─────────────────────────────────────────────────── */

.loader {
  text-align: center; padding: 64px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.loader .ring {
  width: 56px; height: 56px; border-radius: 50%;
  border: 4px solid var(--surface-3); border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
.loader h2 { font-size: 1.4rem; }
.loader p { color: var(--muted); margin: 0; max-width: 40ch; }
.loader .prompt-echo {
  font-family: var(--font-display); font-weight: 500; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 18px; max-width: 48ch;
  box-shadow: var(--shadow-sm);
}

/* ── auth veil extras (signup grid) ──────────────────────────────────────── */

.auth-back {
  background: none; border: 0; color: var(--muted); font-weight: 600;
  font-size: 0.86rem; padding: 6px 0; margin-bottom: 6px;
  display: inline-flex; align-items: center; gap: 6px;
}
.auth-back:hover { color: var(--text); }
.auth-stage[hidden] { display: none; }
.auth-foot { text-align: center; color: var(--faint); font-size: 0.82rem; margin: 16px 0 0; }

/* Per-site supervisor fields (multi-site editor). */
.ms-fields { flex: 1; min-width: 0; display: grid; gap: 6px; }
.ms-sup { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ms-sup input {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text);
  padding: 8px 11px; font: inherit; font-size: 0.85rem; outline: none;
}
.ms-sup input:focus { border-color: var(--primary); background: var(--surface); }
.ms-sup--primary { margin-bottom: 12px; }

/* budget step: min-max range inputs side by side */
.budget-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.budget-row .input-suffix { flex: 0 1 180px; }
.budget-row .big-input { width: 100%; }
.budget-dash { color: var(--muted); font-weight: 600; }
.budget-unit { color: var(--muted); font-size: 0.9rem; flex-basis: 100%; }
.budget-suggest { color: var(--primary-deep); font-size: 0.9rem; margin: 14px 0 0; }
.budget-warn {
  color: #9a6a00; background: #fdf1d8; border: 1px solid rgba(176, 122, 0, 0.28);
  border-radius: var(--r-sm); padding: 10px 14px; font-size: 0.88rem; margin: 14px 0 0;
}
.budget-warn[hidden] { display: none; }
.rv-budget { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }

/* description step: "your prompt was vague" nudge from the AI parse */
.desc-gaps {
  color: #9a6a00; background: #fdf1d8; border: 1px solid rgba(176, 122, 0, 0.28);
  border-radius: var(--r-sm); padding: 12px 14px; font-size: 0.88rem; margin: 14px 0 0;
}
.desc-gaps p { margin: 0 0 6px; font-weight: 600; }
.desc-gaps ul { margin: 0; padding-left: 18px; }
.desc-gaps li { margin: 2px 0; }

/* required certifications step: one tappable checkbox card per cert */
.cert-checks { display: grid; gap: 10px; }
.cert-check {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text);
  padding: 13px 15px; font-weight: 600; cursor: pointer;
}
.cert-check:hover { border-color: var(--primary-soft); background: var(--primary-wash); }
.cert-check:has(input:checked) { border-color: var(--primary); background: var(--primary-wash); }
.cert-check input { width: 17px; height: 17px; accent-color: var(--primary); flex: none; }

/* job term: two tappable option cards, same visual language as cert-check */
.term-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.term-opt {
  display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text);
  padding: 13px 15px; cursor: pointer;
}
.term-opt:hover { border-color: var(--primary-soft); background: var(--primary-wash); }
.term-opt.is-on { border-color: var(--primary); background: var(--primary-wash); }
.term-opt input { position: absolute; opacity: 0; pointer-events: none; }
.term-opt strong { font-weight: 700; }
.term-opt span { color: var(--muted); font-size: 0.85rem; }
@media (max-width: 480px) { .term-seg { grid-template-columns: 1fr; } }

/* requirements step: tools chips + vehicle toggle under the cert checkboxes */
.req-sub { margin: 18px 0 8px; color: var(--muted); font-size: 0.92rem; font-weight: 600; }
.req-opt { font-weight: 400; }
.req-vehicle { margin-top: 16px; }
/* who supplies the tools: same option cards as the cert checks (0160) */
.tool-src { display: grid; gap: 10px; }
.req-text { min-height: 120px; }
.req-note { margin: 12px 0 0; color: var(--muted); font-size: 0.85rem; }
.tool-chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); padding: 8px 10px;
}
.tool-chips input {
  flex: 1; min-width: 160px; border: none; outline: none; background: transparent;
  color: var(--text); font: inherit; font-size: 0.95rem; padding: 5px 2px;
}
.tool-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-wash); border: 1px solid var(--primary-soft);
  color: var(--primary-deep); border-radius: 999px;
  padding: 4px 10px; font-size: 0.86rem; font-weight: 600;
}
.tool-chip button {
  border: none; background: none; color: inherit; cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0;
}
