/* ------------------------------------------------------------------
   Buyer-agent onboarding — component styles.
   ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--surface-tint);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }

/* ---------- App shell: two columns ---------- */
.shell {
  display: grid;
  grid-template-columns: minmax(360px, 480px) 1fr;
  min-height: 100vh;
}

/* ---------- Left brand rail ---------- */
.rail {
  position: relative;
  overflow: hidden;
  color: var(--ink-inverse);
  padding: var(--space-8) var(--space-7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(120% 120% at 0% 0%, #00b4f0 0%, rgba(0,180,240,0) 45%),
    radial-gradient(120% 120% at 100% 100%, #0089c7 0%, rgba(0,137,199,0) 50%),
    linear-gradient(135deg, #063b5c 0%, #04223a 55%, #020822 100%);
}
.rail::after {
  /* faint diagonal sheen, Stripe hero vibe */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.06) 50%, transparent 60%);
  pointer-events: none;
}
.rail__brand {
  display: flex; align-items: center; gap: var(--space-3);
  font-weight: 600; letter-spacing: -0.01em; font-size: 15px;
}
.rail__logo {
  width: 32px; height: 32px; border-radius: 27%;
  background: var(--brand-navy); overflow: hidden;
  display: grid; place-items: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.28), inset 0 0 0 1px rgba(255,255,255,0.08);
}
.rail__logo img { width: 92%; height: 92%; display: block; }
.rail__wordmark { display: flex; flex-direction: column; line-height: 1.15; }
.rail__wordmark small { font-size: 11px; font-weight: 500; opacity: 0.62; letter-spacing: 0.04em; }
.rail__body { position: relative; z-index: 1; max-width: 30ch; }
.rail__eyebrow {
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 12px; font-weight: 600; opacity: 0.72; margin: 0 0 var(--space-3);
}
.rail__headline {
  font-size: 30px; line-height: 1.18; font-weight: 640;
  letter-spacing: -0.02em; margin: 0 0 var(--space-4);
}
.rail__sub { font-size: 15px; opacity: 0.82; margin: 0; }

.rail__points { list-style: none; margin: var(--space-6) 0 0; padding: 0; position: relative; z-index: 1; }
.rail__points li {
  display: flex; gap: var(--space-3); align-items: flex-start;
  font-size: 14px; opacity: 0.9; padding: var(--space-2) 0;
}
.rail__check {
  flex: none; width: 20px; height: 20px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.18); color: #fff;
  display: grid; place-items: center; font-size: 12px; margin-top: 1px;
}
.rail__foot { position: relative; z-index: 1; font-size: 13px; opacity: 0.6; }

/* ---------- Right content column ---------- */
.content {
  padding: var(--space-7) var(--space-7);
  display: flex; flex-direction: column;
  max-width: 720px; width: 100%;
}
.content__inner { width: 100%; max-width: 520px; margin: 0 auto; flex: 1; }

/* ---------- Step progress ---------- */
.steps { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-7); }
.steps__item { display: flex; align-items: center; gap: var(--space-2); }
.steps__dot {
  width: 26px; height: 26px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: var(--ink-tertiary);
  transition: all var(--dur) var(--ease);
}
.steps__label { font-size: 13px; color: var(--ink-tertiary); font-weight: 500; }
.steps__bar { width: 22px; height: 1.5px; background: var(--border-strong); border-radius: 2px; }
.steps__item[data-state="active"] .steps__dot {
  border-color: var(--accent); color: var(--accent); background: var(--accent-tint);
}
.steps__item[data-state="active"] .steps__label { color: var(--ink); font-weight: 600; }
.steps__item[data-state="done"] .steps__dot {
  border-color: var(--accent); background: var(--accent); color: #fff;
}
.steps__item[data-state="done"] .steps__label { color: var(--ink-secondary); }
@media (max-width: 640px) { .steps__label { display: none; } }

