/* policy-styles.css
   Shared base stylesheet loaded on EVERY page. Holds: color tokens
   (dark-theme defaults in :root, light-theme overrides in
   :root[data-theme="light"]), the unified navbar, the Legal dropdown,
   the mobile flyout dropdown, the theme toggle (persistent vertical
   3-icon segmented control in the header + a single spelled-out cycling
   button inside the mobile flyout), the universal footer copyright bar,
   legal-page typography, and the contact form component styles.

   ------------------------------------------------------------------------
   THEME ARCHITECTURE:
   - :root holds the dark-theme values (also the site's default/fallback).
   - :root[data-theme="light"] overrides them for the light theme.
   - --color-brand-navy, --color-on-brand-navy-*, --color-highlight-amber,
     --color-nav-hover-accent, and --color-cta-bg / --color-cta-bg-hover
     are DELIBERATELY excluded from the light override block — they stay
     fixed in both themes:
       - navbar/footer navy is tied to the banner logo's background.
       - amber is used for bracketed placeholder markers in the
         navbar/footer.
       - nav-hover-accent is the primary-nav hover/focus underline color.
       - cta-bg/cta-bg-hover is the primary "Free Assessment"/submit
         button color — a distinct royal blue kept IDENTICAL in both
         themes (not derived from --color-navy or --color-accent, both of
         which had contrast/tone problems for this specific use — see the
         BUTTONS note below).
   - --color-highlight-amber-content is a SEPARATE token used for
     in-content placeholder text AND the larger footer content grid. It
     DOES swap in light theme, unlike --color-highlight-amber.
   - --color-danger / --overlay-danger-bg / --overlay-danger-border MUST
     be defined in BOTH :root and the light override — a variable defined
     only in the light block resolves to nothing in dark mode.

   BUTTONS NOTE:
   - .btn-submit previously used --color-navy (#09253a), which was never
     overridden for light theme, so it looked identical (near-black/navy)
     in both themes — not a real "blue," and too heavy in light mode.
     Now uses the new fixed --color-cta-bg / --color-cta-bg-hover tokens
     instead: a genuine mid-blue with verified WCAG AA contrast for white
     text in both themes (6.7:1 resting, 8.72:1 hover).
   - .btn-outline (see home-styles.css) previously had a fully transparent
     background, which is why it had little contrast against the hero
     section's own background in both themes. It now uses the same
     --color-bg-elevated "card surface" treatment already used by feature
     cards and bento cards elsewhere on the site.
   - --color-navy / --color-navy-hover remain defined for now (no other
     rule references them after this change) in case a future component
     wants a swappable navy distinct from the fixed CTA blue.

   ORDERING NOTE: whenever a selector has both an unconditional base rule
   AND a media-query override at the SAME specificity, the override must
   appear AFTER the base rule in the file.

   LOGO/EDGE NOTE: the banner logo image already carries its own internal
   navy padding, so the navbar itself now has NO left padding — the logo
   sits flush against the true left edge of the header.

   CURRENT-PAGE INDICATOR NOTE: both the Legal dropdown's and the mobile
   hamburger flyout's current-page link use accent navy color, bold
   weight, and a bottom border tracing the bottom edge of the link's own
   rounded-rectangle hit area rather than a text underline.
   ------------------------------------------------------------------------ */

