/* Core Coatings — tools.css
   Page styles for /tools/, System Finder, Defect Fixer.
   Loaded after site.css. Tokens only, no hard-coded colours. */

/* ---------- Page head */
.tool-head { padding-bottom: 0; }
.tool-head .lead { margin-top: var(--s-4); max-width: 620px; }
.tool-body { padding-top: var(--s-7); }
.crumb { font-size: 15px; font-weight: 600; text-decoration: none; display: inline-flex; gap: var(--s-2); align-items: center; min-height: 40px; }
.crumb .icon { width: 16px; height: 16px; transform: rotate(180deg); }

/* ---------- Draft flag (review-only pages) */
.draft-flag {
  display: flex; gap: var(--s-3); align-items: flex-start;
  margin-top: var(--s-5); padding: var(--s-3) var(--s-4);
  border: 1px solid var(--error); border-left-width: 3px; border-radius: var(--radius);
  color: var(--error); font-weight: 600; font-size: 15px; max-width: 720px;
}
.draft-flag .icon { margin-top: 1px; }

/* ---------- Tools index cards */
.tool-cards { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.tool-card {
  display: flex; flex-direction: column; height: 100%; min-height: 280px;
  padding: var(--s-6); background: var(--paper-2); color: var(--ink); text-decoration: none;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
a.tool-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--lift); }
@media (prefers-reduced-motion: reduce) { .tool-card, a.tool-card:hover, a.tool-card:hover .link-arrow .icon { transform: none !important; transition: none; } }
.tool-card__icon {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--blue);
}
.tool-card__icon .icon { width: 24px; height: 24px; }
.tool-card h2 { font-size: 24px; letter-spacing: -0.02em; line-height: 1.15; margin-top: var(--s-6); }
.tool-card p { color: var(--muted); margin-top: var(--s-3); }
.tool-card .link-arrow { margin-top: auto; align-self: flex-start; }
.tool-card p { margin-bottom: var(--s-5); }
a.tool-card:hover .link-arrow .icon { transform: translateX(3px); }

