/* ==========================================================================
   Kynex Pro — Agency Partner Toolkit design system
   Shared by /agency-toolkit and any future partner-resource pages.
   Brand color is a runtime CSS variable (--brand) so the agency's Brand Kit
   can recolor the whole toolkit to match their branding.
   No build step. Pairs with kynex-toolkit.js.
   ========================================================================== */

:root {
  --brand: #145cff;        /* recolored at runtime by the Brand Kit */
  --brand-deep: #0a3fb8;
  --brand-soft: rgba(20, 92, 255, .10);
  --cyan: #00c7b7;
  --navy: #07142b;
  --ink: #0b1220;
  --text: #33415a;
  --muted: #5f6f84;
  --line: #dbe5f2;
  --line-soft: #e8eef8;
  --paper: #f5f8ff;
  --card: #ffffff;
  --good: #0f9f74;
  --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: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 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 8% 6%, var(--brand-soft), transparent 30%),
    radial-gradient(circle at 90% 2%, rgba(0,199,183,.12), transparent 28%);
}
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; margin: 0; }
h1 { font-size: clamp(38px, 5.4vw, 68px); }
h2 { font-size: clamp(26px, 3vw, 42px); }
h3 { font-size: 21px; }
h4 { font-size: 15px; }
.lead { color: var(--text); font-size: clamp(16px, 1.4vw, 21px); max-width: 760px; }
.sub { color: var(--muted); max-width: 820px; 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: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(219,229,242,.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: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 850; text-decoration: none; color: var(--navy); }
.mark {
  width: 44px; height: 32px; display: grid; place-items: center; border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #0a8bff 58%, var(--cyan));
  color: #fff; font-size: 13px; font-weight: 950; letter-spacing: .04em;
}
.navlinks { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.navlinks a {
  text-decoration: none; color: #42526a; padding: 8px 11px; 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: 11px 16px; font-weight: 850; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  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(--navy); color: #fff; }
.btn.good { border-color: transparent; background: var(--good); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 8px 12px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Eyebrow / tags / pills ---------- */
.eyebrow {
  display: inline-flex; gap: 8px; align-items: center; padding: 7px 12px;
  border: 1px solid rgba(0,199,183,.28); background: rgba(0,199,183,.09);
  color: #08786f; 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: #f5f7fb; color: var(--muted);
  font-size: 12px; font-weight: 850; width: max-content;
}
.tag.hot { background: var(--good-bg); color: #166534; border-color: transparent; }
.tag.ai { background: #d9fbf7; color: #08786f; border-color: transparent; }
.tag.warn { background: #dbeafe; color: #1d4ed8; border-color: transparent; }
.tag.gold { background: #fff4cf; color: #6b4300; border-color: transparent; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 40px; border-bottom: 1px solid rgba(219,229,242,.9);
  background:
    linear-gradient(90deg, rgba(255,255,255,.98), rgba(255,255,255,.7) 55%, rgba(255,255,255,.2) 100%),
    linear-gradient(135deg, var(--brand-soft), rgba(0,199,183,.14));
}
.hero-grid { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 28px; align-items: end; }
.hero h1 { margin: 16px 0 14px; }
.hero-panel {
  background: rgba(255,255,255,.96); border: 1px solid rgba(219,229,242,.9);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.metric { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f8fbff; }
.metric strong { display: block; font-size: 24px; line-height: 1; color: var(--brand-deep); }
.metric span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }

/* ---------- Sections / cards ---------- */
.section { padding: 50px 0; }
.section.tight { padding: 34px 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: 22px; }
.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)); }
.grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.value-card .ic {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--cyan)); color: #fff; font-size: 20px; font-weight: 900; margin-bottom: 6px;
}
.value-card h3 { font-size: 18px; }
.value-card p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.includes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.includes li { position: relative; padding-left: 20px; color: var(--text); font-size: 14px; }
.includes li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 900; }

/* ---------- Brand Kit bar ---------- */
.brandbar {
  position: relative; z-index: 20;
  background: linear-gradient(135deg, rgba(20,92,255,.06), rgba(0,199,183,.07));
  border-bottom: 1px solid var(--line);
}
.brandbar-inner {
  width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 12px 0;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brandbar .bk-head { display: flex; align-items: center; gap: 10px; font-weight: 850; color: var(--navy); }
.brandbar .bk-dot { width: 22px; height: 22px; border-radius: 6px; background: var(--brand); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.brandbar .bk-status { color: var(--muted); font-size: 13px; }
.brandbar .spacer { flex: 1 1 auto; }

.brandkit-panel { display: none; }
.brandkit-panel.open { display: block; }
.bk-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.bk-logo-preview {
  height: 56px; max-width: 200px; object-fit: contain; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px; display: none;
}
.bk-logo-preview.show { display: block; }

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=url], input[type=number], input[type=date], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 12px; background: #fff; color: var(--ink); min-height: 44px;
}
input[type=color] { width: 56px; height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.field { margin-bottom: 0; }

/* ---------- Tabs (package / tier selector) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: #f2f5f9; border: 1px solid var(--line); border-radius: 999px; }
.tabs.block { border-radius: var(--radius); }
.tab {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 9px 14px; border-radius: 999px; font-weight: 850; font-size: 13px; transition: background .15s, color .15s;
}
.tab:hover { color: var(--brand); }
.tab.active { background: var(--brand); color: #fff; }

/* ---------- Checklist ---------- */
.checklist-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.progress { height: 10px; border-radius: 999px; background: var(--line-soft); overflow: hidden; flex: 1 1 220px; min-width: 160px; }
.progress > span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), var(--cyan)); transition: width .25s ease; }
.phase { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; background: #fff; }
.phase-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #f8fbff; border-bottom: 1px solid var(--line); }
.phase-badge { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--cyan)); color: #fff; font-weight: 950; font-size: 14px; flex: none; }
.phase-top h4 { font-size: 16px; color: var(--ink); }
.check-item { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.check-item:last-child { border-bottom: 0; }
.check-item:hover { background: #fbfdff; }
.check-item input[type=checkbox] { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--brand); }
.check-item b { display: block; color: var(--ink); font-size: 14px; }
.check-item span { color: var(--muted); font-size: 12.5px; }
.check-item .owner { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 850; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); }
.check-item.done b { text-decoration: line-through; color: var(--muted); }

