/*
 * shared.css — ClimateRiskCheck
 *
 * Design tokens, reset, and components shared across every page.
 * Page-specific styles live in each template's own <style> block.
 *
 * Load order: Google Fonts → shared.css → page <style>
 */

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

/* ── Design tokens ── */
:root {
  /* Core palette — legacy (kept for backward compat with /app, /bulk) */
  --navy:             #0d1b2a;
  --navy-mid:         #1a3060;
  --brand:            #1565c0;
  --brand-hover:      #0d47a1;
  --brand-light:      #e3f2fd;
  --brand-pale:       #f0f7ff;

  /* ── v2 design tokens (redesign branch) ── */
  --charcoal:         #1c1c1c;   /* nav, footer, methodology band */
  --charcoal-border:  rgba(255,255,255,0.07);
  --accent:           #c62828;   /* primary red accent */
  --accent-hover:     #b71c1c;
  --accent-muted:     #ef9a9a;   /* red on dark backgrounds */
  --warm-off-white:   #f7f5f2;   /* alternating section bg */
  --warm-border:      #ddd8d2;   /* borders on light sections */
  --warm-border-dark: #e8e4e0;   /* slightly darker border */
  --warm-text:        #1a1a1a;   /* primary text on white */
  --warm-text-2:      #4a5568;   /* secondary text */
  --warm-text-muted:  #8a7e74;   /* muted text */
  --warm-text-stone:  #6b6560;   /* stone text */
  --warm-stone-bg:    #ede8e2;   /* coverage badge bg */
  --warm-stone-text:  #5a4a3a;   /* coverage badge text */
  --warm-header-bg:   #f2ede8;   /* table header / report header */
  --warm-row-bg:      #f9f7f4;   /* table alt row */

  /* Risk levels */
  --risk-extreme:     #7b1fa2;
  --risk-extreme-bg:  #fdf4ff;
  --risk-high:        #c62828;
  --risk-high-bg:     #fff5f5;
  --risk-moderate:    #e65100;
  --risk-moderate-bg: #fff8f0;
  --risk-low:         #1b7a34;
  --risk-low-bg:      #f0faf2;
  --risk-partial:     #546e7a;
  --risk-partial-bg:  #f5f7f8;

  /* Surfaces & text */
  --border:           #e4e8ef;
  --bg:               #f2f5f9;
  --surface:          #ffffff;

  /* Text scale — three weights used across all pages */
  --text:             #0d1b2a;
  --text-primary:     #0d1b2a;
  --text-2:           #3d4f63;
  --text-secondary:   #3d4f63;
  --text-3:           #7a8899;
  --text-muted:       #8a95a3;

  /* Shadows */
  --shadow:           0 1px 3px rgba(13,27,42,0.05), 0 6px 20px rgba(13,27,42,0.07);
  --shadow-card:      0 1px 3px rgba(13,27,42,0.05), 0 6px 20px rgba(13,27,42,0.07);
  --shadow-card-hover:0 2px 6px rgba(13,27,42,0.07), 0 12px 32px rgba(13,27,42,0.11);

  /* Radii */
  --radius:           12px;
  --radius-sm:        8px;
}

/* ── v2 Nav ── */
.site-nav-v2 {
  background: var(--charcoal);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--charcoal-border);
}
.site-nav-v2-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.site-nav-v2-dot {
  /* kept for pages not yet using the logo */
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  display: none;
}
.site-nav-v2-wordmark {
  font-size: 0.93rem;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.2px;
}
.site-nav-v2-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-nav-v2-link {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav-v2-link:hover { color: rgba(255,255,255,0.75); }
.site-nav-v2-access {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-muted);
  text-decoration: none;
}
.site-nav-v2-cta {
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  padding: 6px 14px;
  text-decoration: none;
  transition: background 0.15s;
}
.site-nav-v2-cta:hover { background: rgba(255,255,255,0.16); }

/* ── v2 Footer ── */
footer.footer-v2 {
  background: var(--charcoal);
  color: rgba(255,255,255,0.28);
  font-size: 0.72rem;
  padding: 1.25rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--charcoal-border);
  flex-direction: row;
  gap: 1rem;
}
footer.footer-v2 a {
  color: rgba(255,255,255,0.32);
  text-decoration: none;
}
footer.footer-v2 a:hover { color: rgba(255,255,255,0.6); }
.footer-v2-links { display: flex; gap: 1.25rem; }

/* ── App pages (/app + /bulk shared styles) ── */
.site-nav-app { background: #1c1c1c; }
/* Override old site-nav when used on app pages */
.app-page .site-nav { background: #1c1c1c; }

.site-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.credit-pill {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.9);
  border-radius: 100px;
  padding: 4px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: default;
  white-space: nowrap;
  letter-spacing: 0.1px;
}
.credit-pill.low { background: rgba(198,40,40,0.4); border-color: rgba(198,40,40,0.5); }
.site-nav-acct {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-page-header {
  background: #1c1c1c;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 0 1.5rem;
  height: 72px;
  display: flex;
  align-items: center;
}
.app-page-header-inner {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.app-page-header-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}
.app-page-header-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  margin-top: 1px;
}
.app-page-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.app-page-header-badge-dot {
  width: 6px;
  height: 6px;
  background: #ef9a9a;
  border-radius: 50%;
}
.page-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 2rem;
}

/* ── Base ── */
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ── NAV ── */
.site-nav {
  background: var(--navy);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.site-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-nav-icon {
  width: 30px;
  height: 30px;
  background: #3063ba;
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
  padding: 3px;
}
.site-nav-icon img { display: block; width: 100%; height: 100%; }
.site-nav-wordmark {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}
.site-nav-wordmark span { font-weight: 400; color: rgba(255,255,255,0.5); }

/* Nav CTA (landing page "Get started" button) */
.site-nav-cta {
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.site-nav-cta:hover { background: var(--brand-hover); }

/* Nav back link (methodology page) */
.site-nav-back {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav-back:hover { color: rgba(255,255,255,0.85); }

/* ── TRUST STRIP ── */
.trust-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: rgba(255,255,255,0.35);
  margin-right: 0.4rem;
  white-space: nowrap;
}
.trust-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.trust-chip {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  padding: 2px 9px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 100px;
  white-space: nowrap;
}

/* ── DISCLAIMER ── */
.disclaimer {
  background: #f8f9fb;
  border-top: 1px solid var(--border);
  padding: 1.1rem 1.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── POWERED-BY STRIP ── */
.powered-by {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 0.7rem 1.5rem;
}
.powered-by-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

/* ── FOOTER ── */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.45);
  text-align: center;
  font-size: 0.73rem;
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}
footer a { color: rgba(255,255,255,0.45); text-decoration: none; }
footer a:hover { color: rgba(255,255,255,0.75); }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .site-nav { padding: 0 1rem; }
}
@media (max-width: 600px) {
  .site-nav-v2 { padding: 0 1.25rem; }
  .site-nav-v2-link { display: none; }
  .site-nav-v2-links { gap: 0.75rem; }
  .site-nav-v2-access { font-size: 0.75rem; }
  .site-nav-v2-cta { font-size: 0.75rem; padding: 5px 10px; }
}
@media (max-width: 480px) {
  .site-nav-wordmark { display: none; }
}
