/* ============================================================
   DxCheck — Site-Wide Stylesheet
   Loaded on every page. Holds: header, footer, lightbox modals,
   and the small set of base resets we want sitewide.
   Section-specific styles stay inline per section in each page.
   ============================================================ */

/* Force the [hidden] HTML attribute to actually hide elements.
   Necessary because rules like `.contact-form { display: flex }` override
   the browser's default [hidden] { display: none } behavior. */
[hidden] { display: none !important; }

:root {
  --text: #0E1836;
  --text-muted: #4A5476;
  --text-soft: #6B7494;
  --text-light: #FFFFFF;
  --text-light-muted: #B6BFD8;
  --text-light-soft: #8893B5;
  --navy: #0E1836;
  --navy-soft: #1A2549;
  --brand-blue: #2563eb;
  --brand-blue-dark: #1d4ed8;
  --brand-blue-light: #5B8DEF;
  --brand-red: #f43f5e;
  --brand-red-light: #FB7185;
  --bg: #FFFFFF;
  --border: #E3E6F0;
  --border-strong: #C9CEDD;
  --hover-tint: #F4F5FA;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  display: block;
}

/* Hide scroll-anchor jump under sticky header */
html { scroll-padding-top: 90px; }

img { max-width: 100%; display: block; }

/* ============================================================
   SITE HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 30px -16px rgba(14, 24, 54, 0.10);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 48px;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.header-logo img {
  height: 32px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-grow: 1;
  justify-content: center;
}

.nav-link {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1.2;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--hover-tint);
  color: var(--text);
  outline: none;
}

.nav-link.is-active {
  background: var(--hover-tint);
  color: var(--text);
}

/* Header CTA */
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-blue);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 11px 20px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--brand-blue);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 8px 22px -10px rgba(37, 99, 235, 0.5);
  flex-shrink: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.header-cta:hover {
  background: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -12px rgba(37, 99, 235, 0.6);
}

.header-cta:focus-visible {
  outline: 2px solid var(--brand-blue-light);
  outline-offset: 3px;
}

.header-cta .arrow {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
  transition: transform 0.2s ease;
}

.header-cta:hover .arrow {
  transform: translateX(2px);
}

/* Mobile toggle */
.mobile-toggle {
  display: none;
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.mobile-toggle:hover { background: var(--hover-tint); }
.mobile-toggle svg { width: 20px; height: 20px; stroke-width: 2; }
.mobile-toggle .icon-close { display: none; }
.mobile-toggle.is-open .icon-menu { display: none; }
.mobile-toggle.is-open .icon-close { display: block; }

.mobile-menu {
  display: none;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 16px 24px 24px;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu.is-open { display: flex; }

.mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.mobile-link:hover,
.mobile-link:focus-visible {
  background: var(--hover-tint);
  outline: none;
}

.mobile-cta {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.mobile-cta .header-cta {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  font-size: 15px;
}

@media (max-width: 980px) {
  .header-nav, .header-cta-desktop { display: none; }
  .mobile-toggle { display: inline-flex; }
}

@media (max-width: 600px) {
  .header-inner { padding: 12px 18px; gap: 12px; }
}

/* ============================================================
   SITE FOOTER
   ============================================================ */

.site-footer {
  background: var(--navy);
  color: var(--text-light-muted);
  padding: 64px 24px 32px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 64px;
  align-items: start;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
  max-width: 360px;
}

.footer-logo {
  display: inline-block;
  text-decoration: none;
  margin-bottom: 16px;
}

.footer-logo img {
  height: 32px;
  width: auto;
}

.footer-tagline {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-light-muted);
  margin: 0;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, auto));
  gap: 80px;
}

.footer-col-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-light-soft);
  margin-bottom: 18px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 12px;
}

.footer-col a {
  color: var(--text-light-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: color 0.2s ease;
}

.footer-col a:hover,
.footer-col a:focus-visible {
  color: var(--text-light);
  outline: none;
}

.footer-bar {
  padding-top: 24px;
  font-size: 12px;
  color: var(--text-light-soft);
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .footer-cols { gap: 48px; }
}

@media (max-width: 600px) {
  .site-footer { padding: 48px 18px 28px; }
  .footer-cols { grid-template-columns: 1fr; gap: 32px; }
}

/* ============================================================
   LIGHTBOX MODAL (contact form + gated reports)
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.is-open { display: flex; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 24, 54, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: lightboxFadeIn 0.25s ease;
}

@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg);
  border-radius: 18px;
  padding: 36px 32px 32px;
  box-shadow: 0 30px 80px -20px rgba(14, 24, 54, 0.40);
  animation: lightboxSlideIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lightboxSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lightbox-close {
  appearance: none;
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lightbox-close:hover {
  background: var(--hover-tint);
  color: var(--text);
  border-color: var(--border-strong);
}

.lightbox-close svg { width: 16px; height: 16px; }

.lightbox-eyebrow {
  display: inline-block;
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-blue);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.lightbox-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--text);
  letter-spacing: -0.015em;
}

.lightbox-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.lightbox-form { display: flex; flex-direction: column; gap: 14px; }

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

.lightbox-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.lightbox-optional {
  color: var(--text-soft);
  font-weight: 400;
}

.lightbox-form input,
.lightbox-form textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--hover-tint);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
  width: 100%;
}

.lightbox-form textarea { resize: vertical; min-height: 96px; }

.lightbox-form input:focus,
.lightbox-form textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  background: #FFFFFF;
}

.lightbox-submit {
  margin-top: 6px;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--brand-blue);
  color: #FFFFFF;
  border: 1px solid var(--brand-blue);
  border-radius: 999px;
  padding: 13px 22px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 12px 24px -12px rgba(37, 99, 235, 0.55);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.lightbox-submit:hover {
  background: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -14px rgba(37, 99, 235, 0.65);
}

.lightbox-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.lightbox-submit .arrow {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.lightbox-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.4;
}

/* Success state */
.lightbox-success {
  text-align: center;
  padding: 8px 4px 12px;
}

.lightbox-success .success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  color: var(--brand-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lightbox-success .success-icon svg { width: 28px; height: 28px; }

.lightbox-success h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.lightbox-success p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

@media (max-width: 540px) {
  .lightbox-panel { padding: 30px 22px 24px; border-radius: 16px; }
  .lightbox-title { font-size: 20px; }
}
