/*
 * FreePermitApp — Shared Layout CSS
 * Matches pinpoint-network-v1.html (approved homepage design)
 * Injected server-side on all freepermitapp.com secondary pages.
 * Classes: .fpa-header, .fpa-footer (prefixed to avoid conflicts)
 */

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

/* ── Design Tokens (only set if not already defined) ── */
:root {
  --fpa-navy:        #0c2340;
  --fpa-navy-mid:    #112d50;
  --fpa-coral:       #e5445d;
  --fpa-coral-dark:  #c0304a;
  --fpa-coral-light: #ffeaed;
  --fpa-white:       #ffffff;
  --fpa-gray-100:    #f3f4f6;
  --fpa-gray-200:    #e5e7eb;
  --fpa-gray-300:    #d1d5db;
  --fpa-gray-400:    #9ca3af;
  --fpa-gray-500:    #6b7280;
  --fpa-gray-700:    #374151;
  --fpa-gray-900:    #111827;
  --fpa-max-w:       1200px;
  --fpa-radius-sm:   6px;
  --fpa-radius:      10px;
  --fpa-radius-lg:   16px;
  --fpa-radius-xl:   24px;
  --fpa-shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --fpa-shadow:      0 4px 16px rgba(0,0,0,0.08);
  --fpa-shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
}

/* ── Reset for FPA elements ── */
.fpa-header, .fpa-header *,
.fpa-footer, .fpa-footer * {
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════════
   SHARED HEADER
═══════════════════════════════════════════════ */
.fpa-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--fpa-white);
  border-bottom: 1px solid var(--fpa-gray-200);
  transition: box-shadow 0.2s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.fpa-header.scrolled {
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
.fpa-header-inner {
  max-width: var(--fpa-max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 80px;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Logo */
.fpa-logo-block {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 20px;
}

/* Logo image — properly sized, maintains size on mobile */
.fpa-logo-img {
  height: 96px;
  width: auto;
  mix-blend-mode: multiply;
  flex-shrink: 0;
  display: block;
}

/* Topic label beside the logo: "Permits", "Mortgage", etc. */
.fpa-logo-topic {
  font-size: 13px;
  font-weight: 700;
  color: var(--fpa-navy);
  letter-spacing: 0.3px;
  border-left: 1.5px solid var(--fpa-gray-300);
  padding-left: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Header Right — wraps CTA + search together on the right */
.fpa-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* CTA Button — brand CORAL #f3315a */
.fpa-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: #f3315a;
  color: #ffffff !important;
  border: none;
  border-radius: var(--fpa-radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.fpa-cta-btn:hover {
  background: #d41e47;
  transform: translateY(-1px);
}
.fpa-cta-btn:active { transform: translateY(0); }

/* Nav */
.fpa-header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.fpa-nav-dropdown {
  position: relative;
}
.fpa-nav-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: none;
  border: none;
  border-radius: var(--fpa-radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--fpa-gray-700);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.fpa-nav-btn:hover {
  background: var(--fpa-gray-100);
  color: var(--fpa-navy);
}
.fpa-nav-btn svg.fpa-chevron {
  transition: transform 0.2s;
}
.fpa-nav-dropdown:hover .fpa-nav-btn svg.fpa-chevron,
.fpa-nav-dropdown.open .fpa-nav-btn svg.fpa-chevron {
  transform: rotate(180deg);
}

/* Dropdown Panel */
.fpa-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--fpa-white);
  border: 1px solid var(--fpa-gray-200);
  border-radius: var(--fpa-radius-lg);
  box-shadow: var(--fpa-shadow-lg);
  padding: 8px;
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 100;
}
.fpa-nav-dropdown:hover .fpa-dropdown-panel,
.fpa-nav-dropdown.open .fpa-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.fpa-dropdown-panel a {
  display: block;
  padding: 9px 14px;
  border-radius: var(--fpa-radius-sm);
  font-size: 14px;
  color: var(--fpa-gray-700);
  text-decoration: none;
  font-weight: 450;
  transition: background 0.12s, color 0.12s;
}
.fpa-dropdown-panel a:hover {
  background: var(--fpa-coral-light);
  color: var(--fpa-coral-dark);
}
.fpa-dropdown-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--fpa-gray-400);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 10px 14px 4px;
  margin-top: 4px;
}

/* Search — inside .fpa-header-right, no margin-left needed */
.fpa-header-search {
  flex-shrink: 0;
}
.fpa-search-form {
  display: flex;
  align-items: center;
  background: var(--fpa-gray-100);
  border: 1.5px solid var(--fpa-gray-200);
  border-radius: 100px;
  padding: 0 16px 0 14px;
  height: 40px;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.fpa-search-form:focus-within {
  border-color: var(--fpa-coral);
  box-shadow: 0 0 0 3px rgba(229,68,93,0.1);
  background: var(--fpa-white);
}
.fpa-search-form svg { flex-shrink: 0; color: var(--fpa-gray-400); }
.fpa-search-form input {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--fpa-gray-700);
  outline: none;
  width: 200px;
}
.fpa-search-form input::placeholder { color: var(--fpa-gray-400); }

/* Hamburger */
.fpa-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

/* Mobile Menu */
.fpa-mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--fpa-white);
  border-top: 1px solid var(--fpa-gray-200);
  padding: 16px 24px 24px;
  gap: 4px;
  font-family: 'Inter', -apple-system, sans-serif;
}
.fpa-mobile-menu.open { display: flex; }
.fpa-mobile-menu a {
  padding: 10px 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--fpa-gray-700);
  text-decoration: none;
  border-bottom: 1px solid var(--fpa-gray-100);
  display: block;
}
.fpa-mobile-menu a:last-child { border-bottom: none; }
.fpa-mobile-menu a:hover { color: var(--fpa-coral); }
.fpa-mobile-section {
  font-size: 11px;
  font-weight: 700;
  color: var(--fpa-gray-400);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 14px 4px 6px;
}

