/* RateQuoteNow -- shared design system */

:root {
  --color-bg: #faf6ee;
  --color-surface: #ffffff;
  --color-text: #1c1f2a;
  --color-text-muted: #6a6558;
  --color-primary: #16407a;
  --color-primary-dark: #0c2748;
  --color-ink: #14213a;
  --color-accent: #0f6f4d;
  --color-accent-dark: #0b5138;
  --color-accent-soft: #e6f2ec;
  --color-gold: #c98a2c;
  --color-gold-soft: #fbeed7;
  --color-border: #e7e0d1;
  --color-sponsor-tag: #a05a00;
  --color-sponsor-tag-bg: #fff3e0;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 2px rgba(28, 22, 10, 0.05), 0 10px 28px rgba(28, 22, 10, 0.08);
  --shadow-card-hover: 0 4px 10px rgba(28, 22, 10, 0.08), 0 18px 40px rgba(28, 22, 10, 0.14);
  --shadow-modal: 0 24px 70px rgba(10, 14, 24, 0.4);
  --max-width: 1140px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Category accent colors, cycled across the grid */
.category-card.c1 { --cat-color: #16407a; }
.category-card.c2 { --cat-color: #0f6f4d; }
.category-card.c3 { --cat-color: #a3395a; }
.category-card.c4 { --cat-color: #c98a2c; }
.category-card.c5 { --cat-color: #5c4a9e; }
.category-card.c6 { --cat-color: #2b6e78; }
.category-card.c7 { --cat-color: #9c5a2a; }
.category-card.c8 { --cat-color: #46708c; }
.category-card.c9 { --cat-color: #a35d1f; }
.category-card.c10 { --cat-color: #3f6b3f; }
.category-card.c11 { --cat-color: #7a3b6e; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--color-primary); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: rgba(250, 246, 238, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand span { color: var(--color-accent); }
.main-nav {
  display: flex;
  gap: 22px;
  align-items: center;
}
.main-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}
.main-nav a:hover { color: var(--color-primary); }
.nav-cta {
  background: var(--color-accent);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 999px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.nav-cta:hover { background: var(--color-accent-dark); transform: translateY(-1px); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  padding: 8px;
  cursor: pointer;
  color: var(--color-primary-dark);
}
@media (max-width: 767px) {
  .site-header .container { position: relative; }
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 14px 20px; }
  .nav-cta { margin: 10px 20px; text-align: center; }
}

/* Hero */
.hero {
  position: relative;
  background: linear-gradient(180deg, #0c2748 0%, #14314f 60%, var(--color-bg) 100%);
  padding: 64px 0 44px;
  text-align: center;
  overflow: hidden;
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 15% 20%, rgba(201, 138, 44, 0.18), transparent 60%),
    radial-gradient(500px 260px at 85% 10%, rgba(15, 111, 77, 0.22), transparent 60%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  font-weight: 700;
  color: #fff;
  max-width: 780px;
  margin: 0 auto 14px;
}
.hero p.lede {
  font-size: 1.12rem;
  color: #cfd9e6;
  max-width: 620px;
  margin: 0 auto 22px;
}
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}
.trust-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #eef3fa;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 7px 15px;
  border-radius: 999px;
}

/* Layout with ad rail */
.page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 40px 0 72px;
}
@media (min-width: 980px) {
  .page-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

/* Category grid */
.section-title {
  font-size: 1.6rem;
  margin-bottom: 4px;
}
.section-sub {
  color: var(--color-text-muted);
  margin-bottom: 22px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 640px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}
.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--cat-color, var(--color-primary));
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.category-card:hover, .category-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}
.category-card.is-active {
  box-shadow: 0 0 0 2px var(--cat-color, var(--color-accent));
}
.category-icon-badge {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--cat-color, var(--color-primary)) 12%, transparent);
}
.category-icon {
  width: 26px;
  height: 26px;
  color: var(--cat-color, var(--color-primary));
}
.category-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--color-ink);
}
.category-card .blurb {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
}
.pending-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5b6675;
  background: #eef1f6;
  padding: 3px 8px;
  border-radius: 999px;
}
.sponsor-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-sponsor-tag);
  background: var(--color-sponsor-tag-bg);
  padding: 3px 8px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}
.sponsor-tag:hover { text-decoration: underline; }
.affiliate-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent-dark);
  background: var(--color-accent-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

/* Quote popover -- always opens centered in the current viewport (never
   anchored below the clicked card, which could push it below the fold) */
.quote-popover {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 24px 22px;
  z-index: 90;
}
.quote-popover.is-open { display: block; }
.quote-popover h3 {
  font-size: 1.15rem;
  margin-bottom: 14px;
  padding-right: 24px;
}
.popover-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
}
.popover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 30, 0.35);
  z-index: 85;
  display: none;
}
.popover-backdrop.is-open { display: block; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 560px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .full { grid-column: 1 / -1; }
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}
input[type="text"], input[type="tel"], input[type="email"], select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}
.zip-gate-message { color: #a05a00; font-size: 0.85rem; }
.popover-disclosure {
  background: var(--color-gold-soft);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.78rem;
  color: #6b4a12;
  margin-bottom: 10px;
}
.consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 6px;
}
.consent-row input { margin-top: 3px; }
.optin-note {
  display: block;
  margin-top: 3px;
  font-style: italic;
  color: var(--color-text-muted);
}
.btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 13px 22px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--color-accent-dark); }
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-block { width: 100%; }