:root {
  /* ---------- Page surfaces & text (dark theme values; swappable later) ---------- */
  --color-bg: #0a0a0a;
  --color-bg-elevated: #141414;
  --color-surface-deep: #000000;
  --color-text: #f2f2f2;
  --color-text-muted: #b8b8b8;
  --color-heading: #ffffff;
  --color-border: rgba(255, 255, 255, 0.12);

  /* ---------- Interactive accent (dark theme values; swappable later) ---------- */
  --color-accent: #4f8ef7;
  --color-accent-hover: #7badfa;

  /* FIXED — placeholder markers inside the navbar and the footer
     COPYRIGHT bar must stay this exact amber in both themes. */
  --color-highlight-amber: #ffd479;
  /* SWAPPABLE — placeholder markers inside page CONTENT and the larger
     footer content grid; see the light override block. */
  --color-highlight-amber-content: #ffd479;

  --color-accent-neon: #39ff14;

  /* ---------- FIXED primary-nav hover/focus underline color. ---------- */
  --color-nav-hover-accent: #4f8ef7;

  /* ---------- FIXED primary CTA button color ("Free Assessment",
     "Send Message", other .btn-submit uses). Identical in both themes —
     a genuine mid-blue with verified white-text contrast, distinct from
     both the fixed brand navy and the theme-swapping accent blue. ---------- */
  --color-cta-bg: #1D4ED8;
  --color-cta-bg-hover: #1E40AF;

  /* ---------- New theme-adaptive tokens (light-theme overrides below) ---------- */
  --overlay-surface-hover: rgba(255, 255, 255, 0.08);
  --overlay-surface-border: rgba(255, 255, 255, 0.3);
  --overlay-surface-muted-text: rgba(255, 255, 255, 0.35);
  --overlay-surface-strip: rgba(0, 0, 0, 0.6);
  --color-eyebrow-border: rgba(79, 142, 247, 0.4);
  --color-eyebrow-bg: rgba(79, 142, 247, 0.1);
  --color-eyebrow-text: #93c5ff;

  /* ---------- Danger/error indicators (dark theme values; swappable) ---------- */
  --color-danger: #ff8f8f;
  --overlay-danger-bg: rgba(255, 143, 143, 0.1);
  --overlay-danger-border: rgba(255, 143, 143, 0.4);

/* ---------- Success indicators (dark theme values; swappable) ---------- */
--color-success: #b7f0cc;
--overlay-success-bg: rgba(79, 200, 130, 0.1);
--overlay-success-border: rgba(79, 200, 130, 0.4);

  /* ---------- Swappable "navy" — currently unused after the .btn-submit
     change above, kept defined in case a future component wants it. ---------- */
  --color-navy: #09253a;
  --color-navy-hover: #123069;

  /* ---------- FIXED brand navy — navbar + footer copyright bar ONLY. ---------- */
  --color-brand-navy: #09253a;
  --color-on-brand-navy: #ffffff;
  --color-on-brand-navy-muted: #cbd5e1;
  --color-on-brand-navy-accent: #7badfa;

  /* ---------- Generic overlays ---------- */
  --overlay-white-08: rgba(255, 255, 255, 0.08);
  --overlay-white-30: rgba(255, 255, 255, 0.3);
  --overlay-white-35: rgba(255, 255, 255, 0.35);
  --overlay-black-60: rgba(0, 0, 0, 0.6);
  --overlay-navy-98: rgba(10, 10, 10, 0.98);

  /* ---------- Glow effects (dark-theme signature look — kept as-is) ---------- */
  --glow-blue-strong: rgba(79, 142, 247, 0.6);
  --glow-blue-soft: rgba(79, 142, 247, 0.3);
  --glow-blue-hover: rgba(79, 142, 247, 0.55);
  --glow-neon: rgba(57, 255, 20, 0.6);

  /* ---------- Layout ---------- */
  --navbar-height: clamp(64px, 8vh, 84px);
  --content-max-width: 860px;
  --radius: 8px;
  --transition: 160ms ease-in-out;
}

@media (max-width: 860px) {
  :root {
    --navbar-height: 72px;
  }
}

/* ======================================================================
   LIGHT THEME
   ====================================================================== */
:root[data-theme="light"] {
  --color-bg: #EEF2F6;
  --color-bg-elevated: #FFFFFF;
  --color-surface-deep: #FFFFFF;
  --color-text: #1E293B;
  --color-text-muted: #64748B;
  --color-heading: #0B1F3A;
  --color-border: rgba(15, 23, 42, 0.12);

  --color-accent: #1D4ED8;
  --color-accent-hover: #1E40AF;
  --color-accent-neon: #0F766E;

  /* --color-highlight-amber and --color-cta-bg/--color-cta-bg-hover are
     intentionally NOT overridden here — they stay fixed in both themes. */
  --color-highlight-amber-content: #92650C;

  --glow-blue-strong: rgba(29, 78, 216, 0.25);
  --glow-blue-soft: rgba(29, 78, 216, 0.12);
  --glow-blue-hover: rgba(29, 78, 216, 0.25);
  --glow-neon: rgba(15, 118, 110, 0.25);

  --overlay-surface-hover: rgba(11, 31, 58, 0.06);
  --overlay-surface-border: rgba(11, 31, 58, 0.25);
  --overlay-surface-muted-text: rgba(11, 31, 58, 0.35);
  --overlay-surface-strip: rgba(226, 232, 240, 0.9);

  --color-danger: #B91C1C;
  --overlay-danger-bg: rgba(185, 28, 28, 0.08);
  --overlay-danger-border: rgba(185, 28, 28, 0.35);
  
  /* Deep green remains readable on the light success banner. */
  --color-success: #166534;
  --overlay-success-bg: rgba(22, 101, 52, 0.08);
  --overlay-success-border: rgba(22, 101, 52, 0.35);

  --color-eyebrow-border: rgba(29, 78, 216, 0.35);
  --color-eyebrow-bg: rgba(29, 78, 216, 0.08);
  --color-eyebrow-text: #1E40AF;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: clip;
}

