/* ═══════════════════════════════════════════════════════
   Halftime Tools — design tokens & base styles
   v1.0.0 — Sprint 1 (2026-05-01)
   No build step. South African English. System sans-serif.
   ═══════════════════════════════════════════════════════ */

:root {
  /* Brand colour tokens — keep these in sync with manifest.json theme_color */
  --htf-navy: #1a3a5c;
  --htf-navy-deep: #122a44;
  --htf-cream: #f5f0e8;
  --htf-cream-warm: #ede5d6;
  --htf-gold: #f5a623;
  --htf-gold-dark: #d88a0e;
  --htf-teal: #2a9d8f;
  --htf-teal-dark: #1f7a6f;
  --htf-white: #ffffff;
  --htf-text: #1a3a5c;
  --htf-text-muted: #5a6e85;
  --htf-text-on-navy: #ffffff;
  --htf-text-on-navy-muted: #b8c6d6;
  --htf-border: #d8d2c4;
  --htf-shadow-card: 0 2px 12px rgba(26, 58, 92, 0.08);
  --htf-shadow-card-hover: 0 6px 24px rgba(26, 58, 92, 0.14);
  --htf-radius: 12px;
  --htf-radius-lg: 18px;
  --htf-max: 1180px;

  /* Typography */
  --htf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
              Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  --htf-font-display: var(--htf-font);
}

/* ── Reset (light) ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--htf-font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--htf-text);
  background: var(--htf-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--htf-teal-dark); text-decoration: none; }
a:hover { color: var(--htf-navy); text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

/* ── Layout helpers ────────────────────────────────── */
.htf-wrap { width: 100%; max-width: var(--htf-max); margin: 0 auto; padding: 0 24px; }
.htf-section { padding: 64px 0; }
.htf-section-tight { padding: 40px 0; }
@media (max-width: 720px) {
  .htf-section { padding: 44px 0; }
  .htf-wrap { padding: 0 18px; }
}

/* ── Header ─────────────────────────────────────────── */
.htf-header {
  background: var(--htf-navy);
  color: var(--htf-text-on-navy);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.htf-header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.htf-brand { display: flex; align-items: center; gap: 12px; color: var(--htf-text-on-navy); }
.htf-brand:hover { text-decoration: none; color: var(--htf-text-on-navy); }
.htf-brand-mark { width: 40px; height: 44px; flex-shrink: 0; }
.htf-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.htf-brand-name { font-weight: 700; font-size: 18px; letter-spacing: 0.2px; }
.htf-brand-tag { font-size: 11px; color: var(--htf-text-on-navy-muted); letter-spacing: 0.6px; text-transform: uppercase; }
.htf-nav-actions { display: flex; gap: 10px; }

/* ── Buttons ────────────────────────────────────────── */
.htf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px;
  font-weight: 600; font-size: 15px;
  padding: 11px 20px;
  border: 1px solid transparent;
  transition: transform 80ms ease, background-color 120ms ease, box-shadow 120ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.htf-btn:hover { text-decoration: none; transform: translateY(-1px); }
.htf-btn:active { transform: translateY(0); }
.htf-btn-primary { background: var(--htf-gold); color: var(--htf-navy); }
.htf-btn-primary:hover { background: var(--htf-gold-dark); color: var(--htf-navy); }
.htf-btn-teal { background: var(--htf-teal); color: var(--htf-white); }
.htf-btn-teal:hover { background: var(--htf-teal-dark); color: var(--htf-white); }
.htf-btn-ghost { background: transparent; color: var(--htf-text-on-navy); border-color: rgba(255,255,255,0.35); }
.htf-btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--htf-text-on-navy); }
.htf-btn-outline { background: transparent; color: var(--htf-navy); border-color: var(--htf-navy); }
.htf-btn-outline:hover { background: var(--htf-navy); color: var(--htf-white); }
.htf-btn-block { width: 100%; }
.htf-btn-lg { padding: 14px 26px; font-size: 16px; }
.htf-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ── Hero ──────────────────────────────────────────── */
.htf-hero {
  background: linear-gradient(180deg, var(--htf-cream) 0%, var(--htf-cream-warm) 100%);
  padding: 72px 0 56px;
  text-align: center;
}
.htf-hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  margin: 0 0 14px;
  letter-spacing: -0.5px;
  font-weight: 700;
  color: var(--htf-navy);
}
.htf-hero-tag {
  font-size: clamp(16px, 2.4vw, 19px);
  color: var(--htf-text-muted);
  margin: 0 auto 28px;
  max-width: 680px;
}
.htf-hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.htf-hero-strap {
  margin-top: 28px; font-size: 13px; color: var(--htf-text-muted);
  letter-spacing: 0.4px;
}

