/* assets/css/components/reg-lookup.css
   DVLA registration lookup — the plate panel (field + "Look up" button + result
   line) that sits directly under the enquiry-type selection. The panel + field are
   server-rendered; reg-lookup.js injects the button + status into it. Styles are
   inert until the feature renders the panel, so nothing shows when it is off. */

/* ---------- The plate lookup panel ---------- */
/* A tinted background block so the lookup reads as one "do this first, it saves you
   typing" action, using the wizard's own accent tokens (matches the drop-off callout). */
.gtm-reglookup {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: var(--gtm-wiz-r-md, 12px);
  background: var(--gtm-wiz-accent-tint, #f6f5f7);
  border: 1.5px solid var(--gtm-wiz-border, #e4e1e6);
}
.gtm-reglookup__lead {
  display: block;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--gtm-wiz-ink, #342E37);
}

/* Field + button on one row (button wraps under the field only when very narrow). */
.gtm-reglookup__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}
.gtm-reglookup__input {
  flex: 1 1 180px;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}
.gtm-reglookup__input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

/* The button is .gtm-btn.primary (dark pill, uppercase). .gtm-btn carries
   min-width:200px + padding:12px 24px for full-width CTAs, which would make this
   inline action ~200px and orphan it on wrap — so reset to a compact auto width and
   centre the label within the field-matched height. The descendant selector
   (.gtm-reglookup__row …) out-specifies .gtm-btn so the reset wins regardless of
   which stylesheet loads first. */
.gtm-reglookup__row .gtm-reglookup__btn {
  flex: 0 0 auto;
  align-self: stretch;
  min-width: 0;
  width: auto;
  padding-block: 0;
  padding-inline: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* On phones the field + compact button no longer fit on one line; rather than let
   the button wrap and orphan (115px marooned with dead space beside it), stack the
   row so the plate field and a full-width action read clearly. */
@media (max-width: 480px) {
  .gtm-reglookup__row { flex-direction: column; align-items: stretch; }
  /* In a column, the input's `flex-basis:180px` would become its HEIGHT — reset to a
     natural-height, full-width field. */
  .gtm-reglookup__row .gtm-reglookup__input { flex: 0 0 auto; }
  .gtm-reglookup__row .gtm-reglookup__btn { width: 100%; padding-block: 12px; }
}

/* Result / error line, injected after the row. */
.gtm-reglookup__status {
  margin: 12px 0 0;
  padding: 10px 12px 10px 14px;
  border: 1px solid transparent;
  border-left-width: 4px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}
.gtm-reglookup__status[hidden] { display: none; }
.gtm-reglookup__status.is-ok {
  color: var(--gtm-wiz-success, #1E874B);
  background: var(--gtm-wiz-success-tint, #eef8f2);
  border-color: var(--gtm-wiz-success-tint, #c3e6d3);
  border-left-color: var(--gtm-wiz-success-line, #2f9e6b);
}
.gtm-reglookup__status.is-warn {
  color: #97490f; background: #fdf3e9;
  border-color: #f2d3b0; border-left-color: #d98b3f;
}

/* ---------- Part-exchange opt-in ("add your current bike") ---------- */
/* A visible, tappable option card (bike / finance) that reveals the same plate panel
   + editable make/model/year, rather than a bare inline checkbox. */
.gtm-px__toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
}
.gtm-px__toggle { flex: none; width: 18px; height: 18px; margin-top: 2px; }
/* Match the enquiry-type radio cards' language: light border until hover/selected,
   then the wizard accent — so the opt-in sits in the same family, not a charcoal box. */
.gtm-px__toggle-label--card {
  padding: 12px 14px;
  border: 1.5px solid var(--gtm-wiz-border, #E3E1E4);
  border-radius: var(--gtm-wiz-r-md, 12px);
  transition: border-color .15s ease, background-color .15s ease;
}
.gtm-px__toggle-label--card:hover,
.gtm-px__toggle-label--card.is-checked,
.gtm-px:has(.gtm-px__toggle:checked) .gtm-px__toggle-label--card {
  border-color: var(--gtm-wiz-accent, #342E37);
  background: var(--gtm-wiz-accent-tint, #f6f5f7);
}
.gtm-px__toggle-label--card .gtm-px__toggle-txt strong { font-weight: 800; }

/* Collapsed by default in CSS, so it holds before any JS runs. The tick reveals it
   via :has() on modern browsers; .is-open is the JS fallback for older ones. */
.gtm-px__group { margin-top: 14px; display: none; }
.gtm-px:has(.gtm-px__toggle:checked) .gtm-px__group,
.gtm-px__group.is-open { display: block; }
