/* ─────────────────────────────────────────────────────────────
 * yupa.co/post — the job builder.
 *
 * One question per screen. The layout is deliberately plain: a progress hair
 * at the top, one large question, one input, Back and Continue pinned to the
 * bottom on mobile. Nothing else is on screen, because every extra element on
 * a step is something to read instead of answering.
 *
 * Uses the site's own tokens from styles.css — this file only adds what the
 * flow needs.
 * ───────────────────────────────────────────────────────────── */

.jf {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── Progress ──────────────────────────────────────────────── */
.jf-progress {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 3px;
  background: var(--line-2);
  flex: none;
}
.jf-progress-bar {
  height: 100%;
  width: 0;
  background: var(--grad);
  border-radius: 0 var(--r-full) var(--r-full) 0;
  transition: width .32s cubic-bezier(.4, 0, .2, 1);
}

.jf-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--pad);
  flex: none;
}
.jf-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
}
.jf-brand img { height: 22px; width: auto; display: block; }
.jf-step-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ── The question area ─────────────────────────────────────── */
.jf-main {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  padding: 8px var(--pad) 28px;
}
.jf-card {
  width: 100%;
  max-width: 560px;
}

.jf-step { display: none; }
.jf-step.is-active {
  display: block;
  animation: jf-in .26s cubic-bezier(.4, 0, .2, 1);
}
@keyframes jf-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .jf-step.is-active { animation: none; }
  .jf-progress-bar { transition: none; }
}

.jf-q {
  font-family: var(--font-display);
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 18px 0 8px;
  color: var(--ink);
}
.jf-hint {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 22px;
  max-width: 46ch;
}

/* ── Option lists ──────────────────────────────────────────── */
.jf-options {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
/* Two columns only when a column is genuinely wide enough for the label.
 * At 375px, 160px columns broke "Cleaning & laundry" over three lines and made
 * every tile as tall as the longest one — one column reads far better there. */
.jf-options.jf-options--two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.jf-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 15px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .1s;
}
.jf-opt:hover { border-color: var(--lav); }
.jf-opt:active { transform: scale(.995); }
.jf-opt[aria-pressed="true"] {
  border-color: var(--lav-deep);
  background: var(--bg-tint);
}
.jf-opt .jf-emoji { font-size: 20px; line-height: 1; flex: none; }
.jf-opt .jf-opt-note {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-top: 2px;
}
.jf-opt-body { min-width: 0; }
.jf-opt .jf-check {
  margin-left: auto;
  flex: none;
  opacity: 0;
  color: var(--lav-deep);
  transition: opacity .16s;
}
.jf-opt[aria-pressed="true"] .jf-check { opacity: 1; }

/* ── Inputs ────────────────────────────────────────────────── */
.jf-input,
.jf-textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* 16px or iOS zooms the page on focus */
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  transition: border-color .16s;
}
.jf-textarea { min-height: 132px; resize: vertical; line-height: 1.55; }
.jf-input:focus,
.jf-textarea:focus { outline: none; border-color: var(--lav-deep); }
.jf-input::placeholder,
.jf-textarea::placeholder { color: var(--ink-3); }

.jf-counter {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.jf-row { display: flex; gap: 10px; flex-wrap: wrap; }
.jf-row > * { flex: 1 1 150px; }

.jf-note {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
}
.jf-warn {
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #b4541f;
  min-height: 18px;
}

/* ── Price chips ───────────────────────────────────────────── */
.jf-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.jf-chip {
  flex: 1 1 96px;
  padding: 14px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: border-color .16s, background .16s;
}
.jf-chip[aria-pressed="true"] {
  border-color: var(--lav-deep);
  background: var(--bg-tint);
}
.jf-chip .jf-chip-amt {
  display: block;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
}
.jf-chip .jf-chip-lbl {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  margin-top: 2px;
}

/* ── Days ──────────────────────────────────────────────────── */
.jf-days { display: flex; gap: 7px; flex-wrap: wrap; }
.jf-day {
  flex: 1 1 40px;
  min-width: 42px;
  padding: 12px 0;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .16s, background .16s, color .16s;
}
.jf-day[aria-pressed="true"] {
  border-color: var(--lav-deep);
  background: var(--bg-tint);
  color: var(--ink);
}

/* ── Summary ───────────────────────────────────────────────── */
.jf-summary {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-soft);
  padding: 6px 16px;
  margin-bottom: 20px;
}
.jf-sum-row {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.jf-sum-row:last-child { border-bottom: 0; }
.jf-sum-k {
  flex: none;
  width: 92px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.jf-sum-v { flex: 1; font-size: 15px; font-weight: 600; color: var(--ink); min-width: 0; }

/* ── Actions ───────────────────────────────────────────────── */
.jf-actions {
  position: sticky;
  bottom: 0;
  flex: none;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
}
.jf-actions-inner {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
}
.jf-back {
  flex: none;
  width: 52px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-full);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.jf-back:disabled { opacity: .35; cursor: default; }
.jf-next {
  flex: 1;
  padding: 15px 22px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--grad);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--sh-md);
  transition: opacity .16s, transform .1s;
}
.jf-next:disabled {
  opacity: .4;
  cursor: default;
  box-shadow: none;
}
.jf-next:not(:disabled):active { transform: scale(.99); }