/* ---------- System Finder */
.finder { max-width: 860px; }
.finder__progress { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-5); }
.finder__pips { display: flex; gap: var(--s-1); }
.finder__pips span { width: 32px; height: 4px; border-radius: 2px; background: var(--line); }
.finder__pips span.is-done { background: var(--blue); }
.finder__step { border: 0; padding: 0; margin: 0; min-width: 0; }
.finder__step legend, .finder .finder__q { padding: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: var(--s-3); }
.finder__hint { color: var(--muted); margin-bottom: var(--s-5); max-width: 640px; }
.choices { display: grid; gap: var(--s-2); }
.choices--two { grid-template-columns: 1fr 1fr; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choice__box {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s-1) var(--s-4); align-items: start;
  min-height: 72px; padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  transition: border-color .15s, background-color .15s;
}
.choice:hover .choice__box { border-color: var(--muted); }
.choice input:checked + .choice__box { border-color: var(--blue); background: var(--blue-5); }
.choice input:focus-visible + .choice__box { outline: 2px solid var(--blue); outline-offset: 2px; }
.choice__title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.choice__text { grid-column: 1 / -1; font-size: 15px; color: var(--muted); max-width: 64ch; }
.choice input:checked + .choice__box .choice__text { color: var(--ink); }
.choice .label { white-space: nowrap; padding-top: 4px; }
.finder__nav { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); align-items: center; margin-top: var(--s-6); }
.finder__note { margin-bottom: var(--s-5); padding: var(--s-3) var(--s-4); border: 1px solid var(--blue-4); border-radius: var(--radius); background: var(--paper-2); font-size: 15px; }
.finder__note button { appearance: none; border: 0; background: none; padding: 0; color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.helper__q { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: var(--s-4); }
.helper .btn-row .btn { min-width: 120px; }
.helper__count { margin-bottom: var(--s-3); }

/* Answer */
.answer__summary { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-4) 0 var(--s-6); list-style: none; }
.answer__summary li { padding: 6px var(--s-3); border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.answer__prep { margin-bottom: var(--s-5); }
.coats { list-style: none; counter-reset: coat; border-top: 1px solid var(--ink); }
.coats > li {
  counter-increment: coat; display: grid; grid-template-columns: 48px 1fr; gap: var(--s-2) var(--s-4); align-items: baseline;
  padding: var(--s-5) 0; border-bottom: 1px solid var(--line);
}
.coats > li::before { content: counter(coat, decimal-leading-zero); font: 500 13px/1 var(--mono); color: var(--muted); }
.coats__role { display: block; font-size: 14px; color: var(--muted); }
.coats__name { display: inline-block; font-size: 20px; font-weight: 600; letter-spacing: -0.015em; text-decoration: none; color: var(--ink); }
.coats__name:hover { color: var(--blue); }
.coats .label { display: block; margin-top: var(--s-1); }
.answer__none { font-size: 18px; max-width: 62ch; padding: var(--s-5) 0; border-top: 1px solid var(--ink); }
.answer__note { margin-top: var(--s-5); color: var(--muted); max-width: 64ch; }
.answer__actions { margin-top: var(--s-6); }
.answer__small { margin-top: var(--s-5); font-size: 14px; color: var(--muted); max-width: 64ch; }

/* Lead form under every answer (posts as trade-pricing). Same field styles as the pricing page. */
.sf-lead { margin-top: var(--s-7); padding: var(--s-6); max-width: 640px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.sf-lead:has(> .form-sent) { padding: 0; border-color: transparent; }
.sf-lead:has(> .form-sent) .sf-lead__title { display: none; }
.sf-lead__title { margin: 0 0 var(--s-5); font-size: 24px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.sf-lead .field--phone .field__label { font-size: 17px; }
.sf-lead .field--phone .input { font-size: 18px; font-weight: 600; letter-spacing: .01em; }
.sf-lead .check { display: flex; gap: var(--s-3); align-items: flex-start; }
.sf-lead .check input[type="checkbox"] { width: 20px; height: 20px; margin: 3px 0 0; flex: none; accent-color: var(--blue); }
.sf-lead .check span { font-size: 15px; color: var(--muted); }
.sf-lead__notes { display: grid; gap: var(--s-1); }
.sf-lead .price-note { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink); }
.sf-lead__talk { margin: 0; font-size: 15px; color: var(--muted); }
.sf-lead__talk a { font-weight: 700; color: var(--ink); white-space: nowrap; }

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

.btn-text {
  appearance: none; border: 1.5px solid var(--blue); border-radius: var(--radius); background: var(--paper); min-height: 40px; padding: 0 var(--s-4);
  color: var(--blue); font-weight: 600; font-size: 15px; cursor: pointer; display: inline-flex; gap: var(--s-2); align-items: center;
  transition: background-color .18s, border-color .18s, color .18s;
}
.btn-text:hover, .btn-text:focus-visible { background: var(--go); border-color: var(--go); color: #fff; }
.btn-text .icon { width: 16px; height: 16px; }

/* ---------- Defect Fixer */
.defect-jump { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; margin-top: var(--s-6); }
.defect-jump a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s-4);
  border: 1px solid var(--line); border-radius: 999px; font-size: 15px; color: var(--ink); text-decoration: none;
}
.defect-jump a:hover { border-color: var(--blue); color: var(--blue); }
.defects { list-style: none; display: grid; gap: 0; }
.defect { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--s-5); padding: var(--s-7) 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 16px); }
.defect:last-child { border-bottom: 1px solid var(--line); }
.defect__icon { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); color: var(--blue); }
.defect__icon .icon { width: 26px; height: 26px; }
.defect h2 { font-size: 30px; letter-spacing: -0.02em; line-height: 1.12; }
.defect__see { margin-top: var(--s-3); font-size: 18px; max-width: 64ch; }
.defect__parts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5) var(--s-6); margin-top: var(--s-6); }
.defect__parts h3 { font: 500 13px/1.4 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding-bottom: var(--s-2); border-bottom: 1px solid var(--ink); margin-bottom: var(--s-3); }
.defect__parts ul { padding-left: 1.1em; display: grid; gap: var(--s-2); font-size: 16px; }
.defect__photo { margin-top: var(--s-6); }