/* ── Section heading ──────────────────────────────── */
.htf-section-h {
  text-align: center; margin: 0 auto 36px; max-width: 720px;
}
.htf-section-h h2 {
  font-size: clamp(24px, 3.6vw, 32px);
  margin: 0 0 10px; color: var(--htf-navy); font-weight: 700;
}
.htf-section-h p {
  margin: 0; color: var(--htf-text-muted); font-size: 16px;
}

/* ── Tools grid ────────────────────────────────────── */
.htf-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.htf-tool-card {
  background: var(--htf-white);
  border-radius: var(--htf-radius);
  padding: 22px 20px;
  box-shadow: var(--htf-shadow-card);
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow 160ms ease, transform 80ms ease;
  border: 1px solid var(--htf-border);
}
.htf-tool-card:hover { box-shadow: var(--htf-shadow-card-hover); transform: translateY(-2px); }
.htf-tool-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.htf-tool-name { font-weight: 600; font-size: 17px; color: var(--htf-navy); margin: 0; }
.htf-tool-desc { font-size: 14px; color: var(--htf-text-muted); margin: 0; flex-grow: 1; }
.htf-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px;
  text-transform: uppercase; white-space: nowrap;
}
.htf-badge-free { background: #e6f4f1; color: var(--htf-teal-dark); }
.htf-badge-essentials { background: #fdecd5; color: #8a5510; }
.htf-badge-complete, .htf-badge-premium { background: #1a3a5c; color: var(--htf-cream); }
.htf-badge-soon { background: #eee9dd; color: var(--htf-text-muted); }

/* ── Pricing ───────────────────────────────────────── */
.htf-pricing {
  background: var(--htf-cream-warm);
  padding: 64px 0;
}
.htf-pricing-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px; max-width: 920px; margin: 0 auto;
}
@media (max-width: 720px) {
  .htf-pricing-grid { grid-template-columns: 1fr; }
}
.htf-price-card {
  background: var(--htf-navy);
  color: var(--htf-text-on-navy);
  border-radius: var(--htf-radius-lg);
  padding: 36px 32px;
  position: relative;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 28px rgba(26, 58, 92, 0.16);
  overflow: hidden;
}
.htf-price-eyebrow {
  font-size: 12px; letter-spacing: 2px; font-weight: 700;
  color: var(--htf-text-on-navy-muted); margin-bottom: 18px;
}
.htf-price-amount { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.htf-price-amount .htf-amount {
  font-size: 56px; font-weight: 700; letter-spacing: -1.5px; line-height: 1;
}
.htf-price-amount .htf-currency { color: var(--htf-text-on-navy-muted); font-size: 18px; }
.htf-price-meta { color: var(--htf-text-on-navy-muted); font-size: 13px; margin-bottom: 24px; }
.htf-price-list { list-style: none; padding: 0; margin: 0 0 28px; flex-grow: 1; }
.htf-price-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 15px;
}
.htf-price-list li:last-child { border-bottom: none; }
.htf-tick {
  flex-shrink: 0; color: var(--htf-teal); font-weight: 700;
  width: 18px; display: inline-flex; justify-content: center;
}
.htf-price-soon { color: var(--htf-text-on-navy-muted); font-style: italic; font-weight: 500; }
.htf-price-card-popular::after {
  content: "MOST POPULAR";
  position: absolute; top: 22px; right: -42px;
  background: var(--htf-gold); color: var(--htf-navy);
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  padding: 6px 50px; transform: rotate(35deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ── Features strip ────────────────────────────────── */
.htf-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px; padding: 48px 0;
}
.htf-feature { text-align: center; padding: 0 12px; }
.htf-feature-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--htf-teal); color: var(--htf-white);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px; font-size: 20px;
}
.htf-feature h3 { font-size: 17px; margin: 0 0 6px; color: var(--htf-navy); }
.htf-feature p { font-size: 14px; color: var(--htf-text-muted); margin: 0; }

/* ── FAQ ───────────────────────────────────────────── */
.htf-faq { max-width: 760px; margin: 0 auto; }
.htf-faq details {
  background: var(--htf-white);
  border-radius: var(--htf-radius);
  padding: 18px 22px; margin-bottom: 12px;
  box-shadow: var(--htf-shadow-card);
  border: 1px solid var(--htf-border);
}
.htf-faq summary {
  cursor: pointer; font-weight: 600; color: var(--htf-navy);
  list-style: none; outline: none;
  display: flex; justify-content: space-between; align-items: center;
}
.htf-faq summary::after {
  content: "+"; color: var(--htf-teal); font-size: 22px; font-weight: 400;
  transition: transform 200ms ease;
}
.htf-faq details[open] summary::after { transform: rotate(45deg); }
.htf-faq details p { color: var(--htf-text-muted); margin: 12px 0 0; font-size: 15px; line-height: 1.6; }

/* ── Footer ────────────────────────────────────────── */
.htf-footer {
  background: var(--htf-navy-deep);
  color: var(--htf-text-on-navy-muted);
  padding: 36px 0;
  font-size: 14px;
  margin-top: 48px;
}
.htf-footer-inner {
  display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center;
}
.htf-footer a { color: var(--htf-text-on-navy-muted); }
.htf-footer a:hover { color: var(--htf-white); }
.htf-footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ── Auth panel (used in index.html shell) ─────────── */
.htf-auth-panel {
  max-width: 460px; margin: 64px auto;
  background: var(--htf-white);
  border-radius: var(--htf-radius-lg);
  box-shadow: var(--htf-shadow-card);
  padding: 36px 32px;
  border: 1px solid var(--htf-border);
}
.htf-auth-panel h1 { font-size: 24px; margin: 0 0 6px; color: var(--htf-navy); }
.htf-auth-panel p.htf-auth-sub { color: var(--htf-text-muted); margin: 0 0 24px; font-size: 15px; }
.htf-tier-banner {
  background: var(--htf-cream-warm);
  border-left: 4px solid var(--htf-gold);
  padding: 12px 14px; border-radius: 8px;
  font-size: 14px; margin-bottom: 20px;
  color: var(--htf-navy);
}
.htf-form-row { margin-bottom: 16px; }
.htf-form-row label {
  display: block; font-size: 13px; font-weight: 600; color: var(--htf-navy);
  margin-bottom: 6px;
}
.htf-form-row input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--htf-border);
  border-radius: 8px; font-size: 15px; font-family: inherit;
  background: var(--htf-white); color: var(--htf-text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.htf-form-row input:focus {
  outline: none; border-color: var(--htf-teal);
  box-shadow: 0 0 0 3px rgba(42,157,143,0.18);
}
.htf-auth-toggle {
  text-align: center; margin-top: 18px; font-size: 14px; color: var(--htf-text-muted);
}
.htf-auth-toggle button {
  background: none; border: none; color: var(--htf-teal-dark);
  font-weight: 600; padding: 0; cursor: pointer; font-size: 14px;
  text-decoration: underline;
}
.htf-error { color: #b94a48; font-size: 14px; margin-top: 10px; min-height: 1.2em; }

/* ── Dashboard grid (shell — Sprint 5 wires it) ─── */
.htf-dashboard-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px; margin-bottom: 28px;
}
.htf-dashboard-head h1 { margin: 0; font-size: 24px; color: var(--htf-navy); }
.htf-dashboard-meta { color: var(--htf-text-muted); font-size: 14px; }

/* ── Hidden utility ───────────────────────────────── */
.htf-hidden { display: none !important; }
.htf-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Tools grid tiles (Sprint 5 — used by app.js renderToolsGrid) ── */
.htf-tool-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px;
  background: var(--htf-white);
  border-radius: var(--htf-radius);
  box-shadow: var(--htf-shadow-card);
  border: 1px solid var(--htf-border);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 160ms ease, transform 80ms ease, border-color 160ms ease;
  position: relative;
}
.htf-tool-tile:hover {
  box-shadow: var(--htf-shadow-card-hover);
  transform: translateY(-2px);
}
.htf-tool-tile.is-locked {
  background: linear-gradient(180deg, #fafaf7 0%, #f4eee2 100%);
  border-color: #e3dccb;
}
.htf-tool-tile.is-locked:hover { transform: translateY(-1px); }
.htf-tool-tile.is-soon { cursor: default; opacity: 0.85; }
.htf-tool-tile.is-soon:hover { transform: none; box-shadow: var(--htf-shadow-card); }

.htf-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.htf-tile-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.htf-tile-badge--free       { background: #e6f4f1; color: var(--htf-teal-dark); }
.htf-tile-badge--essentials { background: #fdecd5; color: #8a5510; }
.htf-tile-badge--complete, .htf-tile-badge--premium { background: var(--htf-navy); color: var(--htf-cream); }
.htf-tile-badge--soon       { background: #eee9dd; color: var(--htf-text-muted); }

.htf-tile-lock {
  font-size: 14px;
  color: #b2a684;
  line-height: 1;
}

.htf-tile-name {
  font-weight: 600;
  font-size: 17px;
  color: var(--htf-navy);
  margin: 4px 0 0;
}
.htf-tile-blurb {
  font-size: 13.5px;
  color: var(--htf-text-muted);
  line-height: 1.45;
  margin: 0;
  flex-grow: 1;
}
.htf-tile-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--htf-navy);
  margin-top: 4px;
}
.htf-tile-cta--muted { color: var(--htf-text-muted); }
