/* ============================================
   FLAGSTONE - Global Stylesheet
   Shared styles across all pages
   ============================================ */

/* FONTS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* DESIGN TOKENS */
:root {
  --green-dark: #1c2b1e;
  --green-mid: #243527;
  --green-accent: #4caf6e;
  --green-light: #7ec88a;
  --red: #e85555;
  --orange: #e8a435;
  --bg: #f4f3ef;
  --white: #fff;
  --text: #1a1a1a;
  --muted: #6b7c6d;
}

/* BASE */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ============================================
   NAV - unified across all pages
   ============================================ */
.global-nav {
  background: var(--green-dark);
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.nav-logo {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.5px;
  text-decoration: none;
}
.nav-logo span { color: var(--green-light); }
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  color: #8ab49c;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover { color: white; }
.nav-links-text {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-cta-sm {
  background: rgba(255,255,255,0.1);
  color: white !important;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-email {
  font-size: 13px;
  color: #8ab49c;
}
.nav-logout {
  font-size: 13px;
  color: #8ab49c;
  background: none;
  border: 1px solid #3d5040;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.nav-logout:hover { background: #2d3e2e; color: white; }

/* ============================================
   FOOTER - unified across all pages
   ============================================ */
.global-footer {
  background: var(--green-dark);
  color: #6b8a6e;
  padding: 40px 32px;
}
.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-logo {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--green-light);
}
.footer-links {
  display: flex;
  gap: 20px;
  font-size: 13px;
}
.footer-links a {
  color: #6b8a6e;
  text-decoration: none;
}
.footer-links a:hover { color: #8ab49c; }
.footer-copy {
  font-size: 12px;
  width: 100%;
  margin-top: 16px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  display: inline-block;
  background: var(--green-accent);
  color: white;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: #3d9a5c; }
.btn-ghost {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  color: white;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

/* ============================================
   AUTH BRAND STRIP - adds brand identity to auth pages
   ============================================ */
.auth-brand-strip {
  background: var(--green-mid);
  padding: 24px 32px;
  text-align: center;
}
.auth-brand-strip .tagline {
  font-size: 13px;
  color: #a8c2ab;
  margin-top: 4px;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media(max-width: 640px) {
  .global-nav { padding: 0 20px; }
  .nav-links-text { display: none; }
  #nav-auth-links { display: none; }
  #nav-user-links { display: none !important; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 14px; }
}

/* ============================================
   PRINT STYLES - for report pages
   ============================================ */
@media print {
  .global-nav, .tabs-wrap, .global-footer, #sticky-cta { display: none !important; }
  body { background: white; font-size: 12px; }
  .panel { display: block !important; page-break-inside: avoid; margin-bottom: 24px; }
  .panel + .panel { border-top: 1px solid #ddd; padding-top: 16px; }
  .hero { background: none !important; color: black !important; padding: 20px 0 !important; }
  .hero * { color: black !important; }
  .hero-address { font-size: 24px !important; }
  .media-row { display: none; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .alert { border: 1px solid #ddd; }
  .alert-red { border-left: 4px solid var(--red); }
  .alert-orange { border-left: 4px solid var(--orange); }
  .alert-green { border-left: 4px solid var(--green-accent); }
  .summary { background: #f5f5f5 !important; color: black !important; }
  .summary p, .summary strong { color: black !important; }
  .container { max-width: 100%; padding: 0; }
  .customer-bar { display: none; }
  .cust-insight { display: none; }
  #insight-buyer { display: block !important; border: 1px solid #ddd; }
  a[href]::after { content: none; }
  .metric-bar-fill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .facts-grid { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .tl-dot { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .pill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .badge { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .risk-fill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .report-freshness { display: block !important; }
  .section-head { page-break-after: avoid; }
  .card { page-break-inside: avoid; }
}
