/* tema-oscuro.css — modo dark real del portal v3 (marca CBRT sobre navy oscuro).
   Reemplaza el antiguo filtro de inversión. Los estilos de las páginas son
   inline con una paleta finita (generada por el restyle v3); esta capa re-mapea
   cada valor claro a su equivalente oscuro con selectores de atributo.
   Hero, footer, sección Presencia y mapa ya son oscuros: no se tocan. */

/* ---- base ---- */
html[data-theme="dark"] body{background:#061024!important;color:#dfe5f2!important}
html[data-theme="dark"] a:not([style*="color: "]){color:#33cccc}
html[data-theme="dark"] label{color:rgba(223,229,242,.6)!important}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{background:#0d1830!important;color:#dfe5f2!important;border-color:rgba(223,229,242,.25)!important}
html[data-theme="dark"] input::placeholder{color:rgba(223,229,242,.4)!important}

/* ---- superficies ---- */
html[data-theme="dark"] [style*="background: rgb(255, 255, 255)"],
html[data-theme="dark"] [style*="background: rgb(255, 255, 255)"]{background:#101d3a!important}
html[data-theme="dark"] [style*="background: rgb(242, 242, 242)"]{background:#0c1730!important}
html[data-theme="dark"] [style*="background: rgba(255, 255, 255"]{background:rgba(6,16,36,.94)!important}
/* tiles que deben seguir blancos (certificaciones, logos de integraciones) */
html[data-theme="dark"] [data-cert="1"],
html[data-theme="dark"] .logo-tile{background:#fff!important}

/* ---- superficies claras → oscuras (robusto) ----
   El color base puede llegar dentro de un `background` compuesto
   (p. ej. "linear-gradient(...) rgb(242,242,242)"), así que estas reglas
   buscan el token de color en cualquier posición del atributo. */
html[data-theme="dark"] :is(header,section,aside,div,article,footer,nav)[style*="rgb(242, 242, 242)"]{background-color:#0c1730!important}
html[data-theme="dark"] :is(header,section,aside,div,article,footer,nav)[style*="rgb(255, 255, 255)"]:not(:has(> img[src*="/integraciones/"])):not(:has(> img[src*="/certificaciones/"])):not([data-cert]){background-color:#101d3a!important}
html[data-theme="dark"] :is(header,section,aside,div,article)[style*="linear-gradient"][style*="rgb(242, 242, 242)"],
html[data-theme="dark"] :is(header,section,aside,div,article)[style*="linear-gradient"][style*="rgb(255, 255, 255)"]{background-image:none!important}

/* ---- texto ---- */
html[data-theme="dark"] [style*="color: rgb(1, 20, 89)"]{color:#ffffff!important}
html[data-theme="dark"] [style*="color: rgb(68, 66, 67)"]{color:#dfe5f2!important}
html[data-theme="dark"] [style*="color: rgba(40, 44, 58"]{color:rgba(223,229,242,.78)!important}

/* ---- acento turquesa ---- */
html[data-theme="dark"] [style*="color: rgb(14, 122, 122)"]{color:#33cccc!important}
html[data-theme="dark"] [style*="color: rgba(14, 122, 122"]{color:rgba(51,204,204,.9)!important}
html[data-theme="dark"] [style*="background: rgba(14, 122, 122"]{background:rgba(51,204,204,.12)!important}
html[data-theme="dark"] [style*="solid rgb(14, 122, 122)"]{border-color:#33cccc!important}
html[data-theme="dark"] [style*="solid rgba(14, 122, 122"]{border-color:rgba(51,204,204,.45)!important}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus{outline-color:rgba(51,204,204,.6)!important}

/* ---- rojo ---- */
html[data-theme="dark"] [style*="color: rgb(196, 0, 0)"]{color:#ff6b5e!important}
html[data-theme="dark"] [style*="color: rgb(254, 0, 0)"]{color:#ff8a7a!important}
html[data-theme="dark"] [style*="color: rgba(196, 0, 0"]{color:rgba(255,107,94,.9)!important}
html[data-theme="dark"] [style*="background: rgba(196, 0, 0"]{background:rgba(255,92,77,.12)!important}
html[data-theme="dark"] [style*="solid rgba(196, 0, 0"]{border-color:rgba(255,92,77,.45)!important}
/* los botones de fondo rojo sólido (#c40000/#fe0000) funcionan igual en oscuro: sin regla */

/* ---- verde / ámbar / púrpura (estados y sellos) ---- */
html[data-theme="dark"] [style*="color: rgb(5, 150, 105)"]{color:#5ee8a4!important}
html[data-theme="dark"] [style*="color: rgba(5, 150, 105"]{color:rgba(94,232,164,.9)!important}
html[data-theme="dark"] [style*="background: rgba(5, 150, 105"]{background:rgba(94,232,164,.12)!important}
html[data-theme="dark"] [style*="solid rgba(5, 150, 105"]{border-color:rgba(94,232,164,.45)!important}
html[data-theme="dark"] [style*="color: rgb(185, 137, 0)"]{color:#e8c44f!important}
html[data-theme="dark"] [style*="color: rgba(185, 137, 0"]{color:rgba(232,196,79,.9)!important}
html[data-theme="dark"] [style*="background: rgba(185, 137, 0"]{background:rgba(232,196,79,.12)!important}
html[data-theme="dark"] [style*="solid rgba(185, 137, 0"]{border-color:rgba(232,196,79,.45)!important}
html[data-theme="dark"] [style*="color: rgb(106, 63, 216)"]{color:#b48aff!important}
html[data-theme="dark"] [style*="color: rgba(106, 63, 216"]{color:rgba(180,138,255,.9)!important}
html[data-theme="dark"] [style*="background: rgba(106, 63, 216"]{background:rgba(180,138,255,.12)!important}
html[data-theme="dark"] [style*="solid rgba(106, 63, 216"]{border-color:rgba(180,138,255,.45)!important}

/* ---- bordes y chips neutros ---- */
html[data-theme="dark"] [style*="solid rgba(40, 44, 58"]{border-color:rgba(223,229,242,.15)!important}
html[data-theme="dark"] [style*="background: rgba(40, 44, 58"]{background:rgba(223,229,242,.08)!important}

/* ---- botones navy y hovers ---- */
html[data-theme="dark"] [style*="background: rgb(1, 20, 89)"]{background:#1b2f6e!important}
html[data-theme="dark"] [style*="background: rgb(18, 58, 143)"]{background:#2a4aa8!important}
html[data-theme="dark"] [style*="color: rgb(18, 58, 143)"]{color:#8ae8f2!important}
/* el hero del home es navy de marca también en oscuro */
html[data-theme="dark"] header[id="top"]{background:#011459!important}

/* ---- sombras ---- */
html[data-theme="dark"] [style*="box-shadow"]{box-shadow:0 18px 44px rgba(0,0,0,.5)!important}

/* ---- logos ---- */
/* el logo navy de la nav pasa a blanco */
html[data-theme="dark"] img[src*="cbrt-horizontal-navy"]{filter:brightness(0) invert(1)}

/* ---- foco visible en oscuro ---- */
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] select:focus-visible{outline-color:#33cccc!important}

/* ---- superficies del navegador en oscuro ---- */
html[data-theme="dark"]{scrollbar-color:rgba(223,229,242,.25) #0c1730}
html[data-theme="dark"]::-webkit-scrollbar-track{background:#0c1730}
html[data-theme="dark"]::-webkit-scrollbar-thumb{background:rgba(223,229,242,.22);border-color:#0c1730}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{caret-color:#33cccc}
html[data-theme="dark"] ::selection{background:rgba(51,204,204,.35)}

/* ---- gemelos en formato crudo: estilos inyectados via setAttribute conservan
   el texto de la plantilla (sin espacios) y esquivan los selectores canónicos ---- */
html[data-theme="dark"] [style*="color:rgba(40,44,58"]{color:rgba(223,229,242,.78)!important}
html[data-theme="dark"] [style*="color:#011459"]{color:#ffffff!important}
html[data-theme="dark"] [style*="color:#444243"]{color:#dfe5f2!important}
html[data-theme="dark"] [style*="color:#0e7a7a"]{color:#33cccc!important}
html[data-theme="dark"] [style*="color:#c40000"]{color:#ff6b5e!important}
html[data-theme="dark"] [style*="color:#059669"]{color:#5ee8a4!important}
html[data-theme="dark"] [style*="color:#b98900"]{color:#e8c44f!important}
html[data-theme="dark"] [style*="color:#6a3fd8"]{color:#b48aff!important}
html[data-theme="dark"] [style*="color:#123a8f"]{color:#8ae8f2!important}
html[data-theme="dark"] [style*="background:#ffffff"]{background:#101d3a!important}
html[data-theme="dark"] [style*="background:#f2f2f2"]{background:#0c1730!important}
html[data-theme="dark"] [style*="solid rgba(40,44,58"]{border-color:rgba(223,229,242,.15)!important}
html[data-theme="dark"] [style*="background:rgba(40,44,58"]{background:rgba(223,229,242,.08)!important}

/* ---- logos de proveedor: el tile se queda blanco en oscuro ----
   Los logotipos de fabricante están dibujados para fondo claro; oscurecer el
   tile los vuelve ilegibles (Fortinet, Cisco y Zscaler desaparecen).
   Selector por contenido: independiente de cómo se serialice el color. */
html[data-theme="dark"] :is(div,span,a):has(> img[src*="/integraciones/"]),
html[data-theme="dark"] :is(div,span,a):has(> img[src*="/certificaciones/"]),
html[data-theme="dark"] [data-cert]{background:#ffffff!important;border-color:rgba(223,229,242,.28)!important}

/* ---- hero del home en oscuro ----
   El navy de marca (#011459) sobre una página casi negra se lee como un
   bloque azul suelto. En oscuro baja a un navy profundo que continúa la
   página, y el scrim deja respirar el video. */
html[data-theme="dark"] header[id="top"]{background:#050d24!important}
html[data-theme="dark"] header[id="top"] [data-hero-overlay]{background:linear-gradient(100deg,rgba(5,13,36,.93) 28%,rgba(5,13,36,.72) 62%,rgba(5,13,36,.5))!important}
@media (max-width:760px){
html[data-theme="dark"] header[id="top"] [data-hero-overlay]{background:linear-gradient(180deg,rgba(5,13,36,.82),rgba(5,13,36,.9))!important}
html[data-theme="dark"] header[id="top"] video{opacity:.45!important}
}