/* ---------- Responsive */
@media (max-width: 1023px) {
  .tool-cards { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; }
  .defect__parts { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .tool-head:has(.tool-head__row) + .tool-body { padding-top: var(--s-6); }
  .finder__step legend, .finder .finder__q { font-size: 24px; }
  .choices--two { grid-template-columns: 1fr; }
  .choice__box { padding: var(--s-4); }
  .choice__title { font-size: 17px; }
  .coats > li { grid-template-columns: 36px 1fr; }
  .defect { grid-template-columns: 1fr; gap: var(--s-4); padding: var(--s-6) 0; }
  .defect h2 { font-size: 24px; }
  .defect__see { font-size: 17px; }
  .tool-card { padding: var(--s-5); }
  .sf-lead { padding: var(--s-5); }
}
@media (max-width: 639px) {
  .finder__nav .btn, .answer__actions .btn { flex: 1 1 100%; }
  .helper .btn-row .btn { flex: 1 1 0; min-width: 0; }
}
@media print {
  .draft-flag { color: #000; border-color: #000; }
  .defect-jump, .finder__nav, .answer__actions, .sf-lead { display: none !important; }
}

/* ---------- Touch: :hover sticks after a tap, so it only tints with a real pointer */
@media (hover: none) {
  .choice:hover .choice__box { border-color: var(--line); }
  .choice input:checked + .choice__box { border-color: var(--blue); }
}

/* ---------- Small layout helpers (kept out of inline styles) */
.defect-intro { max-width: 68ch; }
.defects-wrap { margin-top: var(--s-7); }

/* ---------- System Finder on a laptop (3 Dec 2026)
   Every step's options and its Next button fit in one screen at 1366x768, and the result shows the
   system and the price form side by side, so the form and its button are in view without scrolling. */
.tool-head__row .lead { margin-top: 0; }
.answer__grid { display: grid; gap: var(--s-6); }
.answer__system { min-width: 0; }
.answer__system .answer__summary { margin-top: 0; }
.sf-lead__intro { margin: calc(-1 * var(--s-3)) 0 var(--s-5); font-size: 15px; color: var(--muted); }
.sf-lead .form { gap: var(--s-4); }
.sf-lead .form__row { gap: var(--s-3); }
.sf-lead .btn[type="submit"] { width: 100%; justify-self: stretch; }
.sf-lead .form-sent__next { justify-self: start; }
@media (min-width: 1024px) {
  .tool-head:has(.tool-head__row) { padding-top: var(--s-5); }
  .tool-head:has(.tool-head__row) .crumb { min-height: 32px; }
  .tool-head__row { display: grid; grid-template-columns: auto minmax(0, 560px); gap: var(--s-7); align-items: center; margin-top: var(--s-2); }
  .tool-head__row .page-title { margin: 0; font-size: 40px; }
  .tool-head__row .lead { font-size: 17px; }
  .tool-head:has(.tool-head__row) + .tool-body { padding-top: var(--s-6); }
  .finder { max-width: none; }
  .finder__progress { margin-bottom: var(--s-4); }
  .finder__step legend, .finder .finder__q { font-size: 26px; margin-bottom: var(--s-2); }
  .finder__hint { margin-bottom: var(--s-4); }
  .choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choices--two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 860px; }
  .choice__box { min-height: 0; height: 100%; padding: var(--s-4); }
  .choice__text { font-size: 14.5px; }
  .finder__step { max-width: 1240px; }
  .finder__step:not([data-step="answer"]) .finder__nav {
    position: sticky; bottom: 0; z-index: 5; margin-top: var(--s-4); padding: var(--s-3) 0;
    background: var(--paper); box-shadow: 0 -1px 0 var(--line);
  }
  .finder__step[data-step="answer"] { scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
  .answer__grid { grid-template-columns: minmax(0, 1fr) 460px; gap: var(--s-7); align-items: start; }
  .answer__grid .sf-lead { margin-top: 0; max-width: none; padding: var(--s-5); border: 1.5px solid var(--blue-4); }
  .answer__grid .coats > li { padding: var(--s-4) 0; }
  .sf-lead__title { margin-bottom: var(--s-3); font-size: 22px; }
  .sf-lead__intro { margin: calc(-1 * var(--s-2)) 0 var(--s-4); }
  .sf-lead .form-sent { margin: 0; }
}
@media (max-width: 1023px) {
  .tool-head__row .lead { margin-top: var(--s-4); }
}
.finder__nav-hint { margin: 0; font-size: 15px; color: var(--muted); }
.finder__nav:has([data-next]:not(:disabled)) .finder__nav-hint { display: none; }
/* Headings focused by script when a step changes: no ring (the step change is the cue) */
.finder [data-focus]:focus:not(:focus-visible), .finder [data-focus][tabindex="-1"]:focus { outline: none; }
.sf-lead .textarea { min-height: 72px; }
.sf-lead:has(> .form-sent) .sf-lead__intro { display: none; }
.answer__grid .sf-lead:has(> .form-sent) { padding: 0; border-color: transparent; }
.sf-lead .form[data-state="failed"] .form__status { padding: var(--s-2) var(--s-3); font-size: 14px; }