html {
  scroll-padding-top: var(--navbar-height);
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-accent);
  color: #05050a;
  padding: 0.5rem 1rem;
  z-index: 1000;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ======================================================================
   Navbar — ONE sticky navy row. No left padding — the logo (which
   already has its own internal navy padding) sits flush against the true
   left edge to reclaim width for the theme toggle at mobile widths.
   ====================================================================== */

.site-navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  width: 100%;
  max-width: none;
  background-color: var(--color-brand-navy);
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.5rem, 1.5vw, 1.25rem);
  padding: 0 clamp(1rem, 3vw, 2.5rem) 0 0;
}

@media (max-width: 860px) {
  .site-navbar {
    gap: 0.4rem;
  }
}

.site-navbar .logo-link {
  display: flex;
  align-items: center;
  height: 100%;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--color-on-brand-navy);
}

.site-navbar .logo-mark {
  height: 100%;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

@media (max-width: 860px) {
  .site-navbar .logo-mark {
    max-width: 40vw;
  }
}

.site-navbar .logo-text {
  white-space: nowrap;
}

/* ---------- Middle stack (shared column between logo and theme toggle) ---------- */

.navbar-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}

.navbar-stack-desktop {
  display: flex;
}
.navbar-stack-desktop nav,
.navbar-row-contact {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
}

.navbar-row-contact {
  gap: 1.25rem;
  font-size: 0.85rem;
}
.navbar-row-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-on-brand-navy-muted);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.navbar-row-contact a:hover,
.navbar-row-contact a:focus-visible {
  color: var(--color-on-brand-navy);
}
.navbar-row-contact svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.navbar-stack-mobile {
  display: none;
}

.navbar-mobile-line {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  color: var(--color-on-brand-navy-muted);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}
.navbar-mobile-line:hover,
.navbar-mobile-line:focus-visible {
  color: var(--color-on-brand-navy);
}
.navbar-mobile-line svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---------- FIXED amber contexts ---------- */
.navbar-mobile-line .placeholder,
.navbar-row-contact .placeholder,
.mobile-nav .placeholder,
.footer-copyright-text .placeholder {
  color: var(--color-highlight-amber);
}

.navbar-mobile-line .placeholder,
.navbar-row-contact .placeholder {
  padding: 0;
}

.navbar-icon-phone {
  color: var(--color-highlight-amber);
}

@media (max-width: 1080px) {
  .navbar-stack-desktop .site-nav-links {
    gap: clamp(0.4rem, 1.2vw, 1rem);
  }
  .navbar-row-contact {
    gap: 0.85rem;
    font-size: 0.8rem;
  }
  .navbar-row-contact svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 860px) {
  .navbar-stack-desktop {
    display: none;
  }
  .navbar-stack-mobile {
    display: flex;
  }
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 1.6vw, 1.5rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav-links a {
  color: var(--color-on-brand-navy-muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.3rem 0.15rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}

.site-nav-links a:hover,
.site-nav-links a:focus-visible {
  color: var(--color-on-brand-navy);
  border-bottom-color: var(--color-nav-hover-accent);
}

.site-nav-links a[aria-current="page"] {
  color: var(--color-on-brand-navy);
  border-bottom-color: var(--color-on-brand-navy-accent);
}

/* ---------- Legal dropdown (top-level nav item) ---------- */

.nav-dropdown {
  position: relative;
  list-style: none;
}

.nav-dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--color-on-brand-navy-muted);
  padding: 0.3rem 0.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle:focus-visible {
  color: var(--color-on-brand-navy);
  border-bottom-color: var(--color-nav-hover-accent);
}

.nav-dropdown-toggle[data-active="true"] {
  color: var(--color-on-brand-navy);
  border-bottom-color: var(--color-on-brand-navy-accent);
}

.dropdown-caret {
  font-size: 0.7em;
  transition: transform var(--transition);
}
.nav-dropdown-toggle[aria-expanded="true"] .dropdown-caret {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--color-brand-navy);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  min-width: 200px;
  padding: 0.4rem;
  list-style: none;
  z-index: 150;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.nav-dropdown-menu[hidden] {
  display: none;
}

.nav-dropdown-menu li {
  margin: 0;
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--color-on-brand-navy-muted);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible {
  background: var(--overlay-white-08);
  color: var(--color-on-brand-navy);
}

.nav-dropdown-menu a[aria-current="page"] {
  color: var(--color-on-brand-navy-accent);
  font-weight: 600;
  border-bottom-color: var(--color-on-brand-navy-accent);
  padding-bottom: calc(0.5rem - 2px);
}

/* ---------- Theme toggle: persistent VERTICAL 3-icon segmented control. ---------- */
.theme-toggle-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  background: var(--overlay-white-08);
  border-radius: 999px;
  padding: 3px 2px;
}

