/* Trackmatic NZ — design system. Mobile-first, system fonts, no webfont dependency. */

:root {
  --tm-navy: #0b1f3a;
  --tm-navy-light: #142c52;
  --tm-blue: #1f6feb;
  --tm-blue-dark: #1553b8;
  --tm-teal: #0aa88f;
  --tm-teal-dark: #08876f;
  --tm-ink: #17233d;
  --tm-body: #3c465c;
  --tm-muted: #6b7690;
  --tm-line: #e4e8f0;
  --tm-bg: #f6f8fb;
  --tm-card: #ffffff;
  --tm-warn-bg: #fff6e6;
  --tm-warn-line: #f2d896;
  --tm-radius: 14px;
  --tm-radius-sm: 8px;
  --tm-shadow: 0 8px 24px rgba(11, 31, 58, 0.08);
  --tm-shadow-lg: 0 20px 48px rgba(11, 31, 58, 0.14);
  --tm-max: 1180px;
  --tm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--tm-font);
  color: var(--tm-body);
  background: var(--tm-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--tm-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--tm-ink); line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 2.9rem); }
h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }

.tm-container { max-width: var(--tm-max); margin: 0 auto; padding: 0 20px; }
.tm-visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.tm-skip-link {
  position: absolute; left: -999px; top: 0; background: #fff; color: var(--tm-ink);
  padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0;
}
.tm-skip-link:focus { left: 0; }

/* Header */
.tm-header {
  position: sticky; top: 0; z-index: 100; background: #fff;
  border-bottom: 1px solid var(--tm-line);
}
.tm-header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; gap: 16px; }
.tm-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--tm-ink); }
.tm-logo img { height: 28px; width: auto; }
.tm-logo-suffix { font-size: 0.72rem; color: var(--tm-muted); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; margin-left: 2px; }

.tm-nav-toggle {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  width: 40px; height: 40px; background: none; border: 1px solid var(--tm-line);
  border-radius: 8px; cursor: pointer;
}
.tm-nav-toggle span { display: block; width: 18px; height: 2px; background: var(--tm-ink); margin: 0 auto; }