/* ---------- Panels ---------- */
.panel { display: none; animation: rise var(--dur) var(--ease); }
.panel[data-active="true"] { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.panel__eyebrow {
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px;
  font-weight: 600; color: var(--accent); margin: 0 0 var(--space-3);
}
.panel__title {
  font-size: 26px; line-height: 1.2; font-weight: 640;
  letter-spacing: -0.02em; margin: 0 0 var(--space-2);
}
.panel__lede { font-size: 15px; color: var(--ink-secondary); margin: 0 0 var(--space-6); }

/* ---------- Form fields ---------- */
.field { margin-bottom: var(--space-5); }
.field__label { display: block; font-size: 14px; font-weight: 600; margin-bottom: var(--space-2); }
.field__hint { font-size: 13px; color: var(--ink-tertiary); margin: var(--space-2) 0 0; }

.input, .select {
  width: 100%; height: 44px; padding: 0 var(--space-4);
  font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input:focus, .select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.input::placeholder { color: #9aa7b4; }

/* handle input with @ prefix */
.input-group {
  display: flex; align-items: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input-group__prefix {
  padding: 0 var(--space-3); height: 44px; display: grid; place-items: center;
  background: var(--surface-tint); color: var(--ink-tertiary);
  font-family: var(--font-mono); font-size: 15px; border-right: 1px solid var(--border);
}
.input-group .input { border: none; box-shadow: none; }
.input-group .input:focus { box-shadow: none; }

/* money input with currency select */
.money { display: flex; gap: var(--space-2); }
.money .money__amount { flex: 1; }
.money .money__sym {
  display: grid; place-items: center; padding: 0 var(--space-3);
  border: 1px solid var(--border-strong); border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface-tint); color: var(--ink-secondary);
  font-family: var(--font-mono);
}
.money .field-money-wrap { display: flex; flex: 1; }
.money .field-money-wrap .input { border-radius: 0 var(--radius) var(--radius) 0; }
.money .select { width: 96px; flex: none; }

/* ---------- Chips (categories, facets) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); font-size: 14px; font-weight: 500;
  background: var(--surface); color: var(--ink-secondary);
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  cursor: pointer; user-select: none;
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--ink-tertiary); }
.chip__box {
  width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; font-size: 10px; color: transparent;
}
.chip[aria-pressed="true"] {
  background: var(--accent-tint); border-color: var(--accent); color: var(--accent);
}
.chip[aria-pressed="true"] .chip__box { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip--avoid[aria-pressed="true"] {
  background: var(--danger-tint); border-color: var(--danger); color: var(--danger);
}
.chip--avoid[aria-pressed="true"] .chip__box { background: var(--danger); border-color: var(--danger); }

/* ---------- Objective cards (taste) ---------- */
.cards { display: grid; gap: var(--space-3); }
.optcard {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4); border: 1px solid var(--border-strong);
  border-radius: var(--radius); cursor: pointer; background: var(--surface);
  transition: all var(--dur) var(--ease);
}
.optcard:hover { border-color: var(--ink-tertiary); box-shadow: var(--shadow-sm); }
.optcard__radio {
  flex: none; width: 20px; height: 20px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong); margin-top: 1px;
  display: grid; place-items: center; transition: all var(--dur) var(--ease);
}
.optcard__radio::after {
  content: ""; width: 8px; height: 8px; border-radius: var(--radius-pill);
  background: #fff; transform: scale(0); transition: transform var(--dur) var(--ease);
}
.optcard__title { font-size: 15px; font-weight: 600; margin: 0 0 2px; }
.optcard__desc { font-size: 13px; color: var(--ink-tertiary); margin: 0; }
.optcard__icon { flex: none; font-size: 20px; line-height: 1.3; }
.optcard[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent-tint);
  box-shadow: 0 0 0 1px var(--accent);
}
.optcard[aria-pressed="true"] .optcard__radio { border-color: var(--accent); background: var(--accent); }
.optcard[aria-pressed="true"] .optcard__radio::after { transform: scale(1); }

/* ---------- Tag input (merchants) ---------- */
.tags {
  display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center;
  padding: var(--space-2); min-height: 44px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
}
.tags:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.tag {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-3);
  font-family: var(--font-mono); font-size: 13px;
  background: var(--surface-tint-2); color: var(--ink);
  border-radius: var(--radius-sm);
}
.tag button {
  border: none; background: none; cursor: pointer; color: var(--ink-tertiary);
  font-size: 15px; line-height: 1; padding: 0; width: 16px; height: 16px;
}
.tag button:hover { color: var(--danger); }
.tags__input {
  flex: 1; min-width: 120px; border: none; outline: none; height: 30px;
  font-size: 14px; font-family: var(--font-mono); background: transparent; color: var(--ink);
}

