/* ============================================================
   Collision Strategy — total-loss.css
   Add-on styles for the "Is my vehicle a total loss?" floating button
   (loaded on the home page) and the total-loss guide page. Shares the
   tokens, buttons, forms and sheets from styles.css; nothing there changes.
   ============================================================ */

/* ---------- Floating button ----------
   A blueprint sheet with the bent orange corner, pinned bottom-right on
   every screen size: a sheet on desktop, a compact bar on phones in the
   thumb zone (the pattern most lead-gen sites use),
   inset for Android gesture bars. total-loss.js adds .is-away while a
   contact form or the footer is on screen so it never covers a submit
   button. It slides in on its own one second after load. */
.tl-float {
  --corner: 22px; --corner-tab: 16px;
  position: fixed; z-index: 60;
  right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 32px);
  background: var(--blueprint);
  color: var(--on-blueprint);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-md);
  padding: 13px 34px 13px 16px;
  font-family: var(--font-display);
  font-weight: 800; font-size: 20px; line-height: 1;
  letter-spacing: 0.03em; text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 4px 8px rgba(12, 29, 51, 0.10), 0 22px 48px rgba(12, 29, 51, 0.22);
  animation: tlFloatUp 0.6s var(--ease-out) 1s both;
  transition: opacity 0.3s ease, transform 0.35s var(--ease-out), background 0.2s var(--ease-soft), box-shadow 0.3s var(--ease-out), visibility 0s linear 0.35s;
}
@keyframes tlFloatUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.tl-float.is-away { opacity: 0; transform: translateY(24px); visibility: hidden; pointer-events: none; }
.tl-float::before {
  /* orange bent corner, drawn as a layer so the shadow follows the sheet */
  content: "";
  position: absolute; top: -1px; right: -1px;
  width: calc(var(--corner-tab) + 1px); height: calc(var(--corner-tab) + 1px);
  background: var(--safety);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.tl-float::after {
  /* the paper notch behind the corner */
  content: "";
  position: absolute; top: -1px; right: -1px;
  width: var(--corner); height: var(--corner);
  background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  z-index: -1;
}
.tl-float:hover { background: var(--blueprint-deep); color: var(--on-blueprint); transform: translateY(-2px); box-shadow: 0 6px 12px rgba(12, 29, 51, 0.14), 0 28px 56px rgba(12, 29, 51, 0.28); }
.tl-float svg { flex-shrink: 0; color: var(--safety); animation: tlBlink 2.4s ease-in-out 2s 3; }
@keyframes tlBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Phones: bottom-right bar in the thumb zone, never past the screen edge */
@media (max-width: 640px) {
  .tl-float {
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    padding: 12px 26px 12px 14px; gap: 9px;
    font-size: 15px;
    --corner: 18px; --corner-tab: 13px;
  }
  .tl-float.is-away { transform: translateY(24px); }
  .tl-float svg { width: 18px; height: 18px; }
  .tl-float:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tl-float { animation: none; }
  .tl-float, .tl-float.is-away { transition: opacity 0.01s, visibility 0s; transform: none; }
  .tl-float:hover { transform: none; }
  .tl-float svg { animation: none; }
}

/* ============================================================
   Total-loss guide page (total-loss.html)
   ============================================================ */
/* the guide's nav labels run longer than the home page's */
.site-nav a { white-space: nowrap; }
@media (max-width: 1140px) { .page-tl .brand-sub { display: none; } }
.hero-sub > .container { padding-top: 88px; padding-bottom: 0; }
.hero-sub .hero-lead { margin-bottom: 32px; }
.crumb { color: var(--on-blueprint-muted); text-decoration: underline; text-underline-offset: 3px; }
.crumb:hover { color: var(--on-blueprint); }

/* on-this-page index along the bottom of the hero */
.tl-index {
  list-style: none; margin: 72px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--on-blueprint-line);
}
.tl-index li { border-left: 1px solid var(--on-blueprint-line); }
.tl-index li:first-child { border-left: none; }
.tl-index a {
  display: block; height: 100%;
  padding: 22px 18px 30px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 19px; line-height: 1.1;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--on-blueprint);
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}
.tl-index li:first-child a { padding-left: 0; }
.tl-index a span {
  display: block; margin-bottom: 8px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em;
  color: var(--on-blueprint-muted);
}
.tl-index a:hover { color: var(--on-blueprint); border-bottom-color: var(--safety); }

/* policy & rights panels */
.tl-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.tl-panel {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 30px 30px 18px;
}
.tl-panel h3 {
  font-size: 24px; line-height: 28px;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 2px solid var(--blueprint);
}
.tl-checks { list-style: none; margin: 0; padding: 0; }
.tl-checks li {
  position: relative;
  padding-left: 30px; margin-bottom: 14px;
  font-size: 15px; line-height: 24px; color: var(--ink-muted);
}
.tl-checks li::before {
  content: "";
  position: absolute; left: 2px; top: 6px;
  width: 13px; height: 7px;
  border-left: 2px solid var(--drafting); border-bottom: 2px solid var(--drafting);
  transform: rotate(-45deg);
}
.tl-checks strong { color: var(--ink); font-weight: 600; }
.tl-footnote { font-size: 15px; line-height: 24px; color: var(--ink-muted); margin: 26px 0 0; }

