/* CustodyProviders.com — Visual Integrity V12
   Final presentation-only layer. Loaded after all legacy CSS.
   Purpose: eliminate remaining contrast, checkbox, header and table-wrap collisions
   without changing SEO, provider data, link gating, comparison or lead behavior. */

:root{
  --vi12-ink:#0b1f3a;
  --vi12-text:#33445a;
  --vi12-muted:#52657a;
  --vi12-blue:#2563eb;
  --vi12-dark:#071a2f;
  --vi12-dark-text:#f8fbff;
  --vi12-dark-muted:#d7e3f4;
  --vi12-line:#d8e2ee;
}

/* 1) Header: the global logo treatment is white, therefore navigation must be dark. */
html body .header,
html body .site-header{
  background:#fff!important;
  border-bottom:1px solid #e2e8f0!important;
}
html body .header :is(.navlinks,.nav-links) a:not(.nav-cta):not([href*="register"]),
html body .site-header :is(.navlinks,.nav-links) a:not(.nav-cta):not([href*="register"]){
  color:#33445a!important;
  -webkit-text-fill-color:#33445a!important;
  opacity:1!important;
}
html body .header :is(.navlinks,.nav-links) a:not(.nav-cta):not([href*="register"]):hover,
html body .site-header :is(.navlinks,.nav-links) a:not(.nav-cta):not([href*="register"]):hover,
html body .header :is(.navlinks,.nav-links) a[aria-current="page"],
html body .site-header :is(.navlinks,.nav-links) a[aria-current="page"]{
  color:#1d4ed8!important;
  -webkit-text-fill-color:#1d4ed8!important;
  background:#eff6ff!important;
  text-decoration:none!important;
}

/* 2) About hero: intentional dark surface must never inherit light-page dark typography. */
html body:not(.ca-page) .about-hero{
  color:var(--vi12-dark-text)!important;
}
html body:not(.ca-page) .about-hero h1{
  color:var(--vi12-dark-text)!important;
  -webkit-text-fill-color:var(--vi12-dark-text)!important;
  opacity:1!important;
}
html body:not(.ca-page) .about-hero :is(p,.lead){
  color:#dbe7f7!important;
  -webkit-text-fill-color:#dbe7f7!important;
  opacity:1!important;
}
html body:not(.ca-page) .about-hero .eyebrow{
  display:inline-flex!important;
  width:auto!important;
  max-width:max-content!important;
  padding:9px 15px!important;
  border:1px solid rgba(191,219,254,.7)!important;
  border-radius:999px!important;
  background:#eef5ff!important;
  color:#2454b8!important;
  -webkit-text-fill-color:#2454b8!important;
  box-shadow:none!important;
}

