/* The trade landing pages (public/hvac.html, plumbing.html, restoration.html, injury-law.html,
   electrical.html, roofing.html), written by scripts/trade-pages.js. DESIGN.md tokens only
   (pw-tokens.css), on top of porchwave.css and pw-buttons.css. The layout is the approved HVAC design
   (version five); the scripts are assets/trade-offer.js (in <head>) and assets/trade-page.js. */

/* The after-demo card this visitor gets (assets/trade-offer.js sets html[data-offer] before the page
   paints). Without the script the default card (the response test) shows and the other stays hidden. */
html:not([data-offer="preview"]) [data-offer-only="preview"], html[data-offer="preview"] [data-offer-only="test"] { display:none !important; }

[id] { scroll-margin-top:96px; }
.marketing-section h2 + .pw-intro, .marketing-section .pw-intro { max-width:none; }
.tp-lead { margin-top:1.5rem; }
.tp-keyline { font-family:var(--pw-font-display); font-weight:700; font-size:1.35rem; line-height:1.3; color:var(--pw-navy-950); margin:1.25rem 0 0; }
.tp-proofline { margin-top:1.5rem; padding-left:1rem; border-left:4px solid var(--pw-teal-500); max-width:40rem; }
.tp-proofline b { color:var(--pw-navy-950); }
.tp-proofline cite { display:block; font-style:normal; font-size:.8rem; color:var(--pw-slate); margin-top:.25rem; }
cite a { text-decoration:underline; }