.theme-toggle-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-on-brand-navy-muted);
  transition: background var(--transition), color var(--transition);
}
.theme-toggle-option svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.theme-toggle-option:hover,
.theme-toggle-option:focus-visible {
  color: var(--color-on-brand-navy);
}
.theme-toggle-option[data-active="true"] {
  background: var(--color-on-brand-navy-accent);
  color: var(--color-brand-navy);
}

@media (max-width: 860px) {
  .theme-toggle-option {
    width: 20px;
    height: 20px;
  }
  .theme-toggle-option svg {
    width: 12px;
    height: 12px;
  }
}

/* ---------- Theme toggle (mobile flyout): single cycling button. ---------- */
.theme-toggle-cycle-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-on-brand-navy-muted);
  font-size: 0.92rem;
  font-family: inherit;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.theme-toggle-cycle-btn:hover,
.theme-toggle-cycle-btn:focus-visible {
  background: var(--overlay-white-08);
  color: var(--color-on-brand-navy);
}
.theme-toggle-cycle-btn svg {
  display: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
html[data-theme-mode="dark"] .theme-toggle-cycle-btn .theme-icon-dark,
html[data-theme-mode="light"] .theme-toggle-cycle-btn .theme-icon-light,
html[data-theme-mode="auto"] .theme-toggle-cycle-btn .theme-icon-auto {
  display: block;
}
.theme-toggle-cycle-label {
  white-space: nowrap;
}

/* ---------- Mobile toggle + flyout ---------- */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-on-brand-navy);
}

.mobile-nav {
  position: fixed;
  top: calc(var(--navbar-height) + 0.5rem);
  right: clamp(1rem, 3vw, 2.5rem);
  left: auto;
  bottom: auto;
  width: max-content;
  min-width: 180px;
  max-width: min(88vw, 300px);
  max-height: calc(100vh - var(--navbar-height) - 1.5rem);
  background: var(--color-brand-navy);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 150;
  display: none;
  flex-direction: column;
  padding: 0.4rem;
  gap: 0.1rem;
  overflow-y: auto;
}
.mobile-nav:not([hidden]) {
  display: flex;
}

.mobile-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  color: var(--color-on-brand-navy-muted);
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: background var(--transition), color var(--transition);
}
.mobile-nav a:hover,
.mobile-nav a:focus-visible {
  background: var(--overlay-white-08);
  color: var(--color-on-brand-navy);
}

.mobile-nav a[aria-current="page"] {
  color: var(--color-on-brand-navy-accent);
  font-weight: 600;
  border-bottom-color: var(--color-on-brand-navy-accent);
  padding-bottom: calc(0.5rem - 2px);
}

/* ---------- Page content ---------- */

main.policy-page {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 1.5rem) 4rem;
}

main.policy-page.contact-page {
  padding-top: clamp(0.85rem, 2vw, 1.5rem);
}

.contact-page {
  line-height: 1;
}

.policy-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
}

.policy-header h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
}

.policy-meta {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.policy-header.contact-header-row {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.75rem;
}
.policy-header.contact-header-row h1 {
  margin: 0;
}

.policy-page h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  color: var(--color-heading);
}

.policy-page h3 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-heading);
}

.policy-page p,
.policy-page li {
  color: var(--color-text);
}

.policy-page ul,
.policy-page ol {
  padding-left: 1.4rem;
}

.policy-page a:not(.btn-submit):not(.btn-outline) {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: var(--glow-blue-soft);
}

.policy-page a:not(.btn-submit):not(.btn-outline):hover,
.policy-page a:not(.btn-submit):not(.btn-outline):focus-visible {
  color: var(--color-accent-hover);
}