.tm-primary-nav {
  position: fixed; top: 60px; right: 0; bottom: 0; left: 0; background: #fff; padding: 16px 20px 32px;
  display: none; overflow-y: auto; z-index: 99;
}
.tm-primary-nav.is-open { display: block; }
.tm-primary-nav ul { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 4px; }
.tm-primary-nav a { display: block; padding: 12px 8px; color: var(--tm-ink); font-weight: 600; border-radius: 8px; }
.tm-primary-nav a.is-active { color: var(--tm-blue); background: #eef3ff; }
.tm-nav-cta { display: block; text-align: center; }

@media (min-width: 960px) {
  .tm-nav-toggle { display: none; }
  .tm-primary-nav {
    position: static; display: flex; align-items: center; gap: 24px; padding: 0; inset: auto;
  }
  .tm-primary-nav ul { flex-direction: row; margin: 0; gap: 2px; }
  .tm-primary-nav a { padding: 8px 10px; font-size: 0.95rem; }
  .tm-nav-cta { width: auto; }
}

/* Buttons */
.tm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 700; font-size: 0.98rem;
  border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
}
.tm-btn:hover { text-decoration: none; transform: translateY(-1px); }
.tm-btn-primary { background: var(--tm-teal); color: #fff; box-shadow: 0 10px 24px rgba(10,168,143,0.28); }
.tm-btn-primary:hover { background: var(--tm-teal-dark); }
.tm-btn-secondary { background: #fff; color: var(--tm-navy); border-color: var(--tm-line); }
.tm-btn-secondary:hover { border-color: var(--tm-blue); color: var(--tm-blue); }
.tm-btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.tm-btn-outline-light:hover { border-color: #fff; }
.tm-btn-block { width: 100%; }

/* Hero */
.tm-hero {
  background: linear-gradient(160deg, var(--tm-navy) 0%, var(--tm-navy-light) 55%, #103a63 100%);
  color: #fff; padding: 56px 0 64px; position: relative; overflow: hidden;
}
.tm-hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 960px) { .tm-hero-grid { grid-template-columns: 1.1fr 0.9fr; } }
.tm-hero-eyebrow {
  display: inline-block; background: rgba(255,255,255,0.12); color: #cfe3ff;
  padding: 6px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; margin-bottom: 16px;
}
.tm-hero h1 { color: #fff; }
.tm-hero-lead { color: #d7e2f4; font-size: 1.08rem; max-width: 46ch; }
.tm-hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 18px; }
.tm-hero-facts {
  display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-top: 24px; max-width: 480px;
}
.tm-fact { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); border-radius: var(--tm-radius-sm); padding: 12px 14px; }
.tm-fact strong { display: block; font-size: 1.15rem; color: #fff; }
.tm-fact span { font-size: 0.82rem; color: #b9c8e2; }

.tm-hero-card {
  background: #fff; color: var(--tm-ink); border-radius: var(--tm-radius); padding: 24px;
  box-shadow: var(--tm-shadow-lg);
}
.tm-hero-card h3 { margin-bottom: 12px; }
.tm-hero-price-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--tm-line); font-size: 0.95rem; }
.tm-hero-price-row:last-of-type { border-bottom: none; }
.tm-hero-price-row strong { color: var(--tm-ink); }

/* Sections */
.tm-section { padding: 56px 0; }
.tm-section-alt { background: #fff; }
.tm-section-head { max-width: 700px; margin: 0 auto 36px; text-align: center; }
.tm-eyebrow { color: var(--tm-teal-dark); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; }

.tm-grid { display: grid; gap: 20px; }
.tm-grid-2 { grid-template-columns: 1fr; }
.tm-grid-3 { grid-template-columns: 1fr; }
.tm-grid-4 { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .tm-grid-2 { grid-template-columns: repeat(2,1fr); }
  .tm-grid-3 { grid-template-columns: repeat(2,1fr); }
  .tm-grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (min-width: 1000px) {
  .tm-grid-3 { grid-template-columns: repeat(3,1fr); }
  .tm-grid-4 { grid-template-columns: repeat(4,1fr); }
}

.tm-card {
  background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: var(--tm-radius);
  padding: 22px; box-shadow: var(--tm-shadow);
}
.tm-card h3 { margin-bottom: 8px; }
.tm-card p:last-child { margin-bottom: 0; }
.tm-icon-badge {
  width: 44px; height: 44px; border-radius: 12px; background: #eaf7f4; color: var(--tm-teal-dark);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 14px; font-weight: 700;
}

/* Pricing */
.tm-price-card {
  background: #fff; border: 1px solid var(--tm-line); border-radius: var(--tm-radius);
  padding: 28px 24px; box-shadow: var(--tm-shadow); text-align: center;
}
.tm-price-card.is-featured { border: 2px solid var(--tm-teal); box-shadow: var(--tm-shadow-lg); position: relative; }
.tm-price-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--tm-teal); color: #fff; padding: 4px 14px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
}
.tm-price-amount { font-size: 2.4rem; font-weight: 800; color: var(--tm-ink); margin: 6px 0 0; }
.tm-price-amount small { font-size: 1rem; font-weight: 600; color: var(--tm-muted); }
.tm-price-label { color: var(--tm-muted); font-size: 0.9rem; margin-bottom: 18px; }
.tm-price-list { list-style: none; padding: 0; text-align: left; margin: 18px 0; }
.tm-price-list li { padding: 8px 0; border-bottom: 1px solid var(--tm-line); display: flex; gap: 8px; }
.tm-price-list li:last-child { border-bottom: none; }

.tm-price-breakdown {
  background: #fff; border: 1px solid var(--tm-line); border-radius: var(--tm-radius);
  padding: 24px; box-shadow: var(--tm-shadow);
}
.tm-price-breakdown table { width: 100%; border-collapse: collapse; }
.tm-price-breakdown th, .tm-price-breakdown td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--tm-line); }
.tm-price-breakdown tfoot td { font-weight: 700; border-bottom: none; }

.tm-calc { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.tm-calc button {
  border: 1px solid var(--tm-line); background: #fff; border-radius: 999px; padding: 10px 18px;
  font-weight: 700; cursor: pointer; color: var(--tm-ink);
}
.tm-calc button.is-active { background: var(--tm-navy); color: #fff; border-color: var(--tm-navy); }

.tm-note {
  background: var(--tm-warn-bg); border: 1px solid var(--tm-warn-line); border-radius: var(--tm-radius-sm);
  padding: 14px 16px; font-size: 0.92rem; color: #6b5219;
}

/* Steps */
.tm-steps { counter-reset: tm-step; }
.tm-step { position: relative; padding-left: 52px; margin-bottom: 26px; }
.tm-step::before {
  counter-increment: tm-step; content: counter(tm-step);
  position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%;
  background: var(--tm-navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800;
}

/* FAQ accordion */
.tm-faq-item { border-bottom: 1px solid var(--tm-line); }
.tm-faq-q {
  width: 100%; text-align: left; background: none; border: none; padding: 18px 4px;
  font-weight: 700; font-size: 1rem; color: var(--tm-ink); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.tm-faq-q::after { content: '+'; font-size: 1.4rem; color: var(--tm-teal-dark); flex-shrink: 0; }
.tm-faq-item.is-open .tm-faq-q::after { content: '\2212'; }
.tm-faq-a { display: none; padding: 0 4px 18px; color: var(--tm-body); }
.tm-faq-item.is-open .tm-faq-a { display: block; }

/* Forms */
.tm-form { display: grid; gap: 16px; }
.tm-field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.92rem; color: var(--tm-ink); }
.tm-field input, .tm-field select, .tm-field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--tm-line); border-radius: var(--tm-radius-sm);
  font: inherit; background: #fff; color: var(--tm-ink);
}
.tm-field input:focus, .tm-field select:focus, .tm-field textarea:focus { outline: 2px solid var(--tm-blue); outline-offset: 1px; }
.tm-field-hp { position: absolute; left: -9999px; }
.tm-form-status { padding: 12px 14px; border-radius: var(--tm-radius-sm); font-weight: 600; }
.tm-form-status.is-success { background: #eaf7f0; color: #146c43; }
.tm-form-status.is-error { background: #fdecec; color: #a12525; }

/* CTA band */
.tm-cta-band {
  background: linear-gradient(120deg, var(--tm-teal-dark), var(--tm-teal));
  color: #fff; border-radius: var(--tm-radius); padding: 40px 28px; text-align: center;
}
.tm-cta-band h2 { color: #fff; }
.tm-cta-band p { color: rgba(255,255,255,0.9); }

/* Table (industries / features matrix) */
.tm-table-wrap { overflow-x: auto; }
table.tm-table { width: 100%; border-collapse: collapse; min-width: 480px; }
table.tm-table th, table.tm-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--tm-line); }
table.tm-table th { background: #f2f5fa; }

/* Footer */
.tm-footer { background: var(--tm-navy); color: #c7d3ea; padding: 48px 0 20px; margin-top: 40px; }
.tm-footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .tm-footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .tm-footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.tm-footer-heading { color: #fff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.tm-footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tm-footer-list a { color: #c7d3ea; }
.tm-footer-list a:hover { color: #fff; }
.tm-footer-tagline { max-width: 32ch; }
.tm-social { display: flex; gap: 14px; margin-top: 12px; }
.tm-social a { color: #c7d3ea; font-size: 0.85rem; }
.tm-footer-fine { font-size: 0.82rem; color: #93a3c4; }
.tm-footer-bottom {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  border-top: 1px solid rgba(255,255,255,0.12); margin-top: 32px; padding-top: 18px; font-size: 0.82rem; color: #93a3c4;
}
.tm-footer-legal { list-style: none; display: flex; gap: 16px; padding: 0; margin: 0; }
.tm-footer-legal a { color: #93a3c4; }

/* WhatsApp floating button */
.tm-whatsapp-fab {
  position: fixed; right: 16px; bottom: 16px; width: 54px; height: 54px; border-radius: 50%;
  background: #25D366; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25); z-index: 150;
}
.tm-whatsapp-fab img { width: 26px; height: 26px; }

/* Breadcrumbs */
.tm-breadcrumbs { font-size: 0.85rem; color: var(--tm-muted); padding: 14px 0 0; }
.tm-breadcrumbs a { color: var(--tm-muted); }

/* Chat widget */
.tm-chat-launcher {
  position: fixed; right: 16px; bottom: 80px; z-index: 150;
  display: flex; align-items: center; gap: 8px; background: var(--tm-navy); color: #fff;
  border: none; border-radius: 999px; padding: 12px 18px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 24px rgba(11,31,58,0.3); font-size: 0.9rem;
}
.tm-chat-launcher-icon { font-size: 1.1rem; }
.tm-chat-panel {
  position: fixed; right: 16px; bottom: 80px; z-index: 160; width: min(360px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 140px)); background: #fff; border-radius: var(--tm-radius);
  box-shadow: var(--tm-shadow-lg); display: none; flex-direction: column; overflow: hidden;
  border: 1px solid var(--tm-line);
}
.tm-chat-panel.is-open { display: flex; }
.tm-chat-head {
  background: var(--tm-navy); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
}
.tm-chat-close { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1; }
.tm-chat-messages { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: #f8fafc; }
.tm-chat-msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 0.92rem; line-height: 1.4; white-space: pre-wrap; }
.tm-chat-msg-bot { background: #fff; border: 1px solid var(--tm-line); align-self: flex-start; border-bottom-left-radius: 4px; }
.tm-chat-msg-user { background: var(--tm-blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.tm-chat-typing { color: var(--tm-muted); font-style: italic; }
.tm-chat-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-chat-actions button {
  border: 1px solid var(--tm-blue); color: var(--tm-blue); background: #fff; border-radius: 999px;
  padding: 7px 12px; font-size: 0.82rem; cursor: pointer; font-weight: 600;
}
.tm-chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--tm-line); background: #fff; }
.tm-chat-form input { flex: 1; padding: 10px 12px; border: 1px solid var(--tm-line); border-radius: 999px; font: inherit; }
.tm-chat-form button { padding: 10px 16px; }

@media (max-width: 480px) {
  .tm-chat-launcher span:last-child { display: none; }
  .tm-chat-launcher { padding: 12px; bottom: 76px; }
  .tm-chat-panel { right: 8px; left: 8px; width: auto; bottom: 76px; }
  .tm-whatsapp-fab { bottom: 12px; }
}

/* Utility */
.tm-mt-0 { margin-top: 0; }
.tm-text-center { text-align: center; }
.tm-muted { color: var(--tm-muted); }
.tm-small { font-size: 0.85rem; }
.tm-lazy { content-visibility: auto; }