/* "offer isn't final" numbered actions */
.tl-steps-inline {
  list-style: none; counter-reset: tlstep;
  margin: 26px 0 0; padding: 0;
  border-bottom: 1px solid var(--line);
}
.tl-steps-inline li {
  counter-increment: tlstep;
  display: grid; grid-template-columns: 40px 1fr; align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 16px; line-height: 24px; color: var(--ink);
}
.tl-steps-inline li::before {
  content: "0" counter(tlstep);
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--blueprint);
}
#offer .guarantee-copy h2 { font-size: clamp(32px, 4vw, 44px); }
#offer .guarantee-copy > .section-no { font-size: 12px; line-height: 16px; margin: 0 0 16px; color: var(--ink-muted); }
#offer .guarantee-copy > p:not(.section-no) { font-size: 17px; line-height: 28px; color: var(--ink-muted); margin: 18px 0 0; }

/* appraisal clause: the page's highlighted band */
.tl-appraisal { background: var(--blueprint); color: var(--on-blueprint); }
.tl-appraisal-head { max-width: 820px; }
.tl-appraisal .section-no { color: var(--on-blueprint-muted); }
.tl-appraisal .section-no > span { color: var(--on-blueprint); }
.tl-appraisal h2 { color: var(--on-blueprint); font-size: clamp(34px, 4.8vw, 54px); font-weight: 800; text-transform: uppercase; line-height: 1; }
.tl-appraisal-head .dim-line { width: min(240px, 50%); margin: 28px 0 0; }
.tl-appraisal-head p:not(.section-no) { font-size: 18px; line-height: 30px; color: var(--on-blueprint-muted); margin: 28px 0 0; max-width: 62ch; }
.tl-appraisal-steps {
  list-style: none; counter-reset: appr;
  margin: 60px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--on-blueprint-line);
}
.tl-appraisal-steps li {
  counter-increment: appr;
  padding: 26px 24px 4px;
  border-left: 1px solid var(--on-blueprint-line);
}
.tl-appraisal-steps li:first-child { border-left: none; padding-left: 0; }
.tl-appraisal-steps li::before {
  content: "0" counter(appr);
  display: block; margin-bottom: 14px;
  font-family: var(--font-mono); font-size: 28px; line-height: 32px; font-weight: 500;
  color: var(--on-blueprint);
}
.tl-appraisal-steps h3 { color: var(--on-blueprint); font-size: 22px; line-height: 26px; margin-bottom: 8px; }
.tl-appraisal-steps p { font-size: 15px; line-height: 24px; color: var(--on-blueprint-muted); margin: 0; }
.tl-appraisal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 24px 40px;
  margin-top: 56px; padding: 24px 28px;
  background: var(--on-blueprint-panel);
  border: 1px solid var(--on-blueprint-line);
  border-radius: var(--radius-md);
}
.tl-appraisal-foot p { margin: 0; max-width: 64ch; font-size: 15px; line-height: 24px; color: var(--on-blueprint-muted); }
.tl-appraisal-foot strong { color: var(--on-blueprint); font-weight: 600; }
.tl-appraisal-foot .btn { flex-shrink: 0; }

/* value check */
.tl-value-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: start; }
.tl-vin-row { display: flex; gap: 10px; }
.tl-vin-row input { flex: 1; min-width: 0; font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.tl-vin-row input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--font-sans); }
.tl-vin-row .btn { flex-shrink: 0; }
.tl-help { font-size: 13px; line-height: 18px; color: var(--ink-muted); margin: 7px 0 0; }
.tl-optional { text-transform: none; letter-spacing: 0; color: #8A95A3; font-family: var(--font-sans); }
.tl-decoded {
  display: grid; gap: 3px;
  margin: -4px 0 18px; padding: 12px 16px;
  background: var(--blueprint-soft);
  border-left: 3px solid var(--blueprint);
  border-radius: var(--radius-sm);
  font-size: 14px; line-height: 20px;
}
.tl-decoded[hidden] { display: none; }
.tl-decoded strong {
  font-family: var(--font-display); font-weight: 700;
  font-size: 21px; line-height: 24px; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--blueprint);
}
.tl-decoded span { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-muted); }
.tl-decoded .tl-decoded-warn { font-family: var(--font-sans); font-size: 13px; color: var(--safety-ink); }
.tl-decoded.is-warn { background: var(--safety-soft); border-left-color: var(--safety-ink); color: var(--safety-ink); }
.tl-manual { margin: 0 0 18px; }
.tl-manual summary {
  cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 600; color: var(--blueprint);
  text-decoration: underline; text-underline-offset: 3px;
}
.tl-manual summary::-webkit-details-marker { display: none; }
.tl-manual summary:hover { color: var(--safety-ink); }
.tl-manual[open] summary { margin-bottom: 16px; }