/* Statistics */
.tp-stats { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:var(--pw-grid-gap); margin:2rem 0; padding:0; list-style:none; }
.tp-stats-4 { grid-template-columns:repeat(4, minmax(0, 1fr)); }
.tp-stat { background:var(--pw-white); border:1px solid var(--pw-border); border-radius:var(--pw-radius-card); padding:var(--pw-card-padding); }
.tp-stat b { display:block; font-family:var(--pw-font-display); font-size:clamp(2rem, 4vw, 2.75rem); line-height:1.05; color:var(--pw-navy-950); }
.tp-stat span { display:block; margin-top:.4rem; color:var(--pw-slate); }
.tp-stat cite, cite.tp-inline { display:block; margin-top:.75rem; font-size:.8rem; font-style:normal; color:var(--pw-slate); }
.pw-dark .tp-stat span { color:var(--pw-navy-950); }
.pw-dark .tp-stat cite a { color:var(--pw-blue-600); text-decoration:underline; }
.pw-dark cite.tp-inline { color:var(--pw-on-dark-muted); }
.pw-dark cite.tp-inline a { color:var(--pw-white); }
@media (max-width:1100px) { .tp-stats-4 { grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width:900px) { .tp-stats { grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width:520px) { .tp-stats, .tp-stats-4 { grid-template-columns:minmax(0, 1fr); } }

.tp-two { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:var(--pw-grid-gap); align-items:start; }
.tp-block { margin-top:3rem; }
@media (max-width:900px) { .tp-two { grid-template-columns:minmax(0, 1fr); } }
.tp-limits { margin-top:2rem; }
.tp-list-tight li + li { margin-top:.5rem; }

/* "Try it!": the real sample assistant (widget.js inline mode) beside the after-demo card */
#try { position:relative; }
.tp-split { display:grid; grid-template-columns:minmax(0, 400px) minmax(0, 1fr); gap:calc(var(--pw-grid-gap) * 2); align-items:stretch; }
@media (max-width:900px) { .tp-split { grid-template-columns:minmax(0, 1fr); } }
.tp-widget-pane { min-width:0; display:flex; flex-direction:column; gap:.75rem; }
.tp-suggest { margin:0; color:var(--pw-navy-950); }
.tp-mount { display:none; position:relative; height:600px; max-width:400px; border-radius:18px; overflow:hidden; background:var(--pw-white);
  box-shadow:0 28px 56px -24px rgba(7,29,58,.45); border:1px solid var(--pw-border); }
html[data-js] .tp-mount { display:block; }
html[data-js] .tp-mount.is-off { display:none; }
.tp-loading { position:absolute; inset:0; display:grid; place-items:center; margin:0; padding:1rem; text-align:center; color:var(--pw-slate); }
.tp-mount.is-live .tp-loading { display:none; }
@media (max-width:900px) { .tp-mount { height:560px; } }

/* The scripted fallback: shown without JavaScript, or when the live assistant cannot be loaded. Always labelled. */
.tp-example { --wm-line:#D8E5ED; --wm-navy:#071D3A; --wm-mist:#F2F7FA; max-width:400px; background:var(--pw-white); border:1px solid var(--pw-border);
  border-radius:18px; padding:1rem; box-shadow:0 28px 56px -24px rgba(7,29,58,.45); }
html[data-js] .tp-example { display:none; }
html[data-js] .tp-example.is-on { display:block; }
.tp-example-label { font-size:.8125rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--pw-navy-800); margin:0 0 .25rem; }
.tp-example-note { font-size:.875rem; color:var(--pw-slate); margin:0 0 .75rem; }
.tp-example-log { list-style:none; margin:0; padding:.5rem; background:var(--wm-mist); border-radius:12px; max-height:520px; overflow-y:auto; }
.tp-example-log .wm-msg { font-size:15px; line-height:1.4; }
.tp-example-log .wm-msg b { display:block; font-size:.75rem; letter-spacing:.04em; text-transform:uppercase; margin-bottom:.15rem; }
.tp-office { margin-top:.75rem; }
.tp-office summary { cursor:pointer; font-weight:600; color:var(--pw-navy-950); }
.tp-office dl { display:grid; grid-template-columns:max-content minmax(0, 1fr); gap:.35rem .75rem; margin:.75rem 0 0; font-size:.9rem; }
.tp-office dt { font-weight:600; color:var(--pw-navy-950); }
.tp-office dd { margin:0; overflow-wrap:anywhere; }
@media (max-width:480px) { .tp-office dl { grid-template-columns:minmax(0, 1fr); gap:.1rem; } .tp-office dd { margin-bottom:.4rem; } }

/* The hand-drawn arrows from "Try it!" to the assistant, and from the assistant to the card */
.tp-arrow { position:absolute; left:0; top:0; width:100%; height:100%; pointer-events:none; overflow:visible; z-index:2; }
.tp-arrow path { fill:none; stroke:var(--pw-teal-500); stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
#tryWord { position:relative; white-space:nowrap; }
@media (max-width:900px) { .tp-arrow { display:none; } }

/* The after-demo card: the response test (default) or the own-website preview (?offer=preview) */
.pw-card.tp-own { background:var(--pw-navy-950); border:2px solid var(--pw-navy-950); color:var(--pw-white); align-self:stretch; }
.tp-own h3, .tp-own .tp-own-form label { color:var(--pw-white); }
.tp-own h3.tp-own-heading { color:var(--pw-teal-500); }
.tp-own h3:focus { outline:none; }
.tp-own p { color:var(--pw-on-dark-muted); }
.tp-own .pw-note { color:var(--pw-on-dark-muted); margin-top:1rem; }
.tp-own :focus-visible { outline-color:var(--pw-focus-dark); }
.tp-own-form { display:grid; gap:.5rem; padding-top:1em; }
.tp-own-form label { font-weight:600; }
.tp-own-form label + input + label { margin-top:10px; }
.tp-own-form input { font:inherit; min-height:48px; padding:.7rem .9rem; border:1px solid transparent; border-radius:var(--pw-radius-control); width:100%; box-sizing:border-box;
  background:var(--pw-white); color:var(--pw-navy-950); }
.tp-own-form .pw-btn { justify-self:start; width:auto; margin-top:.5rem; }
.tp-own-form .pw-btn[disabled] { opacity:.7; cursor:progress; }
.tp-form-error { margin:.25rem 0 0; color:var(--pw-white); font-weight:600; }
.tp-form-error:empty { display:none; }
.tp-form-error:not(:empty) { border-left:4px solid var(--pw-warning); padding-left:.75rem; }
.tp-own-done { margin-top:1rem; padding:1rem 1.25rem; border-left:4px solid var(--pw-teal-500); background:rgba(255,255,255,.06); border-radius:var(--pw-radius-control); }
.tp-own-done h3 { margin:0 0 .5rem; }
.tp-own-done p { color:var(--pw-white); margin:0; }
.tp-hp { position:absolute; left:-10000px; width:1px; height:1px; overflow:hidden; }
.tp-ownstat { margin:0 0 1.25rem; padding:0 0 1.25rem; border-bottom:1px solid rgba(255,255,255,.18); font-family:var(--pw-font-display); font-weight:700; font-size:1.5rem; line-height:1.25; }
.tp-own .tp-ownstat { color:var(--pw-white); }
.tp-ownstat b { display:block; font-size:3.25rem; line-height:1; color:var(--pw-teal-500); margin:0 0 .25rem; }
.tp-ownstat cite { display:block; margin-top:.6rem; font-family:var(--pw-font-ui); font-weight:400; font-style:normal; font-size:.8rem; color:var(--pw-on-dark-muted); }
.tp-own .tp-ownstat cite a { color:var(--pw-white); text-decoration:underline; }
