/* ============================================================
   Forms — the Forms page and the pieces every phone form uses
   (form-kit.js). Big tap targets first: these get filled in
   standing next to a tractor.
   HUB theme: every colour is a token from tokens.css.
   ============================================================ */

/* ── the Forms page ─────────────────────────────────────────────── */

.forms-tip {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg);
  flex-wrap: wrap;
}
.forms-tip-title { font-weight: 700; font-size: 15.5px; letter-spacing: -0.01em; margin-bottom: 4px; }
.forms-tip-body { font-size: 13.5px; color: hsl(var(--muted-foreground)); max-width: 68ch; line-height: 1.6; }
.forms-tip-body a { color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}
.form-tile {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  min-height: 150px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
a.form-tile:hover { border-color: var(--accent); box-shadow: var(--shadow-card); transform: translateY(-2px); }
.form-tile.is-off { opacity: 0.6; }
.form-tile-title { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.form-tile-blurb { font-size: 13.5px; color: hsl(var(--muted-foreground)); line-height: 1.55; flex: 1; }
.form-tile-foot { margin-top: var(--space-sm); }
.form-tile-go { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }

/* ── one form ───────────────────────────────────────────────────── */

.form-page { max-width: 760px; margin: 0 auto; }
.form-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: hsl(var(--muted-foreground));
  padding: 6px 0; margin-bottom: var(--space-md);
}
.form-back:hover { color: var(--ink); }
.form-head { margin-bottom: var(--space-lg); }
.form-title { font-size: 28px; font-weight: 800; letter-spacing: -0.025em; }
.form-blurb { color: hsl(var(--muted-foreground)); font-size: 14.5px; margin-top: 6px; max-width: 62ch; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}
.form-card-title {
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); margin-bottom: var(--space-md);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
}

/* The save button stays in reach on a phone. */
.form-actions {
  display: flex; gap: var(--space-sm); justify-content: flex-end; flex-wrap: wrap;
  padding: var(--space-md) 0;
}
.form-actions .btn { min-height: 48px; }

/* ── chips ──────────────────────────────────────────────────────── */

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-weight: 600; font-size: 14px; line-height: 1.2;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.chip:hover { border-color: var(--accent-strong); }
/* Selected = the olive fill HUB uses for its call to action, ink text. */
.chip.on { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent-strong); box-shadow: 0 0 0 1px var(--accent-strong); }
.chip-hint { font-size: 11.5px; font-weight: 500; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.chip.on .chip-hint { color: var(--accent-contrast); opacity: 0.82; }
.chip-group.compact .chip { min-height: 38px; padding: 7px 12px; font-size: 13px; }

/* ── stepper ────────────────────────────────────────────────────── */

.stepper { display: flex; align-items: stretch; gap: 6px; max-width: 260px; }
.stepper-btn {
  width: 48px; flex-shrink: 0;
  border: 1px solid var(--input-line); border-radius: var(--radius-sm);
  background: var(--canvas); font-size: 22px; font-weight: 600; line-height: 1;
  cursor: pointer;
}
.stepper-btn:hover { border-color: var(--accent-strong); background: var(--accent-tint); }
.stepper-input { text-align: center; font-weight: 700; font-size: 17px; -moz-appearance: textfield; }
.stepper-input::-webkit-outer-spin-button, .stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-unit { align-self: center; font-size: 13px; color: hsl(var(--muted-foreground)); white-space: nowrap; }

/* ── block picker ───────────────────────────────────────────────── */

.block-picker { position: relative; }
.block-picked { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.block-picked:empty { display: none; }
.block-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 6px 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint); border: 1px solid var(--accent-line);
  font-size: 13.5px;
}
.block-tag button {
  border: 0; background: transparent; cursor: pointer;
  width: 26px; height: 26px; border-radius: 6px; font-size: 18px; line-height: 1;
  color: var(--accent-ink);
}
.block-tag button:hover { background: var(--accent-tint-strong); }
.block-results { display: flex; flex-direction: column; margin-top: 4px; border-radius: var(--radius-sm); overflow: hidden; }
.block-results:not(:empty) { border: 1px solid var(--line); }
.block-result {
  display: flex; align-items: baseline; gap: 10px;
  padding: 11px 14px; min-height: 44px;
  border: 0; border-top: 1px solid var(--line); background: var(--surface);
  text-align: left; cursor: pointer; font-size: 14px;
}
.block-result:first-child { border-top: 0; }
.block-result:hover, .block-result:focus-visible { background: var(--accent-tint); }
.block-none { padding: 10px 14px; font-size: 13px; color: hsl(var(--muted-foreground)); }

/* ── done screen ────────────────────────────────────────────────── */

.done-screen {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  animation: fadeUp var(--dur-fast) var(--ease);
}
.done-tick {
  width: 56px; height: 56px; margin: 0 auto var(--space-md);
  border-radius: 50%; background: var(--accent); position: relative;
}
.done-tick::after {
  content: ""; position: absolute; left: 21px; top: 13px;
  width: 12px; height: 24px; border: solid var(--accent-contrast); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.done-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.done-lines { list-style: none; padding: 0; margin: var(--space-md) auto 0; max-width: 460px; text-align: left; }
.done-lines li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; color: hsl(var(--muted-foreground)); }
.done-lines li:first-child { border-top: 0; }
.done-actions { justify-content: center; margin-top: var(--space-lg); }

/* FSC flag next to a product. */
.fsc-ok, .fsc-no {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--radius-full); border: 1px solid transparent; white-space: nowrap;
}
.fsc-ok { background: var(--success-tint); color: var(--success-ink); border-color: var(--success-line); }
.fsc-no { background: var(--danger-tint);  color: var(--danger-ink);  border-color: var(--danger-line); }

@media (max-width: 560px) {
  .form-title { font-size: 23px; }
  .form-card { padding: var(--space-md); }
  .form-actions {
    position: sticky; bottom: 0; z-index: 5;
    background: linear-gradient(to top, var(--canvas) 70%, transparent);
    margin: 0 calc(-1 * var(--space-md));
    padding: var(--space-md);
  }
  .form-actions .btn { flex: 1; }
  .forms-tip .btn { width: 100%; }
}
