/* ─────────────────────────────────────────────────────────────────────────
   Website — Shared Styles
   ─────────────────────────────────────────────────────────────────────────
   Imports the project-wide design tokens and defines the layout primitives
   shared across the public website pages: page base, top nav, mobile menu,
   buttons, and footer. Page-specific styles live inline in each HTML file.

   Used by:  product-home.html, faq.html,
             cht-fbl-privacypolicy.html, cht-fbl-termsofservice.html

   All design tokens (colors, typography, spacing, etc.) are defined in
   css/tokens.css — the single source of truth shared with the React app.
   ───────────────────────────────────────────────────────────────────────── */

@import url('tokens.css');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Page base ── */
html { scroll-behavior: smooth; max-width: 100vw; }
section[id] { scroll-margin-top: 80px; }

body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.7;
  font-size: var(--text-lg);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100vw;
}
/* Long words / URLs wrap instead of pushing layout */
p, li, td, th, h1, h2, h3, h4 { overflow-wrap: anywhere; }
img { max-width: 100%; height: auto; }

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 96px;
  padding: 0 5%;
  transition: box-shadow 0.2s ease;
}
.nav-inner {
  max-width: var(--max-w);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo { font-size: var(--text-lg); font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }
.nav-logo img { height: 48px; }
.nav-logo span { color: var(--text); }
.nav-links { display: flex; gap: 0; align-items: stretch; height: 100%; }
.nav-links a {
  text-decoration: none; color: var(--text); font-size: var(--text-md); font-weight: 500;
  transition: all 0.2s ease; padding: 0 14px; display: flex; align-items: center; height: 100%;
  position: relative;
}
.nav-links a::first-letter { font-weight: 700; font-size: 1.1em; }
.nav-links a:hover { color: var(--accent); }
.nav-links a.active {
  color: var(--accent); font-weight: 600;
  background: linear-gradient(to bottom, transparent, var(--accent-bg));
}
.nav-links a.active::after {
  content: ''; position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 2px; background: var(--accent-bright); border-radius: 1px;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 14px 28px;
  font-size: var(--text-lg);
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: var(--surface); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,58,138,0.25); }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--surface); }
.btn-secondary { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: var(--text-grey); }
.btn-lg { padding: 14px 28px; font-size: var(--text-md); }
.btn-xl { padding: 16px 36px; font-size: var(--text-md); }
.btn-hero-primary { background: white; color: var(--accent); font-weight: 700; }
.btn-hero-primary:hover { background: #f0f4ff; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,255,255,0.3); }
.btn-hero-outline { background: transparent; color: var(--surface); border: 1.5px solid rgba(255,255,255,0.5); }
.btn-hero-outline:hover { background: rgba(255,255,255,0.1); border-color: var(--surface); }
.btn-nav { padding: 10px 22px; font-size: var(--text-sm); }

/* ── Mobile menu ── */
.nav-hamburger {
  display: none;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer;
  position: relative; flex-shrink: 0;
  padding: 0;
}
.nav-hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 1px;
  position: absolute; left: 12px;
  transition: all 0.3s ease;
}
.nav-hamburger span:nth-child(1) { top: 14px; }
.nav-hamburger span:nth-child(2) { top: 21px; }
.nav-hamburger span:nth-child(3) { top: 28px; }
.nav-hamburger.open span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { top: 21px; transform: rotate(-45deg); }
.mobile-menu {
  display: none;
  position: fixed; top: 96px; left: 0; right: 0; z-index: 999;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  flex-direction: column; padding: 8px 0;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 14px 24px;
  text-decoration: none; color: var(--text);
  font-size: var(--text-md); font-weight: 500;
  border-bottom: 1px solid var(--bg);
  transition: background 0.15s ease;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { background: var(--accent-bg); color: var(--accent); }

/* ── Footer ── */
footer {
  background: var(--hero-dark);
  color: var(--white-50);
  padding: 64px 5% 40px;
  font-size: var(--text-base);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--white-08);
  margin-bottom: 24px;
}
.footer-logo { margin-bottom: 4px; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; justify-content: flex-end; }
.footer-links a { color: var(--white-50); text-decoration: none; font-size: var(--text-sm); font-weight: 500; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--surface); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--white-35);
}
.footer-bottom a { color: var(--white-50); text-decoration: none; transition: color 0.2s ease; }
.footer-bottom a:hover { color: var(--surface); }

/* ── Responsive — shared layout (Tablet ≤ 768px) ── */
@media (max-width: 768px) {
  /* Nav — mobile layout: logo left, hamburger right (login inside menu) */
  .nav-links { display: none; }
  nav .btn-nav { display: none; }
  .nav-hamburger { display: flex; }

  /* Footer */
  .footer-top { grid-template-columns: 1fr; text-align: center; }
  .footer-links { justify-content: center; flex-wrap: wrap; gap: 16px; }
  .footer-bottom { justify-content: center; text-align: center; }
}