/* ═══════════════════════════════════════════════
   SHARED FOOTER
═══════════════════════════════════════════════ */
.fpa-footer {
  background: var(--fpa-navy);
  color: rgba(255,255,255,0.7);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.fpa-footer-top {
  max-width: var(--fpa-max-w);
  margin: 0 auto;
  padding: 52px 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  flex-wrap: wrap;
}
.fpa-footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.fpa-footer-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.fpa-footer-logo-pinpoint {
  font-size: 20px;
  font-weight: 800;
  color: var(--fpa-white);
  letter-spacing: -0.5px;
}
.fpa-footer-brand-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.20);
}
.fpa-footer-attribution {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fpa-footer-attribution-text {
  font-size: 12px;
  color: rgba(255,255,255,0.50);
  font-weight: 400;
}
.fpa-footer-tagline {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  font-weight: 400;
  max-width: 320px;
  text-align: right;
}
.fpa-footer-categories {
  max-width: var(--fpa-max-w);
  margin: 0 auto;
  padding: 36px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.fpa-footer-categories-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.fpa-footer-categories-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
}
.fpa-footer-categories-links a {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.15s;
  padding-right: 16px;
  white-space: nowrap;
}
.fpa-footer-categories-links a:hover { color: var(--fpa-white); }
.fpa-footer-categories-links a::after {
  content: '|';
  margin-left: 16px;
  color: rgba(255,255,255,0.20);
}
.fpa-footer-categories-links a:last-child::after { content: none; }
.fpa-footer-bottom {
  max-width: var(--fpa-max-w);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.fpa-footer-copyright {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}
.fpa-footer-legal-links {
  display: flex;
  gap: 20px;
}
.fpa-footer-legal-links a {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.15s;
}
.fpa-footer-legal-links a:hover { color: rgba(255,255,255,0.8); }

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .fpa-footer-top { flex-direction: column; align-items: flex-start; }
  .fpa-footer-tagline { text-align: left; max-width: 100%; }
}
@media (max-width: 700px) {
  .fpa-header-nav, .fpa-header-right { display: none; }
  .fpa-hamburger { display: flex; }
  /* Keep logo large on mobile — do NOT shrink it */
  .fpa-logo-img { height: 72px; }
  .fpa-footer-categories-links a::after { content: none; }
  .fpa-footer-categories-links a { padding-right: 0; margin-right: 16px; }
  .fpa-footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════
   DESIGN TOKEN OVERRIDES
   Unifies all FreePermitApp secondary pages to use PinPoint V1 design system.
   Overrides old FreePermitApp orange (#f3315a) with PinPoint coral (#f3315a).
   Also overrides --blue to coral (matching convention in renderZipGuidePage).
   Injected server-side on freepermitapp.com and .polsia.app domains.
═══════════════════════════════════════════════ */
:root {
  /* Replace old FreePermitApp orange with PinPoint coral */
  --brand-primary:       #e5445d;
  --brand-primary-dark:  #c0304a;
  --brand-primary-pale:  #ffeaed;
  /* Alias --blue to coral (matches ZIP page convention and PinPoint V1) */
  --blue:         #e5445d;
  --blue-dark:    #c0304a;
  --blue-light:   #ffeaed;
  --blue-pale:    #fff0f2;
  --blue-border:  #fcd6dc;
}

/* Apply Inter font globally on FPA pages */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

/* ═══════════════════════════════════════════════
   EMAIL CAPTURE BAR
   "Get Your Free Permit Guide" bar injected before footer on all FPA pages.
═══════════════════════════════════════════════ */
.fpa-email-bar {
  background: var(--fpa-navy);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  padding: 60px 24px;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}
.fpa-email-bar-inner {
  max-width: 620px;
  margin: 0 auto;
}
.fpa-email-bar-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--fpa-coral);
  margin-bottom: 12px;
}
.fpa-email-bar-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--fpa-white);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  line-height: 1.2;
}
.fpa-email-bar-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.65);
  margin: 0 0 28px;
  line-height: 1.6;
}
.fpa-email-bar-form {
  display: flex;
  gap: 10px;
  max-width: 540px;
  margin: 0 auto 14px;
  flex-wrap: wrap;
}
.fpa-email-bar-input {
  flex: 1;
  min-width: 130px;
  padding: 13px 16px;
  border: 1.5px solid rgba(255,255,255,0.20);
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: white;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
}
.fpa-email-bar-input:focus {
  border-color: var(--fpa-coral);
  background: rgba(255,255,255,0.13);
}
.fpa-email-bar-input::placeholder { color: rgba(255,255,255,0.40); }
.fpa-email-bar-input[name="zip"] {
  flex: 0 0 110px;
  min-width: 100px;
}
.fpa-email-bar-btn {
  padding: 13px 26px;
  background: var(--fpa-coral);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.fpa-email-bar-btn:hover {
  background: var(--fpa-coral-dark);
  transform: translateY(-1px);
}
.fpa-email-bar-success {
  display: none;
  color: #6ee7b7;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 auto 14px;
  text-align: center;
}
.fpa-email-bar-fine {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  margin-top: 8px;
}
@media (max-width: 540px) {
  .fpa-email-bar { padding: 44px 20px; }
  .fpa-email-bar-form { flex-direction: column; align-items: stretch; }
  .fpa-email-bar-input[name="zip"] { flex: 1 1 auto; }
}