/* Ad rail (newspaper-style rotating sponsor spotlight, image creative) */
.ad-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ad-rail-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  font-weight: 700;
  text-align: center;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 4px 0;
}
.ad-slot {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.ad-banner-img { width: 100%; height: auto; display: block; }
.ad-fallback { padding: 16px; min-height: 120px; }
.ad-fallback h4 { margin: 0 0 4px; font-size: 1rem; }
.ad-fallback p { margin: 0; font-size: 0.83rem; color: var(--color-text-muted); }
.ad-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
}
.ad-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-border);
}
.ad-dots span.active { background: var(--color-accent); }
#ad-strip-inline {
  display: none;
}
@media (max-width: 979px) {
  #ad-rail { display: none; }
  #ad-strip-inline { display: flex; flex-direction: column; gap: 12px; margin: 28px 0; }
  #ad-strip-inline .ad-slot { max-width: 320px; margin: 0 auto; }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 30, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-overlay.is-open { display: flex; }
.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 26px;
  box-shadow: var(--shadow-modal);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
}
.modal-card h3 { margin-bottom: 4px; }
.modal-card .modal-sponsor-tag { margin-bottom: 10px; }
.modal-card p { font-size: 0.9rem; color: var(--color-text-muted); }
.modal-disclosure {
  background: var(--color-accent-soft);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.8rem;
  color: #1a5c3f;
  margin: 14px 0;
}

/* Cards for local partners / static sponsors */
.partner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 20px;
}
@media (min-width: 640px) {
  .partner-grid { grid-template-columns: repeat(3, 1fr); }
}
.partner-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.partner-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.partner-ad-img { width: 100%; height: auto; display: block; }
.partner-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 22px;
}
.partner-card .sponsor-tag { margin: 20px 22px 0; }
.partner-card h3 {
  font-size: 1.1rem;
  margin: 0 0 6px;
  color: var(--color-ink);
}
.partner-card p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin: 0 0 16px;
  flex: 1;
}
.partner-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, gap 0.15s ease;
}
.partner-link:hover { border-color: var(--color-primary); gap: 9px; }

/* Ad fact panel -- live HTML/CSS, driven directly by categories.json /
   sponsors.json. Adding or removing a sponsor never needs a re-render step:
   edit the JSON (and drop a photo file), and this renders from data as-is. */
.ad-fact-panel {
  background: #fff;
  padding: 16px 18px 14px;
  border-top: 1px solid var(--color-border);
}
.ad-fact-row {
  font-size: 0.92rem;
  color: var(--color-text);
  margin-bottom: 8px;
}
.ad-fact-row.ad-fact-stacked { display: flex; flex-direction: column; gap: 3px; }
.ad-fact-label { font-weight: 700; margin-right: 6px; }
.ad-fact-link {
  color: var(--color-primary);
  text-decoration: underline;
  font-size: 0.92rem;
  word-break: break-all;
}
.ad-fact-highlights {
  list-style: none;
  margin: 12px 0 10px;
  padding: 12px 0 0;
  border-top: 1px solid var(--color-border);
  font-size: 0.88rem;
}
.ad-fact-highlights li { margin-bottom: 5px; }
.ad-fact-highlights li::before { content: "-  "; }
.ad-fact-footer {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 8px;
}

/* Generic content pages */
.prose { max-width: 760px; margin: 0 auto; padding: 44px 0 68px; }
.prose h1 { font-size: 2rem; color: var(--color-ink); }
.prose h2 { font-size: 1.25rem; margin-top: 1.6em; font-family: var(--font-sans); font-weight: 700; }
.callout {
  background: var(--color-accent-soft);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 20px 0;
}
.legal-jumplinks { font-size: 0.9rem; }
.legal-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 40px 0;
}
.legal-section-title { font-size: 1.6rem; margin-top: 0; }

/* Footer */
.site-footer {
  background: var(--color-ink);
  color: #cfe0f5;
  padding: 36px 0;
  margin-top: 44px;
}
.site-footer a { color: #fff; text-decoration: none; font-size: 0.85rem; }
.site-footer a:hover { color: var(--color-gold-soft); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 14px;
}
.site-footer small { color: #9db3cc; font-size: 0.75rem; }
.trust-strip-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9db3cc;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}
.trust-badge svg { width: 26px; height: 26px; color: #cfe0f5; flex-shrink: 0; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }
.thankyou-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 560px;
  margin: 48px auto;
  text-align: center;
  box-shadow: var(--shadow-card);
}