.tl-result-wrap { position: sticky; top: calc(var(--header-h) + 24px); }
.tl-result-empty {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 30px 24px;
}
.tl-result-empty[hidden] { display: none; }
.tl-result-kicker {
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--blueprint);
  margin: 0 0 14px; padding-bottom: 14px; border-bottom: 2px solid var(--blueprint);
}
.tl-result-empty ol { list-style: none; counter-reset: how; margin: 0 0 18px; padding: 0; }
.tl-result-empty li {
  counter-increment: how;
  display: grid; grid-template-columns: 34px 1fr;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 15px; line-height: 24px; color: var(--ink-muted);
}
.tl-result-empty li::before { content: "0" counter(how); font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--blueprint); }

.tl-result[hidden] { display: none; }
.tl-result:focus { outline: none; }
.tl-result.is-in { animation: tlPop 0.6s var(--ease-out); }
@keyframes tlPop { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.tl-result-vehicle {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; line-height: 26px; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--ink); margin: 6px 0 0; overflow-wrap: anywhere;
}
.tl-result-vin {
  display: block; margin-top: 4px;
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500;
  letter-spacing: 0.08em; color: var(--ink-muted);
}
.tl-result-value {
  margin: 14px 0 0;
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(44px, 6vw, 60px); line-height: 1;
  color: var(--blueprint);
  font-variant-numeric: tabular-nums;
}
.tl-result-dim { width: min(260px, 70%); margin-top: 16px; }
.tl-result-range {
  margin: 20px 0 16px;
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted);
}
.tl-result-range span { color: var(--ink); margin-left: 6px; letter-spacing: 0.02em; }
.tl-result-gap {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  margin: 12px 0 0; padding: 12px 14px;
  background: var(--blueprint-soft); color: var(--blueprint);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 13px; line-height: 18px;
}
.tl-result-gap[hidden] { display: none; }
.tl-result-gap span:last-child { font-size: 22px; line-height: 26px; font-weight: 500; white-space: nowrap; }
.tl-result-gap.is-short { background: var(--safety-soft); color: var(--safety-ink); }
.tl-result-note { font-size: 14px; line-height: 22px; color: var(--ink-muted); margin: 18px 0 18px; }
.tl-result-note strong { color: var(--ink); font-weight: 600; }

.tl-attached {
  margin: 0 0 14px; padding: 10px 14px;
  background: var(--blueprint-soft);
  border-left: 3px solid var(--blueprint);
  border-radius: var(--radius-sm);
  font-size: 14px; line-height: 20px; color: var(--ink);
}
.tl-attached[hidden] { display: none; }
.tl-bring { font-size: 15px; line-height: 24px; color: var(--ink-muted); margin: 0; }
.tl-bring strong { color: var(--ink); font-weight: 600; }

@media (max-width: 1020px) {
  .tl-columns, .tl-value-grid { grid-template-columns: 1fr; }
  .tl-result-wrap { position: static; }
  .tl-appraisal-steps { grid-template-columns: repeat(2, 1fr); row-gap: 8px; }
  .tl-appraisal-steps li:nth-child(odd) { border-left: none; padding-left: 0; }
  .tl-appraisal-foot { flex-direction: column; align-items: flex-start; }
  .tl-index { grid-template-columns: repeat(3, 1fr); }
  .tl-index li:nth-child(4) { border-left: none; }
  .tl-index li:nth-child(4) a { padding-left: 0; }
  .tl-index li:nth-child(n+4) { border-top: 1px solid var(--on-blueprint-line); }
}

@media (max-width: 640px) {
  .hero-sub > .container { padding-top: 56px; }
  .tl-index { grid-template-columns: 1fr 1fr; margin-top: 48px; }
  .tl-index li, .tl-index li:nth-child(n+4) { border-left: none; border-top: 1px solid var(--on-blueprint-line); }
  .tl-index li:nth-child(-n+2) { border-top: none; }
  .tl-index li:nth-child(even) { border-left: 1px solid var(--on-blueprint-line); }
  .tl-index li a, .tl-index li:nth-child(4) a { padding: 16px 12px 18px 0; font-size: 17px; }
  .tl-index li:nth-child(even) a { padding-left: 14px; }
  .tl-panel { padding: 24px 20px 12px; }
  .tl-appraisal-steps { grid-template-columns: 1fr; }
  .tl-appraisal-steps li { border-left: none; padding-left: 0; border-top: 1px solid var(--on-blueprint-line); }
  .tl-appraisal-steps li:first-child { border-top: none; }
  .tl-appraisal-foot { padding: 20px 18px; }
  .tl-appraisal-foot .btn { width: 100%; }
  .tl-result-empty { padding: 24px 18px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .tl-result.is-in { animation: none; }
}
