/* Jitcar new-car quote: focused three-step card based on the approved
 * mobile-first form direction. Real inventory choices and CRM semantics stay
 * intact; this sheet owns presentation only. */

html:has(.mq-page),
body:has(.mq-page) {
  width: 100%;
  max-width: 100vw;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
}

body:has(.mq-page) .site-head.slim {
  color: var(--paper);
  background: var(--asphalt);
  border-bottom-color: var(--stage);
}
body:has(.mq-page) .site-head.slim .logo-jit { color: var(--lane); }
body:has(.mq-page) .site-head.slim .logo-car { color: var(--paper); }
body:has(.mq-page) .site-head.slim .header-signin,
body:has(.mq-page) .site-head.slim .hbudget { display: none; }
.focus-assurance {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--steel-2);
  font-size: var(--fs-xs);
  font-weight: var(--w-bold);
}
.focus-assurance .ico { width: 16px; height: 16px; }

.mq-page {
  min-height: calc(100dvh - 70px);
  overflow-x: clip;
  overscroll-behavior: none;
  touch-action: pan-y;
  padding: var(--sp-5) var(--sp-4) var(--sp-10);
  background: var(--asphalt);
  color: var(--asphalt);
}
.mq-shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.mq-card {
  width: 100%;
  overflow: hidden;
  padding: var(--sp-6);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-card);
  background: var(--paper);
  box-shadow: var(--shadow-sheet);
}

/* Progress is compact and useful, not decorative. */
.mq-progress { margin-bottom: var(--sp-6); }
.mq-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}
.mq-progress-copy strong {
  font-size: var(--fs-xs);
  font-weight: var(--w-extrabold);
}
.mq-progress-copy span {
  color: var(--steel);
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  white-space: nowrap;
}
.mq-progress-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--fill-quiet);
}
.mq-progress-track > span {
  display: block;
  width: 33.333%;
  height: 100%;
  border-radius: inherit;
  background: var(--lane);
  transition: width var(--dur-reveal) var(--ease);
}

/* Without JavaScript the sections stack and remain usable. With JavaScript,
 * one hardware-accelerated horizontal transition becomes the page's single
 * orchestrated motion. */
.mq-track-viewport { width: 100%; }
.mq-form-track { width: 100%; }
.mq-step + .mq-step {
  margin-top: var(--sp-10);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--hairline);
}
.mq-card.is-ready .mq-track-viewport {
  overflow: hidden;
  transition: height var(--dur-reveal) var(--ease);
}
.mq-card.is-ready .mq-form-track {
  display: flex;
  align-items: flex-start;
  width: 100%;
  transition: transform var(--dur-reveal) var(--ease);
  will-change: transform;
}
.mq-card.is-ready .mq-step {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  visibility: hidden;
  pointer-events: none;
}
.mq-card.is-ready .mq-step.is-active {
  visibility: visible;
  pointer-events: auto;
}
.mq-step h1 {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-xl);
  font-weight: var(--w-black);
  letter-spacing: var(--track-heading);
  line-height: var(--lh-tight);
}
.mq-subtitle {
  margin: 0 0 var(--sp-6);
  color: var(--steel);
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
}
.mq-section-label,
.mq-search label,
.mq-field label,
.mq-contact legend {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--asphalt);
  font-size: var(--fs-xs);
  font-weight: var(--w-extrabold);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Compact real-data choices: eight popular makes first, searchable long tail. */
.mq-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-2);
}
.mq-make-grid,
.mq-model-grid { margin-bottom: var(--sp-4); }
.mq-choice {
  display: grid;
  min-width: 0;
  min-height: 48px;
  place-content: center;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  border: 1.5px solid var(--hairline-2);
  border-radius: var(--radius-control);
  color: var(--asphalt);
  background: var(--concrete);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.mq-choice:hover { border-color: var(--asphalt); }
.mq-choice.is-selected {
  color: var(--lane);
  background: var(--asphalt);
  border-color: var(--asphalt);
}
.mq-choice b {
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mq-choice small {
  color: var(--steel);
  font-size: var(--fs-2xs);
}
.mq-choice.is-selected small { color: var(--steel-2); }

.mq-search {
  position: relative;
  margin-bottom: var(--sp-4);
}
.mq-search input,
.mq-field input,
.mq-field select {
  width: 100%;
  height: 50px;
  min-width: 0;
  padding: 0 var(--sp-4);
  border: 1.5px solid var(--hairline-2);
  border-radius: var(--radius-field);
  color: var(--asphalt);
  background: var(--concrete);
  font-family: var(--sans);
  font-size: var(--fs-base);
  font-weight: var(--w-semibold);
  outline: 2px solid transparent;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.mq-search input::placeholder,
.mq-field input::placeholder { color: var(--steel); font-weight: var(--w-regular); }
.mq-search input:focus,
.mq-field input:focus,
.mq-field select:focus {
  border-color: var(--asphalt);
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--asphalt-08);
}
.mq-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% - 1px);
  right: 0;
  left: 0;
  display: grid;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--hairline-2);
  border-radius: 0 0 var(--radius-field) var(--radius-field);
  background: var(--paper);
  box-shadow: var(--shadow-card);
}
.mq-search-results[hidden] { display: none; }
.mq-search-results button {
  min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--asphalt);
  background: var(--paper);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mq-search-results button:hover { background: var(--concrete); }