/* ---------- Template viewer ---------- */
.tpl-layout { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 18px; align-items: start; }
.tpl-list { display: grid; gap: 8px; max-height: 640px; overflow: auto; padding-right: 4px; }
.tpl-list-item {
  text-align: left; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm);
  padding: 12px 14px; display: grid; gap: 3px;
}
.tpl-list-item:hover { border-color: var(--brand); }
.tpl-list-item.active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: #fbfdff; }
.tpl-list-item b { color: var(--ink); font-size: 14px; }
.tpl-list-item span { color: var(--muted); font-size: 12px; }
.tpl-cat { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-deep); }
.tpl-editor { display: grid; gap: 12px; }
.tpl-editor .subject-line { font-weight: 800; }
.tpl-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.tpl-body { min-height: 320px; font-size: 14px; }
.merge-hint { font-size: 12px; color: var(--muted); }
.merge-hint code { background: var(--brand-soft); color: var(--brand-deep); padding: 1px 6px; border-radius: 5px; font-weight: 800; }

/* ---------- Calculator ---------- */
.calc-grid { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 18px; align-items: start; }
.calc-inputs { display: grid; gap: 14px; }
.calc-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.calc-result { position: sticky; top: 88px; }
.result-big { font-size: 40px; font-weight: 950; line-height: 1; color: var(--brand-deep); overflow-wrap: anywhere; }
.result-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.result-row:last-child { border-bottom: 0; }
.result-row span { color: var(--muted); font-size: 13px; }
.result-row strong { color: var(--ink); }

/* ---------- Lead gate (show/hide by unlock state) ---------- */
.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(--cyan)); 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(--navy); 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: 40px 0 28px; 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; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid, .tpl-layout, .calc-grid { grid-template-columns: 1fr; }
  .grid.four { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bk-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .calc-result { position: static; }
  .tpl-list { max-height: none; }
}
@media (max-width: 660px) {
  .nav-inner { flex-direction: column; align-items: flex-start; }
  .brandbar { top: 0; }
  .grid.two, .grid.three, .grid.four, .bk-grid, .calc-fields, .metric-grid, .gate-form .two { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
}

/* ---------- Print (checklists + lead magnet) ---------- */
@media print {
  .nav, .brandbar, .toast, .btn, .tabs, .gate-lock, footer, .no-print { display: none !important; }
  body { background: #fff; }
  body::before { display: none; }
  .panel, .card, .phase { box-shadow: none; break-inside: avoid; }
  .print-only { display: block !important; }
  .check-item { break-inside: avoid; }
}
.print-only { display: none; }

/* ---------- Focus visibility ---------- */
:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 2px; }
.btn:focus-visible, .tab:focus-visible, .tpl-list-item:focus-visible, .check-item:focus-visible,
.quiz-opt:focus-within, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand-deep); outline-offset: 2px;
}
/* non-color cue for the active tab (in addition to the brand fill) */
.tab.active { box-shadow: inset 0 -3px 0 rgba(255,255,255,.55); }

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