/* Shared Multi-Site Static Design System — Driven by Per-Site CSS Custom Properties */
:root {
  color-scheme: light;
  --brand-primary: #0f293a;
  --brand-primary-dark: #091b27;
  --brand-accent: #0d7c8a;
  --brand-accent-dark: #095f6a;
  --brand-warm: #c97a32;
  --surface: #ffffff;
  --surface-alt: #f5f3ee;
  --surface-tint: #ebf4f6;
  --ink: #13202a;
  --muted: #4b5d6b;
  --border: #d7dfe4;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --success: #15803d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 28px rgba(15, 41, 58, 0.08);
  --max-w: 1140px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  overflow-x: clip;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand-accent-dark);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand-primary);
}

:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-primary);
  color: #ffffff;
  padding: 12px 16px;
  z-index: 100;
  font-weight: 700;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Top Utility Bar */
.top-bar {
  background: var(--brand-primary-dark);
  color: #e4eef4;
  font-size: 0.85rem;
  padding: 8px 0;
}

.top-bar-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
}

.top-bar a {
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
}

@supports (backdrop-filter: blur(10px)) {
  .site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 10px 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--brand-primary);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-link img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex: none;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.desktop-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  padding: 8px 2px;
}

.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] {
  color: var(--brand-accent-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

/* Mobile Nav Drawer */
.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 20px 24px;
}

.mobile-drawer.is-open {
  display: block;
}

.mobile-drawer nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-drawer a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.mobile-drawer a:hover {
  background: var(--surface-alt);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.96rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.btn-primary {
  background: var(--brand-accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--brand-accent-dark);
  color: #ffffff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--brand-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn-light {
  background: #ffffff;
  color: var(--brand-primary);
}

.btn-light:hover {
  background: #eaf3f5;
  color: var(--brand-primary-dark);
}

.btn-outline-light {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.87rem;
  color: var(--muted);
  padding: 16px 0 0;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: #93a3ae;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary) 65%, #164459 100%);
  color: #ffffff;
  padding: 64px 0 72px;
}

.hero-compact {
  padding: 44px 0 52px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 36px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7ee0eb;
  margin-bottom: 10px;
}

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 850;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 800;
}

h3 {
  font-size: 1.2rem;
  font-weight: 750;
}

.hero-lede {
  font-size: 1.12rem;
  color: #d6e4ec;
  max-width: 60ch;
  margin: 0 0 24px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 0.88rem;
  color: #cde0eb;
}

.hero-card {
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

/* Sections */
.section {
  padding: 60px 0;
}

.section-alt {
  background: var(--surface-alt);
}

.section-tint {
  background: var(--surface-tint);
}

.section-dark {
  background: var(--brand-primary);
  color: #ffffff;
}

.section-dark p {
  color: #d3e2ea;
}

.section-head {
  max-width: 70ch;
  margin-bottom: 32px;
}

.section-head p {
  color: var(--muted);
  margin: 0;
  font-size: 1.04rem;
}

/* Answer-First Summary Box (GEO / AI Extraction) */
.answer-box {
  background: var(--surface-tint);
  border: 1px solid #b8dce2;
  border-left: 5px solid var(--brand-accent);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 32px;
}

.answer-box h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--brand-primary);
}

/* Grids & Cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.card-meta {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-accent-dark);
}

.card-link {
  margin-top: auto;
  padding-top: 8px;
  font-weight: 700;
  text-decoration: none;
}

/* Data Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
}

th,
td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

th {
  background: var(--surface-alt);
  color: var(--brand-primary);
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:last-child td {
  border-bottom: 0;
}

/* City Chips */
.city-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.city-chips li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* FAQ Native <details> Accordion (Searchable & Indexable) */
.faq-list {
  display: grid;
  gap: 12px;
  max-width: 820px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.35rem;
  color: var(--brand-accent);
  font-weight: 800;
  flex: none;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 20px 18px;
  color: var(--muted);
}

.faq-answer p {
  margin: 0;
}

/* Prose / Legal Pages */
.prose {
  max-width: 74ch;
}

.prose h2 {
  margin-top: 28px;
  font-size: 1.3rem;
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose strong {
  color: var(--ink);
}

/* Forms & Modern :user-invalid Validation */
.quote-form {
  display: grid;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #b9c7d1;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.96rem;
  color: var(--ink);
  background: #ffffff;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.field input:user-invalid,
.field select:user-invalid,
.field textarea:user-invalid,
.field input.user-invalid-fallback,
.field select.user-invalid-fallback,
.field textarea.user-invalid-fallback {
  border-color: var(--error);
  background: var(--error-bg);
}

.field input:user-valid,
.field select:user-valid,
.field input.user-valid-fallback,
.field select.user-valid-fallback {
  border-color: var(--success);
}

.field-error {
  display: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--error);
}

.field input:user-invalid + .field-error,
.field input.user-invalid-fallback + .field-error,
.field select:user-invalid + .field-error,
.field select.user-invalid-fallback + .field-error {
  display: block;
}

/* Quote-Form Consent Line + Info-Icon Popover (Verbatim Legal Draft §4) */
.consent-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.4;
}

.consent-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--brand-primary);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
}

.consent-info-btn:hover {
  border-color: var(--brand-accent);
  background: var(--surface-tint);
}

.consent-popover {
  max-width: min(400px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.5;
  box-shadow: 0 14px 36px rgba(15, 41, 58, 0.2);
}

.consent-popover[popover] {
  margin: auto;
}

.consent-popover[popover]:is(:popover-open, .\:popover-open),
.consent-popover.is-open-fallback {
  display: block;
}

.consent-popover:not([popover]) {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 60;
}

.form-status {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface-tint);
  color: var(--ink);
}

.form-status[hidden] {
  display: none;
}

/* Native <dialog closedby="any"> Reusable Quote Modal */
dialog.quote-dialog {
  width: min(540px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(9, 27, 39, 0.35);
  overflow: auto;
}

dialog.quote-dialog::backdrop {
  background: rgba(9, 27, 39, 0.62);
  backdrop-filter: blur(2px);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.dialog-close {
  min-width: 40px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
}

.dialog-body {
  padding: 18px 22px 22px;
}

/* Footer & Verbatim Collapsed Referral Disclaimer */
.site-footer {
  background: var(--brand-primary-dark);
  color: #cadbe5;
  padding: 52px 0 34px;
}

.site-footer a {
  color: #e6f2f7;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-heading {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  font-size: 0.9rem;
}

.footer-legal-strip {
  padding-top: 22px;
  display: grid;
  gap: 12px;
  font-size: 0.82rem;
  color: #9cb4c2;
}

.footer-disclaimer summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b7ccd8;
  font-size: 0.82rem;
  padding: 4px 0;
}

.footer-disclaimer summary::-webkit-details-marker {
  display: none;
}

.footer-disclaimer p {
  margin: 8px 0 4px;
  max-width: 90ch;
  line-height: 1.55;
  color: #a9c0cd;
}

.footer-bottom-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 20px;
}

.footer-bottom-links {
  display: flex;
  gap: 14px;
}

@media (max-width: 960px) {
  .desktop-nav,
  .header-actions .btn-secondary {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .hero-grid,
  .grid-3,
  .grid-4,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero {
    padding: 40px 0 48px;
  }

  .section {
    padding: 42px 0;
  }

  .header-actions .btn-primary {
    padding: 8px 14px;
    font-size: 0.86rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