.callout {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.placeholder {
  color: var(--color-highlight-amber-content);
  padding: 0 0.25rem;
}

table.policy-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}

table.policy-table th,
table.policy-table td {
  border: 1px solid var(--color-border);
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

table.policy-table th {
  background: var(--color-bg-elevated);
  color: var(--color-heading);
}

/* ======================================================================
   Footer copyright bar — universal, fixed navy, present on ALL six pages.
   ====================================================================== */

.footer-copyright-bar {
  background: var(--color-brand-navy);
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  text-align: center;
}

.footer-copyright-text {
  margin: 0 auto;
  max-width: 1100px;
  color: var(--color-on-brand-navy-muted);
  font-size: 0.82rem;
}

.footer-copyright-text a {
  color: var(--color-on-brand-navy-muted);
  text-decoration: underline;
}

.footer-copyright-text a:hover,
.footer-copyright-text a:focus-visible {
  color: var(--color-on-brand-navy);
}

/* ---------- Focus & motion ---------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent-hover);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  .site-nav-links {
    gap: 0.6rem;
  }
  .site-nav-links a,
  .nav-dropdown-toggle {
    font-size: 0.82rem;
  }
  .logo-text {
    display: none;
  }
}

/* ======================================================================
   Contact Form
   ====================================================================== */

.contact-page {
  max-width: 780px;
}

.form-section {
  margin-bottom: 1.25rem;
}

.form-section-tight {
  margin-bottom: 0.6rem;
}

.form-section h2 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 0.6rem;
  color: var(--color-heading);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 640px) {
  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 0.65rem;
}

.form-group label,
.form-group legend {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}

.required-mark {
  color: var(--color-danger);
  font-weight: 700;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.25);
}

fieldset.form-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  margin: 0 0 0.65rem;
}

fieldset.form-group legend {
  padding: 0 0.3rem;
  margin-bottom: 0.4rem;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
  color: var(--color-text);
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}

.radio-option input,
.checkbox-option input {
  margin-top: 0.2rem;
  accent-color: var(--color-accent);
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.checkbox-option label {
  color: var(--color-text);
  font-size: 0.92rem;
  margin: 0;
}

.checkbox-option:has(input.field-invalid) {
  border-color: var(--color-danger);
  background: var(--overlay-danger-bg);
}

.sms-option-collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0 !important;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.3s ease;
}

.sms-option-collapsed.sms-option-expanded {
  max-height: 4rem;
  opacity: 1;
  margin-bottom: 0.4rem !important;
}

.address-encourage-line {
  margin: 0.5rem 0 0.75rem;
}

.conditional-section {
  border-left: 2px solid var(--color-accent);
  padding-left: 1rem;
  margin: 0.6rem 0 0.65rem;
}

.conditional-section[hidden] {
  display: none;
}

.field-error {
  color: var(--color-danger);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: none;
}

.field-error.visible {
  display: block;
}

.field-offset {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
  display: none;
}

.form-status.visible {
  display: block;
}

.form-status.status-success {
  background: var(--overlay-success-bg);
  border: 1px solid var(--overlay-success-border);
  color: var(--color-success);
}

.form-status.status-error {
  background: var(--overlay-danger-bg);
  border: 1px solid var(--overlay-danger-border);
  color: var(--color-danger);
}

.form-status.status-info {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.turnstile-wrapper {
  margin: 0.75rem 0 1.1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-elevated);
}

.turnstile-help {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0 0 0.6rem;
}

/* Primary CTA button ("Free Assessment", "Send Message"). Now uses the
   FIXED --color-cta-bg token (see THEME ARCHITECTURE / BUTTONS notes at
   the top of this file) instead of --color-navy, which was never
   overridden for light theme and therefore looked identical (too dark)
   in both themes. */
.btn-submit {
  background: var(--color-cta-bg);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background var(--transition), border-color var(--transition);
}

.btn-submit:hover,
.btn-submit:focus-visible {
  background: var(--color-cta-bg-hover);
  border-color: var(--color-accent);
  text-decoration: none;
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.consent-text a {
  color: var(--color-accent);
}

.form-footnote {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
}

.field-invalid {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 0 2px var(--overlay-danger-border);
}

.address-suggestions {
  position: absolute;
  z-index: 20;
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0.25rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  max-width: 100%;
}

.address-suggestions li {
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 4px;
}

.address-suggestions li:hover {
  background: rgba(79, 142, 247, 0.12);
}