/* 3) Intentional navy cards/panels: high-contrast text, independent of legacy light-card rules. */
html body :is(.lead-panel,.lead-economics-card,.steps-section,.cta-band,.dark-section,.dark-panel,.dark-card,.navy-panel,.navy-card,[data-theme="dark"]){
  background-color:var(--vi12-dark)!important;
  color:var(--vi12-dark-text)!important;
}
html body :is(.lead-panel,.lead-economics-card,.steps-section,.cta-band,.dark-section,.dark-panel,.dark-card,.navy-panel,.navy-card,[data-theme="dark"])
  :is(h1,h2,h3,h4,h5,h6,strong,b,summary){
  color:var(--vi12-dark-text)!important;
  -webkit-text-fill-color:var(--vi12-dark-text)!important;
  opacity:1!important;
}
html body :is(.lead-panel,.lead-economics-card,.steps-section,.cta-band,.dark-section,.dark-panel,.dark-card,.navy-panel,.navy-card,[data-theme="dark"])
  :is(p,li,span,small,dd,dt,.muted,.small,.lead){
  color:var(--vi12-dark-muted)!important;
  -webkit-text-fill-color:var(--vi12-dark-muted)!important;
  opacity:1!important;
}
html body .lead-economics-card strong{
  display:block!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
html body .lead-panel a:not(.btn),
html body :is(.dark-section,.dark-panel,.dark-card,.navy-panel,.navy-card,[data-theme="dark"]) a:not(.btn){
  color:#dbeafe!important;
  -webkit-text-fill-color:#dbeafe!important;
}
html body .lead-panel :is(.btn.primary,.btn-primary),
html body .lead-panel a:is(.btn.primary,.btn-primary){
  background:var(--vi12-blue)!important;
  border-color:var(--vi12-blue)!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
html body .lead-panel .btn:not(.primary):not(.btn-primary),
html body .lead-panel a.btn:not(.primary):not(.btn-primary){
  background:#fff!important;
  border-color:#c7d3e2!important;
  color:var(--vi12-ink)!important;
  -webkit-text-fill-color:var(--vi12-ink)!important;
}
html body .lead-panel .btn *,
html body .lead-economics-card .btn *{
  color:inherit!important;
  -webkit-text-fill-color:inherit!important;
}

/* 4) Form-control containment: checkboxes/radios must never inherit text-input dimensions. */
html body input[type="checkbox"],
html body input[type="radio"],
html body form input[type="checkbox"],
html body form input[type="radio"]{
  box-sizing:border-box!important;
  display:inline-block!important;
  width:20px!important;
  height:20px!important;
  min-width:20px!important;
  min-height:20px!important;
  max-width:20px!important;
  max-height:20px!important;
  padding:0!important;
  margin:2px 0 0!important;
  flex:0 0 20px!important;
  border-radius:4px!important;
  box-shadow:none!important;
  accent-color:var(--vi12-blue)!important;
  vertical-align:top!important;
}
html body .rfp-consent{
  display:flex!important;
  align-items:flex-start!important;
  gap:12px!important;
  width:100%!important;
  margin:0!important;
  padding:14px 16px!important;
  border:1px solid #e2e8f0!important;
  border-radius:12px!important;
  background:#f8fafc!important;
  color:#33445a!important;
  -webkit-text-fill-color:#33445a!important;
  line-height:1.55!important;
}
html body .rfp-consent span{
  color:#33445a!important;
  -webkit-text-fill-color:#33445a!important;
  opacity:1!important;
}
html body form.contact-card .hero-cta .rfp-consent,
html body .contact-card .hero-cta .rfp-consent{
  flex:1 0 100%!important;
  margin-bottom:2px!important;
}
html body .rfp-checks label{
  align-items:flex-start!important;
}

/* 5) Regulatory tables: prevent mid-word fragmentation on normal desktop widths. */
@media (min-width:761px){
  html body .matrix-shell{
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  html body .regulatory-table{
    min-width:1420px!important;
    table-layout:auto!important;
  }
  html body .regulatory-table th,
  html body .regulatory-table td,
  html body .regulatory-table a,
  html body .regulatory-table :is(.matrix-sub,.regime-pill,.matrix-status,.matrix-source){
    word-break:normal!important;
    overflow-wrap:normal!important;
    hyphens:none!important;
  }
  html body .regulatory-table th:nth-child(1),
  html body .regulatory-table td:nth-child(1){min-width:205px!important}
  html body .regulatory-table th:nth-child(2),
  html body .regulatory-table td:nth-child(2){min-width:125px!important;white-space:nowrap!important}
  html body .regulatory-table th:nth-child(3),
  html body .regulatory-table td:nth-child(3){min-width:160px!important}
  html body .regulatory-table th:nth-child(4),
  html body .regulatory-table td:nth-child(4){min-width:470px!important}
  html body .regulatory-table th:nth-child(5),
  html body .regulatory-table td:nth-child(5){min-width:145px!important}
  html body .regulatory-table th:nth-child(6),
  html body .regulatory-table td:nth-child(6){min-width:190px!important}
  html body .regulatory-table .matrix-status{max-width:180px!important}
}

/* 6) General anti-fragmentation for navigation/buttons/badges. */
html body :is(.btn,.pill,.badge,.revenue-badge,.navlinks a,.nav-links a,.matrix-status,.regime-pill){
  word-break:normal!important;
  overflow-wrap:normal!important;
  hyphens:none!important;
}

/* 7) Mobile: keep fixes compact and touch-friendly. */
@media(max-width:760px){
  html body .about-hero{padding-top:54px!important;padding-bottom:42px!important}
  html body .about-hero .eyebrow{padding:8px 13px!important}
  html body .rfp-consent{padding:13px 14px!important;gap:11px!important}
  html body input[type="checkbox"],
  html body input[type="radio"]{width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important}
}