.mq-selection {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding: var(--sp-3);
  border-radius: var(--radius-control);
  color: var(--paper);
  background: var(--asphalt);
  font-size: var(--fs-sm);
}
.mq-selection.is-visible { display: flex; }
.mq-selection button {
  border: 0;
  color: var(--lane);
  background: transparent;
  font: inherit;
  font-weight: var(--w-bold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.mq-model-section {
  display: none;
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--hairline);
}
.mq-model-section.is-visible { display: block; }
.mq-status,
.mq-help,
.mq-legal {
  margin: var(--sp-1) 0 0;
  color: var(--steel);
  font-size: var(--fs-2xs);
  line-height: var(--lh-body);
}
.mq-legal a { color: var(--asphalt); }
.mq-error {
  margin: var(--sp-2) 0 0;
  color: var(--error);
  font-size: var(--fs-xs);
  line-height: var(--lh-body);
}

.mq-field { margin-bottom: var(--sp-4); }
.mq-zip-field { max-width: 220px; }
.mq-name-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}
.mq-name-grid > .mq-field { min-width: 0; }
.mq-contact {
  min-width: 0;
  margin: var(--sp-5) 0 0;
  padding: 0;
  border: 0;
}
.mq-contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.mq-assurance {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding: var(--sp-3);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-control);
  color: var(--asphalt);
  background: var(--fill-quiet);
  font-size: var(--fs-xs);
  line-height: var(--lh-body);
}
.mq-assurance .ico { width: 18px; height: 18px; flex: none; }
.mq-consent {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding: var(--sp-3);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-field);
  color: var(--steel);
  background: var(--concrete);
  font-size: var(--fs-xs);
  line-height: var(--lh-body);
  cursor: pointer;
}
.mq-consent input {
  width: 22px;
  height: 22px;
  flex: none;
  margin: 0;
}
.mq-consent:has(input:checked) { border-color: var(--asphalt); }

.mq-actions { margin-top: var(--sp-5); }
.mq-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border: 0;
  border-radius: var(--radius-control);
  font-family: var(--sans);
  font-size: var(--fs-base);
  font-weight: var(--w-extrabold);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.mq-button-primary {
  margin-top: var(--sp-5);
  color: var(--asphalt);
  background: var(--lane);
}
.mq-actions .mq-button-primary { margin-top: 0; }
.mq-button-primary:hover { transform: translateY(-1px); }
.mq-button-back {
  min-height: 40px;
  margin-top: var(--sp-2);
  color: var(--steel);
  background: transparent;
  font-size: var(--fs-xs);
}
.mq-button-back:hover { color: var(--asphalt); }
.mq-button:disabled { cursor: wait; opacity: .7; }

.mq-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-5);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--hairline);
  color: var(--steel);
  font-size: var(--fs-2xs);
  text-align: center;
}
.mq-noscript {
  margin: var(--sp-4) 0 0;
  color: var(--steel);
  font-size: var(--fs-sm);
}
.mq-noscript a { color: var(--asphalt); }

.mq-card .form-done {
  margin: 0;
  border: 0;
  text-align: center;
}
.mq-card .form-done p { color: var(--steel); }

/* Lazy field feedback: red belongs only to the field that was evaluated.
 * Focus always returns to the neutral charcoal ring, while the helper text
 * continues to explain what still needs attention. */
.mq-search input.is-invalid,
.mq-field.has-error :is(input, select, textarea) {
  border-color: var(--error);
  background: color-mix(in srgb, var(--error) 5%, var(--paper));
  box-shadow: none;
}
.mq-search input.is-invalid:focus,
.mq-field.has-error :is(input, select, textarea):focus {
  border-color: var(--asphalt);
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--asphalt-08);
}
.mq-field .client-field-error {
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
}
.mq-button.is-shaking { animation: mq-required-shake 420ms var(--ease); }
@keyframes mq-required-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

.mq-button:focus-visible,
.mq-choice:focus-visible,
.mq-search-results button:focus-visible {
  outline: 3px solid var(--lane);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .mq-page { padding: var(--sp-3) var(--sp-3) var(--sp-8); }
  .mq-card { padding: var(--sp-5) var(--sp-4); }
  .mq-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mq-contact-grid,
  .mq-name-grid { grid-template-columns: 1fr; }
  .mq-search input,
  .mq-field input,
  .mq-field select { font-size: 16px; }

  .focus-assurance { font-size: var(--fs-2xs); }
}

@media (prefers-reduced-motion: reduce) {
  .mq-card.is-ready .mq-track-viewport,
  .mq-card.is-ready .mq-form-track,
  .mq-progress-track > span,
  .mq-button { transition: none; }
  .mq-button.is-shaking { animation: none; }
}