/* ---------- Review summary ---------- */
.summary { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.summary__row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4);
  padding: var(--space-4); border-bottom: 1px solid var(--border);
}
.summary__row:last-child { border-bottom: none; }
.summary__k { font-size: 13px; color: var(--ink-tertiary); font-weight: 500; }
.summary__v { font-size: 14px; font-weight: 560; text-align: right; }
.summary__v .mono { font-family: var(--font-mono); }
.summary__v .muted { color: var(--ink-tertiary); font-weight: 400; }

/* ---------- Buttons / actions ---------- */
.actions { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-7); }
.btn {
  height: 44px; padding: 0 var(--space-5); font-size: 15px; font-weight: 600;
  border-radius: var(--radius); cursor: pointer; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: var(--space-2);
  transition: all var(--dur) var(--ease);
}
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.btn--primary:active { background: var(--accent-active); }
.btn--primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn--ghost { background: transparent; color: var(--ink-secondary); }
.btn--ghost:hover { color: var(--ink); background: var(--surface-tint-2); }
.btn--link { background: none; border: none; color: var(--ink-tertiary); cursor: pointer; font-size: 14px; }
.btn--link:hover { color: var(--ink); }

/* ---------- Success / dashboard teaser ---------- */
.done { text-align: center; padding-top: var(--space-4); }
.done__badge {
  width: 64px; height: 64px; margin: 0 auto var(--space-5);
  border-radius: var(--radius-pill); background: var(--success-tint);
  display: grid; place-items: center; font-size: 30px; color: var(--success);
}
.done__title { font-size: 26px; font-weight: 640; letter-spacing: -0.02em; margin: 0 0 var(--space-2); }
.done__lede { font-size: 15px; color: var(--ink-secondary); margin: 0 0 var(--space-6); }
.done__handle { font-family: var(--font-mono); color: var(--accent); font-weight: 600; }

.teaser {
  text-align: left; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-5); background: var(--surface); box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-5);
}
.teaser__flag {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: 12px; font-weight: 600; color: var(--warning);
  background: var(--warning-tint); padding: 3px var(--space-2); border-radius: var(--radius-pill);
  margin-bottom: var(--space-3);
}
.teaser__title { font-size: 15px; font-weight: 640; margin: 0 0 var(--space-2); }
.teaser__grid { display: grid; grid-template-columns: 1fr auto; gap: 6px var(--space-4); font-size: 14px; margin: var(--space-3) 0; }
.teaser__grid .k { color: var(--ink-tertiary); }
.teaser__grid .v { text-align: right; font-family: var(--font-mono); }
.teaser__grid .v.up { color: var(--warning); }
.teaser__why { font-size: 13px; color: var(--ink-secondary); background: var(--surface-tint); padding: var(--space-3); border-radius: var(--radius-sm); margin: var(--space-3) 0; }
.teaser__actions { display: flex; gap: var(--space-2); }
.teaser__actions .btn { flex: 1; justify-content: center; height: 40px; }
.btn--danger-ghost { border-color: var(--border-strong); color: var(--ink-secondary); }
.btn--danger-ghost:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- Responsive: stack on narrow ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    padding: var(--space-6) var(--space-5);
    flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-4);
  }
  .rail__points, .rail__foot, .rail__sub { display: none; }
  .rail__headline { font-size: 20px; margin: 0; }
  .rail__eyebrow { margin: 0 0 var(--space-1); }
  .content { padding: var(--space-6) var(--space-5); }
}

@media (max-width: 560px) {
  .content { padding: var(--space-5) var(--space-4); }
  .rail { padding: var(--space-5) var(--space-4); }
  .rail__wordmark small { display: none; }
  .panel__title { font-size: 24px; }
  /* 16px prevents iOS from auto-zooming a field on focus */
  .input, .money__amount, .tags__input, .select { font-size: 16px; }
  .actions { gap: var(--space-2); }
}
