/* ============================================================
   Keepwise — Shared Design System (V3)
   Trust-first, light-default palette for a UK money/life-admin brand.
   Pure CSS, no build step. Used by every product.
   ============================================================ */

:root {
  --bg: #f7f9fc;
  --bg-soft: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --border: #e3e8f0;
  --border-strong: #cfd6e4;
  --text: #16202e;
  --text-soft: #4a5566;
  --text-faint: #7a8699;
  --brand: #0e7c66;          /* keepwise teal-green = money + trust */
  --brand-ink: #0a5d4c;
  --brand-soft: #e4f4ef;
  --accent: #1f6feb;         /* action blue */
  --accent-soft: #e7f0ff;
  --gold: #b8860b;
  --warn: #b9770a;
  --danger: #c2410c;
  --good: #0e7c66;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,32,46,.04), 0 8px 28px rgba(16,32,46,.06);
  --shadow-lg: 0 12px 40px rgba(16,32,46,.12);
  --maxw: 760px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141b; --bg-soft: #131b24; --surface: #18222e; --surface-2: #1f2a38;
    --border: #2a3747; --border-strong: #3a4a5d; --text: #e9eef5; --text-soft: #aab6c6;
    --text-faint: #7c8a9c; --brand: #2bb89a; --brand-ink: #2bb89a; --brand-soft: #123a31;
    --accent: #5b9bff; --accent-soft: #14253f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.6; font-size: 17px; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* header / nav */
.site-header { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(10px); position: sticky; top: 0; z-index: 50; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between;
  height: 62px; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px;
  color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #19a585); display: inline-flex;
  align-items: center; justify-content: center; color: #fff; font-size: 15px; font-weight: 800; }
.site-header nav a { color: var(--text-soft); margin-left: 18px; font-size: 15px; font-weight: 500; }
.site-header nav a:hover { color: var(--text); text-decoration: none; }

/* hero */
.hero { padding: 52px 0 24px; text-align: center; }
.hero .eyebrow { color: var(--brand); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .09em; }
h1 { font-size: clamp(29px, 5vw, 42px); line-height: 1.12; margin: 12px 0 12px; letter-spacing: -.025em; }
.hero p.sub { color: var(--text-soft); font-size: 18px; max-width: 580px; margin: 0 auto; }

/* card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.tool { margin: 22px 0 40px; }

/* form */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 650; margin-bottom: 7px; font-size: 15px; }
.field .hint { color: var(--text-faint); font-size: 13px; margin-top: 5px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
input[type=number], input[type=text], input[type=email], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 12px 13px; font-size: 16px; font-family: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.input-group { display: flex; align-items: stretch; }
.input-group .prefix, .input-group .suffix { display: flex; align-items: center; padding: 0 12px;
  color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--border-strong); }
.input-group .prefix { border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .suffix { border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group input { border-radius: 0; }
.input-group .prefix + input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group input:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
input[type=range] { width: 100%; accent-color: var(--brand); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px;
  font-size: 16px; font-weight: 650; font-family: inherit; color: #fff; background: var(--brand);
  border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.accent { background: var(--accent); }
.btn.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn.full { width: 100%; }
.btn.sm { padding: 8px 14px; font-size: 14px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; color: var(--text-soft); padding: 8px 15px;
  border-radius: 7px; cursor: pointer; font-size: 14px; font-weight: 650; font-family: inherit; }
.seg button.active { background: var(--brand); color: #fff; }

/* results */
.result { margin-top: 22px; padding: 22px; border-radius: var(--radius);
  background: linear-gradient(165deg, var(--brand-soft), var(--surface)); border: 1px solid var(--border); }
.result .big { font-size: clamp(30px, 7vw, 46px); font-weight: 800; letter-spacing: -.025em; line-height: 1.08; color: var(--brand-ink); }
.result .lead { color: var(--text-soft); font-size: 15px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-top: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.stat .k { color: var(--text-faint); font-size: 13px; }
.stat .v { font-size: 22px; font-weight: 750; margin-top: 3px; }

/* table */
table.data { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 8px; }
table.data th, table.data td { text-align: right; padding: 10px 10px; border-bottom: 1px solid var(--border); }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { color: var(--text-faint); font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.data tbody tr:hover { background: var(--surface-2); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* badges, callouts */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
  background: var(--brand-soft); color: var(--brand-ink); }
.badge.best { background: #e6f7ef; color: #0a7a4f; }
.badge.warn { background: #fdf0dc; color: var(--warn); }
.pill { display:inline-block; font-size:12px; padding:3px 9px; border-radius:20px; background:var(--accent-soft); color:var(--accent); font-weight:600; }
.callout { border:1px solid var(--border); border-left: 3px solid var(--brand); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 13px 16px; font-size: 14px; color: var(--text-soft); margin: 14px 0; }

/* email capture / data-capture block (the asset hooks) */
.capture { margin-top: 18px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--accent-soft); }
.capture h3 { margin: 0 0 6px; font-size: 18px; color: var(--text); }
.capture p { margin: 0 0 12px; color: var(--text-soft); font-size: 14px; }
.capture .row-inline { display: flex; gap: 10px; flex-wrap: wrap; }
.capture .row-inline input { flex: 1 1 200px; }
.gated { position: relative; }
.gated.locked > .gated-body { filter: blur(6px); pointer-events: none; user-select: none; }
.gated .gate { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 10px; padding: 20px; }
.gated.locked .gate { display: flex; }

/* prose / SEO */
.prose { color: var(--text-soft); }
.prose h2 { color: var(--text); margin-top: 40px; font-size: 26px; letter-spacing: -.015em; }
.prose h3 { color: var(--text); margin-top: 26px; font-size: 19px; }
.prose p, .prose li { font-size: 17px; }
.prose ul { padding-left: 22px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 16px; margin-bottom: 10px; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 650; color: var(--text); padding: 12px 0; }

/* hub grid */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin: 26px 0; }
.tool-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand); text-decoration: none; }
.tool-card .ico { font-size: 26px; }
.tool-card h3 { margin: 10px 0 5px; color: var(--text); font-size: 18px; }
.tool-card p { margin: 0; color: var(--text-soft); font-size: 14px; }
.tool-card .cat { display: inline-block; margin-top: 12px; font-size: 12px; color: var(--brand-ink);
  background: var(--brand-soft); padding: 3px 9px; border-radius: 20px; font-weight: 600; }

/* footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 30px 0; color: var(--text-faint); font-size: 14px; }
.site-footer .bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: var(--text-soft); }

/* utils */
.muted { color: var(--text-faint); } .center { text-align: center; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; } .hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* cookie / consent banner */
.kw-consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--surface);
  border-top: 1px solid var(--border); box-shadow: 0 -8px 30px rgba(16,32,46,.14); padding: 14px 20px; }
.kw-consent .inner { max-width: 1100px; margin: 0 auto; display: flex; gap: 16px; align-items: center;
  flex-wrap: wrap; justify-content: space-between; }
.kw-consent p { margin: 0; font-size: 14px; color: var(--text-soft); flex: 1 1 320px; }
.kw-consent .acts { display: flex; gap: 10px; flex-wrap: wrap; }
/* AdSense placeholder slot (keeps layout tidy where you drop ad units) */
.ad-slot { display: block; margin: 24px auto; min-height: 90px; text-align: center; overflow: hidden; }
@media (max-width: 560px) { body { font-size: 16px; } .card { padding: 20px; } .site-header nav a { margin-left: 12px; font-size: 14px; } }
