/* ==========================================================================
   Kynex Pro — Home-Service Free Tools design system (packages.kynex.business)
   Matches the client landing page palette. No build step. Pairs with kynex-tools.js.
   ========================================================================== */

:root {
  --brand: #046bd2;
  --brand-deep: #1a4b8c;
  --brand-mid: #2563eb;
  --brand-light: #3b82f6;
  --brand-hi: #60a5fa;
  --brand-soft: rgba(4, 107, 210, .10);
  --accent: #f59e0b;
  --ink: #101828;
  --text: #334155;
  --muted: #6a7282;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --soft: #f1f5f9;
  --paper: #f8fafc;
  --good: #16a34a;
  --good-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --rose: #c94862;
  --rose-bg: #fde7ec;
  --shadow: 0 18px 50px rgba(8, 31, 70, .12);
  --shadow-sm: 0 6px 18px rgba(8, 31, 70, .08);
  --radius: 10px;
  --radius-sm: 7px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, #f0f5fa 40%, #eaf3ff 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 92% 6%, rgba(4,107,210,.10), transparent 30%),
    radial-gradient(circle at 6% 86%, rgba(59,130,246,.08), transparent 30%);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
h1, h2, h3, h4 { letter-spacing: 0; line-height: 1.06; color: var(--ink); margin: 0; }
h1 { font-size: clamp(36px, 5.4vw, 62px); }
h2 { font-size: clamp(26px, 3vw, 42px); }
h3 { font-size: 21px; }
.lead { color: var(--text); font-size: clamp(16px, 1.4vw, 21px); max-width: 720px; }
.sub { color: var(--muted); max-width: 760px; margin: 0; }
.mini { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(226,232,240,.9); box-shadow: 0 8px 30px rgba(8,31,70,.06); }
.nav-inner { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 12px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.logo-link { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-img { height: 36px; width: auto; display: block; }
.logo-sub { color: #64748b; font-size: 13px; font-weight: 700; }
.navlinks { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.navlinks a { text-decoration: none; color: #42526a; padding: 8px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.navlinks a:hover { background: var(--brand-soft); color: var(--brand); }
.navlinks a.cta { background: var(--brand); color: #fff; }
.navlinks a.cta:hover { background: var(--brand-deep); color: #fff; }

/* ---------- Buttons ---------- */
.btn { border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); padding: 12px 18px; font-weight: 850; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn.primary { border-color: transparent; background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-deep); }
.btn.dark { border-color: transparent; background: var(--ink); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 38px; padding: 9px 13px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 7px 12px; border: 1px solid rgba(4,107,210,.3); background: rgba(4,107,210,.09); color: var(--brand-deep); border-radius: 999px; font-size: 13px; font-weight: 800; }
.tag { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 850; width: max-content; }
.tag.hot { background: var(--good-bg); color: #166534; border-color: transparent; }
.tag.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag.rose { background: var(--rose-bg); color: var(--rose); border-color: transparent; }

/* ---------- Hero ---------- */
.hero { padding: 70px 0 44px; border-bottom: 1px solid rgba(226,232,240,.9); background: linear-gradient(90deg, rgba(255,255,255,.98), rgba(255,255,255,.85) 55%, rgba(255,255,255,.2) 100%), linear-gradient(135deg, rgba(4,107,210,.16), rgba(96,165,250,.18)); }
.hero h1 { margin: 16px 0 14px; }
.hero h1 strong { color: var(--brand); }

/* ---------- Sections / cards ---------- */
.section { padding: 52px 0; }
.section.tight { padding: 32px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.panel, .card { background: rgba(255,255,255,.97); border: 1px solid rgba(217,224,234,.92); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 24px; }
.card { padding: 18px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.tool-cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.tool-card { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.tool-card .ic { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, var(--brand-deep), var(--brand-mid) 55%, var(--brand-light)); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 20px; margin-bottom: 4px; }
.tool-card h3 { font-size: 19px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14px; }

label { display: block; color: #3d4858; font-size: 13px; font-weight: 800; margin-bottom: 7px; }
input[type=text], input[type=email], input[type=tel], input[type=number], select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: #fff; color: var(--ink); min-height: 46px;
}
.field { margin-bottom: 0; }

/* ---------- Calculator ---------- */
.calc-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 18px; align-items: start; }
.calc-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.result { background: linear-gradient(135deg, rgba(4,107,210,.10), rgba(96,165,250,.12)); border: 1px solid rgba(4,107,210,.22); border-radius: var(--radius); padding: 22px; }
.result-big { font-size: 44px; font-weight: 950; line-height: 1; color: var(--brand-deep); overflow-wrap: anywhere; }
.result-big.danger { color: var(--rose); }
.result-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 9px 0; border-bottom: 1px solid rgba(4,107,210,.14); }
.result-row:last-child { border-bottom: 0; }
.result-row span { color: var(--text); font-size: 13px; }
.result-row strong { color: var(--ink); }
.result-note { margin-top: 12px; color: var(--text); font-size: 14px; }

/* ---------- Quiz (scorecard / audit) ---------- */
.quiz { display: grid; gap: 12px; }
.quiz-q { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: #fff; }
.quiz-q > b { display: block; color: var(--ink); margin-bottom: 10px; font-size: 15px; }
.quiz-options { display: grid; gap: 8px; }
.quiz-opt { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; color: var(--text); font-size: 14px; }
.quiz-opt:hover { border-color: var(--brand); background: #fbfdff; }
.quiz-opt.sel { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); font-weight: 700; color: var(--ink); }
.quiz-opt input { accent-color: var(--brand); width: 18px; height: 18px; }
.audit-q { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff; }
.audit-q b { color: var(--ink); font-size: 14.5px; display: block; }
.audit-q span { color: var(--muted); font-size: 12.5px; }
.toggle-yesno { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.toggle-yesno button { border: 0; background: #fff; color: var(--muted); padding: 8px 16px; font-weight: 850; font-size: 13px; }
.toggle-yesno button.on-yes.active { background: var(--rose); color: #fff; }
.toggle-yesno button.on-no.active { background: var(--good); color: #fff; }

.scorebar { height: 14px; border-radius: 999px; background: var(--line-soft); overflow: hidden; margin: 12px 0; }
.scorebar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-light)); transition: width .35s ease; }
.band { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); }
.band.b0 { background: var(--rose-bg); border-color: rgba(201,72,98,.3); }
.band.b1 { background: var(--warn-bg); border-color: rgba(180,83,9,.3); }
.band.b2 { background: #e0f2fe; border-color: rgba(4,107,210,.3); }
.band.b3 { background: var(--good-bg); border-color: rgba(22,163,74,.3); }
.band h3 { margin-bottom: 6px; }
.leak-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.leak-list li { position: relative; padding-left: 24px; color: var(--text); font-size: 14px; }
.leak-list li::before { content: "⚠"; position: absolute; left: 0; color: var(--rose); }

/* ---------- Lead magnet (checklist guide) ---------- */
.magnet-sections { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.magnet-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: #fff; }
.magnet-sec h4 { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--ink); }
.magnet-sec .n { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--brand-deep), var(--brand-mid)); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 13px; flex: none; }
.magnet-sec ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 7px; }
.magnet-sec li { position: relative; padding-left: 22px; color: var(--text); font-size: 13.5px; }
.magnet-sec li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 900; }

/* ---------- Lead gate ---------- */
.locked-only {}
body.unlocked .locked-only { display: none !important; }
.unlocked-only { display: none; }
body.unlocked .unlocked-only { display: block; }
.gate-card { max-width: 620px; width: 100%; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; text-align: center; }
.gate-card .lock-ic { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-light)); color: #fff; font-size: 26px; }
.gate-form { display: grid; gap: 12px; text-align: left; margin-top: 18px; }
.gate-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gate-error { color: var(--rose); font-size: 13px; font-weight: 800; display: none; }
.gate-error.show { display: block; }
#ghlFormMount { display: none; }
#ghlFormMount iframe { width: 100%; border: 0; min-height: 560px; border-radius: var(--radius-sm); }

/* ---------- Booking embed ---------- */
.book-embed { padding: 10px; }
.book-embed iframe { width: 100%; border: 0; min-height: 720px; display: block; border-radius: 6px; background: #fff; }

/* ---------- Toast ---------- */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 999px; font-weight: 850; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- Footer ---------- */
footer { padding: 38px 0 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); background: rgba(255,255,255,.7); margin-top: 20px; }
footer .foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
footer a { color: var(--brand); font-weight: 800; text-decoration: none; }

@media (max-width: 1000px) {
  .calc-grid { grid-template-columns: 1fr; }
  .tool-cards, .grid.three, .magnet-sections { grid-template-columns: 1fr; }
}
@media (max-width: 660px) {
  .nav-inner { flex-direction: column; align-items: flex-start; }
  .calc-fields, .grid.two, .gate-form .two { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .audit-q { grid-template-columns: 1fr; }
}

@media print {
  .nav, .toast, .btn, footer, .no-print { display: none !important; }
  body { background: #fff; } body::before { display: none; }
  .panel, .card, .magnet-sec { box-shadow: none; break-inside: avoid; }
}

/* ---------- Focus visibility ---------- */
:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 2px; }
.btn:focus-visible, .toggle-yesno button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand-deep); outline-offset: 2px;
}
.quiz-opt:focus-within { outline: 2px solid var(--brand-deep); outline-offset: 2px; }
/* the .toggle-yesno wrapper clips inner outlines, so offset the ring outward */
.toggle-yesno { overflow: visible; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