/* ── Done screens ──────────────────────────────────────────── */
.jf-done { text-align: center; padding-top: 12px; }
.jf-done .jf-tick {
  width: 62px; height: 62px;
  margin: 0 auto 18px;
  border-radius: var(--r-full);
  background: var(--grad-soft);
  display: grid; place-items: center;
  font-size: 28px;
}
.jf-stores {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-top: 22px;
}
/* `:not(.btn)` is load-bearing. These two rules date from when the stores were
 * image badges; a bare `.jf-stores a { display: block }` outranks `.btn`'s own
 * `display: inline-flex` (class+element beats class), so the buttons lost their
 * flex layout entirely and the Apple and Play glyphs stacked at the top-left of
 * the button instead of sitting centred beside the label. */
.jf-stores a:not(.btn) { display: block; }
.jf-stores img { height: 52px; width: auto; display: block; }

.jf-foot {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 0 var(--pad) 22px;
}
.jf-foot a { color: var(--ink-3); }

@media (max-width: 480px) {
  .jf-sum-k { width: 78px; }
}

/* ── Date / time fields ─────────────────────────────────────
 * A bare <input type="date"> or <input type="time"> renders on mobile Safari
 * as an empty white rectangle with no icon, no placeholder and nothing to
 * suggest it does anything — the reported "the choose time component is just
 * white". The native picker is worth keeping (it is far better than anything
 * hand-built), so the real input is laid transparently over a styled field
 * that always shows an icon and a label. */
.jf-pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.jf-pick:hover { border-color: var(--lav); }
.jf-pick:focus-within { border-color: var(--lav-deep); }
.jf-pick.is-set { border-color: var(--lav-deep); background: var(--bg-tint); }

.jf-pick-ico { font-size: 17px; line-height: 1; flex: none; }
.jf-pick-txt {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jf-pick.is-set .jf-pick-txt { color: var(--ink); }

/* The real control: full-bleed and invisible, so a tap anywhere on the field
 * opens the native picker. `opacity:0` rather than `visibility:hidden` — the
 * latter stops iOS opening the picker at all.
 *
 * On desktop this alone is not enough: browsers only open the picker from the
 * indicator glyph at the input's right edge, which is invisible here, so a
 * click did nothing. `enablePickerClicks()` in post.js calls `showPicker()` to
 * cover that. This stays the layout for every browser that has it. */
.jf-pick input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Fallback for browsers with no `showPicker()`. The field becomes a real,
 * visible native control — plainer than the styled one, but usable, which the
 * invisible version was not. The decorative label steps aside so the two do
 * not overlap. */
.no-native-picker .jf-pick input {
  position: static;
  inset: auto;
  width: auto;
  flex: 1 1 auto;
  height: auto;
  opacity: 1;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  -webkit-appearance: auto;
  appearance: auto;
}
.no-native-picker .jf-pick .jf-pick-txt { display: none; }

/* ── Store buttons on the final screen ──────────────────────
 * Icon and label must stay on one line. Without the nowrap the label wrapped
 * under the glyph at narrow widths and the button grew into a tall box. */
.jf-stores .btn {
  flex: 0 1 auto;
  white-space: nowrap;
  min-width: 0;
}
.jf-stores .btn svg { flex: none; width: 20px; height: 20px; }
@media (max-width: 420px) {
  .jf-stores { flex-direction: column; align-items: stretch; }
}
