/* ============================================================================
   css/fairmatch.css — Fair Match™ swipe finder (Tinder-style). Loaded only on
   fair-match.html. Uses the site design tokens (style.css :root).
   Card = full car (object-fit:contain) over a blurred fill + dark info panel.
   Big round action buttons, swipe stamps, decision burst. AA contrast,
   reduced-motion aware.
   ============================================================================ */

#fair-match-app { max-width: 440px; margin: 0 auto; padding: 0 16px; }

.fm-head { text-align: center; margin-bottom: 14px; }
.fm-title { font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 6vw, 2.6rem); color: var(--ink); line-height: 1.05; margin: 0; }
.fm-tm { font-size: .45em; vertical-align: super; }
.fm-sub { margin: 6px 0 0; font-size: 1.05rem; color: var(--slate); }

/* ---- deck (card stack) -------------------------------------------------- */
.fm-deck { position: relative; width: 100%; height: min(76vh, 600px); margin: 0 auto; }
.fm-card {
  position: absolute; inset: 0; overflow: hidden; border-radius: 20px;
  display: flex; flex-direction: column; background: var(--ink);
  box-shadow: 0 12px 40px rgba(12,14,19,.28);
  user-select: none; -webkit-user-select: none;
}
.fm-card--3 { transform: translateY(20px) scale(.92); z-index: 1; }
.fm-card--2 { transform: translateY(10px) scale(.96); z-index: 2; }
.fm-card--top { z-index: 3; cursor: grab; touch-action: pan-y; will-change: transform; }
.fm-card--top:active { cursor: grabbing; }
.fm-empty { position: relative; display: flex; align-items: center; justify-content: center; height: 100%;
  color: #fff; font-weight: 700; font-size: 1.15rem; text-align: center; padding: 24px; }

/* photo region: whole car shown over a blurred fill of the same image */
.fm-photo { position: relative; height: 62%; flex: none; overflow: hidden; background: #07090d; }
.fm-photo-bg { position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: blur(22px) brightness(.5); transform: scale(1.25); }
.fm-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; pointer-events: none; }

.fm-score { position: absolute; right: 14px; top: 14px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; line-height: 1;
  background: var(--ok); color: #fff; border-radius: 14px; padding: 9px 13px; box-shadow: 0 4px 14px rgba(0,0,0,.32); }
.fm-score b { font-size: 1.6rem; font-weight: 800; }
.fm-score i { font-style: normal; font-size: .6rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; margin-top: 2px; }
.fm-warranty { position: absolute; left: 14px; top: 14px; z-index: 3;
  background: rgba(12,14,19,.6); color: #fff; border-radius: 999px; padding: 6px 12px;
  font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* info panel */
.fm-info { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 9px;
  padding: 16px 20px; color: #fff; min-height: 0; }
.fm-name { font-family: var(--display); font-weight: 800; font-size: 1.55rem; line-height: 1.1; margin: 0; color: #fff; }
.fm-price { margin: 0; font-size: 1.12rem; font-weight: 700; color: rgba(255,255,255,.82); }
.fm-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.fm-chip { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); border-radius: 999px;
  padding: 5px 12px; font-size: .85rem; font-weight: 700; color: #fff; }

/* swipe stamps (LIKE / NOPE style) */
.fm-stamp { position: absolute; top: 30px; z-index: 5; opacity: 0; pointer-events: none;
  font-family: var(--display); font-weight: 800; font-size: 1.7rem; letter-spacing: .02em; text-transform: uppercase;
  border: 5px solid; border-radius: 12px; padding: 7px 16px; background: rgba(0,0,0,.18); }
.fm-stamp--yes { left: 22px; transform: rotate(-14deg); color: #1fbf6b; border-color: #1fbf6b; text-shadow: 0 1px 6px rgba(0,0,0,.3); }
.fm-stamp--no { right: 22px; transform: rotate(14deg); color: #ff4d4d; border-color: #ff4d4d; text-shadow: 0 1px 6px rgba(0,0,0,.3); }

/* decision burst (pops in the center on Pass/Like) */
.fm-burst { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; pointer-events: none; }
.fm-burst svg { width: 124px; height: 124px; filter: drop-shadow(0 8px 26px rgba(0,0,0,.45));
  animation: fm-burst .72s cubic-bezier(.2,.8,.3,1) forwards; }
.fm-burst-label { font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: #fff; text-transform: uppercase;
  letter-spacing: .03em; text-shadow: 0 2px 14px rgba(0,0,0,.5); animation: fm-burst .72s cubic-bezier(.2,.8,.3,1) forwards; }
.fm-burst--yes { color: #1fbf6b; }
.fm-burst--no { color: #ff4d4d; }
@keyframes fm-burst {
  0% { transform: scale(.3) rotate(-10deg); opacity: 0; }
  35% { transform: scale(1.18) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 0; }
}

/* ---- round action buttons ---------------------------------------------- */
.fm-controls { display: flex; align-items: flex-start; justify-content: center; gap: 26px; margin-top: 18px; }
.fm-ctrl { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.fm-ctrl-cap { font-size: .82rem; font-weight: 700; color: var(--slate); }
.fm-btn {
  display: grid; place-items: center; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--paper); box-shadow: var(--shadow); border: 2px solid currentColor;
  transition: transform .12s ease, background .12s ease, color .12s ease;
}
.fm-btn svg { width: 46%; height: 46%; display: block; }
.fm-btn:active { transform: scale(.9); }
.fm-btn--no  { width: 72px; height: 72px; color: var(--red); }
.fm-btn--yes { width: 72px; height: 72px; color: var(--ok); }
.fm-btn--undo { width: 56px; height: 56px; color: var(--star); }
.fm-btn--no:hover  { background: var(--red); color: #fff; transform: translateY(-2px); }
.fm-btn--yes:hover { background: var(--ok);  color: #fff; transform: translateY(-2px); }
.fm-btn--undo:hover { background: var(--star); color: #fff; transform: translateY(-2px); }
.fm-btn:disabled { opacity: .35; cursor: default; }
.fm-btn:disabled:hover { background: var(--paper); color: var(--star); transform: none; }

.fm-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.fm-progress { margin: 0; font-weight: 700; color: var(--slate); }
.fm-link { background: none; border: 0; padding: 8px 4px; font-weight: 800; font-size: 1.02rem; color: var(--red-dark); cursor: pointer; text-underline-offset: 3px; }
.fm-link:hover { text-decoration: underline; }
.fm-hint { margin: 8px 0 0; text-align: center; font-size: .9rem; color: var(--slate-2); }

/* ---- lead capture modal ------------------------------------------------- */
/* z-index above the sticky site-head (100) + mobile-bar (90) so the modal — title
   included — is never covered by the page chrome. */
.fm-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; background: rgba(12,14,19,.62); padding: 0; }
@media (min-width: 560px) { .fm-modal { align-items: center; padding: 16px; } }
.fm-panel { width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; background: var(--paper); border-radius: 22px 22px 0 0; padding: 22px; box-shadow: var(--shadow-lg); }
@media (min-width: 560px) { .fm-panel { border-radius: var(--radius); } }
.fm-cap-title { font-family: var(--display); font-weight: 800; font-size: 1.7rem; color: var(--ink); text-align: center; margin: 0; }
.fm-cap-sub { margin: 5px 0 16px; text-align: center; color: var(--slate); font-size: 1rem; }
.fm-field { margin-bottom: 12px; }
.fm-field label { display: block; margin-bottom: 5px; font-weight: 700; font-size: 1rem; color: var(--ink); }
.fm-input { min-height: 54px; width: 100%; border: 2px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); padding: 0 14px; font-size: 1.05rem; font-weight: 600; color: var(--ink); font-family: var(--sans); }
select.fm-input { padding-right: 8px; }
.fm-input:focus { outline: none; border-color: var(--red); }
.fm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fm-note { margin: 4px 0 0; font-size: .85rem; color: var(--slate-2); }
.fm-consent { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: .9rem; color: var(--slate); line-height: 1.4; }
.fm-consent input { margin-top: 3px; width: 22px; height: 22px; flex: none; accent-color: var(--red-dark); }
.fm-consent a { color: var(--red-dark); font-weight: 700; }
.cf-turnstile { margin: 4px 0 12px; }
.fm-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.fm-err { background: var(--red-dark); color: #fff; border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 700; margin-bottom: 12px; }
/* Normal flow (NOT sticky) — a sticky bar floated up over the Turnstile + lower
   fields on short viewports, hiding them. Buttons sit at the natural end of the form. */
.fm-cap-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.fm-ts-label { margin: 6px 0 6px; font-size: .92rem; font-weight: 700; color: var(--ink); }
.fm-cta { min-height: 56px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); font-weight: 800; font-size: 1.05rem; cursor: pointer; border: 2px solid transparent; text-decoration: none; transition: transform .12s ease, filter .12s ease; }
.fm-cta:active { transform: scale(.97); }
.fm-cta--red { background: var(--red-dark); color: #fff; width: 100%; }
.fm-cta--red:hover { filter: brightness(.95); }
.fm-cta--dark { background: var(--ink); color: #fff; }
.fm-cta--dark:hover { filter: brightness(1.15); }
.fm-cta--ghost { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.fm-cta--ghost:hover { background: var(--paper-2); }
.fm-cta--block { width: 100%; margin-top: 14px; }
.fm-skip { display: block; width: 100%; margin-top: 14px; background: none; border: 0; padding: 10px; text-align: center; font-weight: 700; color: var(--slate); cursor: pointer; text-underline-offset: 3px; }
.fm-skip:hover { text-decoration: underline; }
.fm-fineprint { margin: 12px 0 0; text-align: center; font-size: .76rem; line-height: 1.5; color: var(--slate-2); }

/* ---- matches view ------------------------------------------------------- */
.fm-matches { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.fm-matches .fm-title { font-size: 1.7rem; text-align: center; }
.fm-matches .fm-sub { text-align: center; }
.fm-match-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fm-match { display: flex; align-items: center; gap: 12px; background: var(--paper-2); border-radius: var(--radius-sm); padding: 10px; }
.fm-match img { width: 92px; height: 62px; flex: none; object-fit: cover; border-radius: 9px; }
.fm-match-info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.fm-match-info a { font-weight: 800; font-size: 1.05rem; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-match-info a:hover { color: var(--red-dark); text-decoration: underline; }
.fm-match-info span { font-size: .95rem; font-weight: 600; color: var(--slate); }
.fm-match-score { flex: none; background: var(--ok); color: #fff; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 1.1rem; font-weight: 800; }

/* ---- focus + reduced motion -------------------------------------------- */
.fm-btn:focus-visible, .fm-cta:focus-visible, .fm-link:focus-visible, .fm-skip:focus-visible,
.fm-input:focus-visible, .fm-card--top:focus-visible, .fm-consent input:focus-visible {
  outline: 3px solid var(--red); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .fm-btn, .fm-cta, .fm-card--top { transition: none !important; }
  .fm-burst svg, .fm-burst-label { animation-duration: .45s; }
}
