/* =========================================================================
   Components — buttons, forms, cards, badges, range bar, callouts, steps, tabs.

   Notable round 2 changes:
   - Valuation range bar uses the VAC brand gradient (teal → blue) as its
     fill. Range bar is the one place the gradient appears at scale —
     elsewhere it's reserved for the mockup banner and the bullet dots in
     the hero, kept restrained.
   - btn--accent variant added for moments where teal is the right tone
     (e.g., "Subscribe" on Insights, "Send report" on result cards).
   - Form focus rings use the primary navy at the same offset.
   ========================================================================= */

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: 0;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;        /* touch target */
}
.btn:hover { text-decoration: none; }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn--primary:hover  { background: var(--color-primary-hover); }
.btn--primary:active { background: var(--color-primary-pressed); }

.btn--secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.btn--secondary:hover { background: var(--color-bg-muted); border-color: var(--color-text-subtle); }

.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  padding-inline: var(--sp-3);
}
.btn--ghost:hover { background: var(--color-primary-soft); }

.btn--accent {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}
.btn--accent:hover { background: var(--color-accent-hover); }

.btn--lg { padding: var(--sp-4) var(--sp-6); font-size: var(--fs-18); min-height: 52px; }
.btn--sm { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-14); min-height: 36px; }
.btn--block { width: 100%; }

/* Trailing arrow — flat, neutral */
.btn .arrow { display: inline-block; transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- Forms ---------- */

.field { display: block; margin-bottom: var(--sp-5); }
.field__label {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  font-weight: var(--fw-medium);
  color: var(--color-text);
  margin-bottom: var(--sp-2);
}
.field__hint {
  display: block;
  font-size: var(--fs-12);
  color: var(--color-text-subtle);
  margin-top: var(--sp-2);
}
.field__error {
  display: block;
  font-size: var(--fs-12);
  color: var(--color-error);
  margin-top: var(--sp-2);
}

.input, .select, .textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  min-height: 48px;
}
.textarea { min-height: 120px; resize: vertical; line-height: var(--lh-normal); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--color-text-subtle); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}
.input--currency {
  padding-left: 2rem;
}
.input-prefix { position: relative; display: block; }
.input-prefix::before {
  content: "$";
  position: absolute;
  top: 50%; left: var(--sp-4);
  transform: translateY(-50%);
  color: var(--color-text-subtle);
  font-size: var(--fs-16);
  pointer-events: none;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-14);
  color: var(--color-text-muted);
  line-height: var(--lh-normal);
}
.checkbox-row input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--color-primary); }

/* Segmented control (industry chips, value bands) */
.chip-group { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  font-weight: var(--fw-medium);
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--dur-fast);
  min-height: 36px;
}
.chip:hover { background: var(--color-bg-muted); }
.chip[aria-pressed="true"], .chip.is-selected {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* ---------- Cards ---------- */

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-xs);
}
.card--padded-lg { padding: var(--sp-7); }
.card--ghost { box-shadow: none; }
.card--quiet { background: var(--color-bg-subtle); border-color: var(--color-divider); }
.card--featured { border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.card--brand {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
  background:
    linear-gradient(180deg, rgba(16, 116, 111, 0.04), transparent 60%),
    var(--color-bg);
}

.card__title { margin-bottom: var(--sp-2); }
.card__meta {
  font-family: var(--font-sans);
  font-size: var(--fs-12);
  color: var(--color-text-subtle);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

@media (max-width: 600px) {
  .card { padding: var(--sp-5); }
  .card--padded-lg { padding: var(--sp-6); }
}

/* ---------- Badge ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-3);
  font-family: var(--font-sans);
  font-size: var(--fs-12);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-pill);
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  letter-spacing: 0;
}
.badge--info    { background: var(--color-info-soft);    color: var(--color-info); }
.badge--success { background: var(--color-success-soft); color: var(--color-success); }
.badge--accent  { background: var(--color-accent-soft);  color: var(--color-accent); }

/* ---------- Callout / disclaimer ---------- */

.callout {
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--color-border-strong);
  background: var(--color-bg-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  color: var(--color-text-muted);
  line-height: var(--lh-normal);
}
.callout--info   { border-left-color: var(--color-primary); background: var(--color-primary-soft); }
.callout--accent { border-left-color: var(--color-accent);  background: var(--color-accent-soft); }
.callout--warn   { border-left-color: var(--color-warn); background: var(--color-warn-soft); color: var(--color-warn); }
.callout strong { color: var(--color-text); }

/* ---------- Valuation range bar (signature component) ----------
   Always paired with a low/mid/high readout. The fill uses the VAC brand
   gradient — the only place where the gradient is used at full scale.   */

.range {
  --range-low: 25%;
  --range-mid: 50%;
  --range-high: 75%;
  position: relative;
  height: 14px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-pill);
  margin: var(--sp-7) 0 var(--sp-4);
}
.range__fill {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--range-low);
  right: calc(100% - var(--range-high));
  background: var(--gradient-brand-h);
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.range__mid {
  position: absolute;
  top: -6px; bottom: -6px;
  left: var(--range-mid);
  width: 2px;
  background: var(--color-text);
  transform: translateX(-1px);
}
.range__mid::after {
  content: "";
  position: absolute;
  top: -6px; left: 50%;
  width: 14px; height: 14px;
  background: var(--color-text);
  border: 3px solid var(--color-bg);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: var(--shadow-sm);
}
.range__labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-12);
  color: var(--color-text-subtle);
  margin-top: var(--sp-2);
  font-family: var(--font-sans);
}
.range-readout { display: flex; gap: var(--sp-7); flex-wrap: wrap; }
.range-readout__item .label {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--fs-12);
  color: var(--color-text-subtle);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
}
.range-readout__item .value {
  display: block;
  font-family: var(--font-serif);
  font-size: var(--fs-30);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
  margin-top: var(--sp-1);
}
.range-readout__item--mid .value {
  background: var(--gradient-brand-h);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (max-width: 600px) {
  .range-readout { gap: var(--sp-5); }
  .range-readout__item .value { font-size: var(--fs-24); }
}

/* ---------- Step indicator ---------- */

.steps {
  display: flex; gap: var(--sp-4); flex-wrap: wrap; align-items: center;
  font-family: var(--font-sans);
  font-size: var(--fs-14); color: var(--color-text-subtle);
}
.steps__item { display: inline-flex; align-items: center; gap: var(--sp-2); }
.steps__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  font-size: var(--fs-12); font-weight: var(--fw-semibold);
  background: var(--color-bg-muted); color: var(--color-text-muted);
  border-radius: 50%;
}
.steps__item.is-active .steps__num { background: var(--color-primary); color: var(--color-text-inverse); }
.steps__item.is-active { color: var(--color-text); font-weight: var(--fw-medium); }
.steps__item.is-complete .steps__num { background: var(--color-accent); color: var(--color-text-inverse); }
.steps__divider { width: 16px; border-top: 1px solid var(--color-border); }

/* ---------- Tabs ---------- */

.tabs {
  display: flex; gap: var(--sp-2);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
  font-family: var(--font-sans);
}
.tab {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-14);
  font-weight: var(--fw-medium);
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.tab:hover { color: var(--color-text); }
.tab[aria-selected="true"], .tab.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
