/*
  IngSoft V84.20 — Auditoría total de contraste página por página
  Arquitectura: contraste semántico por superficies reales + bloqueo de legibilidad.
  Criterio: texto claro sobre fondo oscuro; texto oscuro sobre fondo claro; selectores y formularios legibles.
*/

:root{
  --v8420-dark-980:#020A16;
  --v8420-dark-950:#06152A;
  --v8420-dark-card:#0B223C;
  --v8420-dark-card-2:#102C4C;
  --v8420-light:#FFFFFF;
  --v8420-light-2:#F4F9FD;
  --v8420-light-3:#EAF5FC;
  --v8420-ink:#071832;
  --v8420-ink-2:#213A5A;
  --v8420-ink-3:#385B7A;
  --v8420-white:#FFFFFF;
  --v8420-white-2:#EAF7FF;
  --v8420-white-3:#CDEBFF;
  --v8420-cyan:#31CFFF;
  --v8420-cyan-2:#8BD4FF;
  --v8420-line-dark:rgba(139,212,255,.34);
  --v8420-line-light:#B9D9ED;
}

/* 1. Superficies oscuras reales: fondo y texto base */
html body :is(.surface-dark,.section-dark,.dark-section,.hero-dark,.agent-lab-section,.v83-repro-section,.lab-dark,.sim-dark,.science-panel-dark,.site-footer,footer){
  color:var(--v8420-white-2) !important;
  -webkit-text-fill-color:initial !important;
}
html body :is(.surface-dark,.section-dark,.dark-section,.hero-dark,.agent-lab-section,.v83-repro-section,.lab-dark,.sim-dark,.science-panel-dark,.site-footer,footer)
  :is(h1,h2,h3,h4,h5,h6,strong,b,.title,.headline,.section-title):not(.eyebrow):not(.badge-label):not(.pill-label){
  color:var(--v8420-white) !important;
  -webkit-text-fill-color:var(--v8420-white) !important;
}
html body :is(.surface-dark,.section-dark,.dark-section,.hero-dark,.agent-lab-section,.v83-repro-section,.lab-dark,.sim-dark,.science-panel-dark,.site-footer,footer)
  :is(p,li,dt,dd,label,small,span,.meta,.muted,.subtitle,.desc,.lead):not(.eyebrow):not(.badge-label):not(.pill-label):not(.btn):not(.button):not([class*="btn"]):not(option){
  color:var(--v8420-white-2) !important;
  -webkit-text-fill-color:var(--v8420-white-2) !important;
}
html body :is(.surface-dark,.section-dark,.dark-section,.hero-dark,.agent-lab-section,.v83-repro-section,.lab-dark,.sim-dark,.science-panel-dark,.site-footer,footer)
  a:not(.btn):not(.button):not([class*="btn"]):not(.eyebrow){
  color:var(--v8420-cyan-2) !important;
  -webkit-text-fill-color:var(--v8420-cyan-2) !important;
}

/* 2. Tarjetas oscuras reales: nunca texto azul oscuro sobre azul oscuro */
html body :is(.surface-dark-card,.card--dark,.panel--dark,.agent-card,.v83-repro-card,.v91-sim-card,.agent-output-panel){
  background:linear-gradient(180deg,var(--v8420-dark-card) 0%,var(--v8420-dark-card-2) 100%) !important;
  border:1.5px solid var(--v8420-line-dark) !important;
  color:var(--v8420-white-2) !important;
  -webkit-text-fill-color:initial !important;
}
html body :is(.surface-dark-card,.card--dark,.panel--dark,.agent-card,.v83-repro-card,.v91-sim-card,.agent-output-panel)
  :is(h1,h2,h3,h4,h5,h6,strong,b,.title){
  color:var(--v8420-white) !important;
  -webkit-text-fill-color:var(--v8420-white) !important;
}
html body :is(.surface-dark-card,.card--dark,.panel--dark,.agent-card,.v83-repro-card,.v91-sim-card,.agent-output-panel)
  :is(p,li,span,small,dt,dd,label,.meta,.muted,.subtitle,.desc):not(.eyebrow):not(option){
  color:var(--v8420-white-2) !important;
  -webkit-text-fill-color:var(--v8420-white-2) !important;
}
html body :is(.surface-dark-card,.card--dark,.panel--dark,.agent-card,.v83-repro-card,.v91-sim-card,.agent-output-panel)
  a:not(.btn):not(.button):not([class*="btn"]){
  color:var(--v8420-cyan-2) !important;
  -webkit-text-fill-color:var(--v8420-cyan-2) !important;
}

/* 3. Superficies claras reales: texto oscuro estable */
html body :is(.surface-light,.section-light,.light-section,.observatory-lab-section,.surface-light-card,.card--light,.panel--light,.v83-proof-panel,.v83-proof-list div,.citation-output,.quote-box,.source-box,.notice-box,.learning-mode-panel,.assessment-panel,.assessment-question,.assessment-rubric,.physics-validation-panel,.scientific-report-tools,.sim-pointer-hint-pro,.v93-citation-box,.contact-clean-form-card,.contact-clean-info-card,.contact-form-card,.publication-card,.data-card){
  background:linear-gradient(180deg,var(--v8420-light) 0%,var(--v8420-light-2) 100%) !important;
  border-color:var(--v8420-line-light) !important;
  color:var(--v8420-ink) !important;
  -webkit-text-fill-color:initial !important;
}
html body :is(.surface-light,.section-light,.light-section,.observatory-lab-section,.surface-light-card,.card--light,.panel--light,.v83-proof-panel,.v83-proof-list div,.citation-output,.quote-box,.source-box,.notice-box,.learning-mode-panel,.assessment-panel,.assessment-question,.assessment-rubric,.physics-validation-panel,.scientific-report-tools,.sim-pointer-hint-pro,.v93-citation-box,.contact-clean-form-card,.contact-clean-info-card,.contact-form-card,.publication-card,.data-card)
  :is(h1,h2,h3,h4,h5,h6,strong,b,dt,th,.title){
  color:var(--v8420-ink) !important;
  -webkit-text-fill-color:var(--v8420-ink) !important;
}
html body :is(.surface-light,.section-light,.light-section,.observatory-lab-section,.surface-light-card,.card--light,.panel--light,.v83-proof-panel,.v83-proof-list div,.citation-output,.quote-box,.source-box,.notice-box,.learning-mode-panel,.assessment-panel,.assessment-question,.assessment-rubric,.physics-validation-panel,.scientific-report-tools,.sim-pointer-hint-pro,.v93-citation-box,.contact-clean-form-card,.contact-clean-info-card,.contact-form-card,.publication-card,.data-card)
  :is(p,li,span,small,dd,label,.meta,.muted,.subtitle,.desc):not(.eyebrow):not(option){
  color:var(--v8420-ink-2) !important;
  -webkit-text-fill-color:var(--v8420-ink-2) !important;
}
html body :is(.surface-light,.section-light,.light-section,.observatory-lab-section,.surface-light-card,.card--light,.panel--light,.v83-proof-panel,.v83-proof-list div,.citation-output,.quote-box,.source-box,.notice-box,.learning-mode-panel,.assessment-panel,.assessment-question,.assessment-rubric,.physics-validation-panel,.scientific-report-tools,.sim-pointer-hint-pro,.v93-citation-box,.contact-clean-form-card,.contact-clean-info-card,.contact-form-card,.publication-card,.data-card)
  a:not(.btn):not(.button):not([class*="btn"]){
  color:#005EA8 !important;
  -webkit-text-fill-color:#005EA8 !important;
}

/* 4. Tarjetas genéricas dentro de secciones oscuras: heredan superficie oscura, salvo si fueron marcadas claras */
html body :is(.section-dark,.surface-dark,.agent-lab-section,.v83-repro-section) 
  :is(.card,.panel,.box,.tile,.item-card,.info-card,.feature-card,.mini-panel,.summary-card,.metric-card,.report-card):not(.surface-light-card):not(.card--light):not(.panel--light):not(.v83-proof-panel):not(.citation-output):not(.quote-box):not(.source-box):not(.notice-box):not(.scientific-assistant--v9){
  background:linear-gradient(180deg,var(--v8420-dark-card) 0%,var(--v8420-dark-card-2) 100%) !important;
  border:1.5px solid var(--v8420-line-dark) !important;
  color:var(--v8420-white-2) !important;
  -webkit-text-fill-color:initial !important;
}
html body :is(.section-dark,.surface-dark,.agent-lab-section,.v83-repro-section) 
  :is(.card,.panel,.box,.tile,.item-card,.info-card,.feature-card,.mini-panel,.summary-card,.metric-card,.report-card):not(.surface-light-card):not(.card--light):not(.panel--light):not(.v83-proof-panel):not(.citation-output):not(.quote-box):not(.source-box):not(.notice-box):not(.scientific-assistant--v9)
  :is(h1,h2,h3,h4,h5,h6,strong,b,.title){
  color:var(--v8420-white) !important;
  -webkit-text-fill-color:var(--v8420-white) !important;
}
html body :is(.section-dark,.surface-dark,.agent-lab-section,.v83-repro-section) 
  :is(.card,.panel,.box,.tile,.item-card,.info-card,.feature-card,.mini-panel,.summary-card,.metric-card,.report-card):not(.surface-light-card):not(.card--light):not(.panel--light):not(.v83-proof-panel):not(.citation-output):not(.quote-box):not(.source-box):not(.notice-box):not(.scientific-assistant--v9)
  :is(p,li,span,small,dt,dd,label,.meta,.muted,.subtitle,.desc):not(.eyebrow):not(option){
  color:var(--v8420-white-2) !important;
  -webkit-text-fill-color:var(--v8420-white-2) !important;
}

/* 5. Formularios y selectores: campos de lectura claros; opciones visibles */
html body :is(input,select,textarea,pre,code,kbd,samp){
  background-color:#FFFFFF !important;
  color:var(--v8420-ink) !important;
  -webkit-text-fill-color:var(--v8420-ink) !important;
  border-color:var(--v8420-line-light) !important;
}
html body :is(input,select,textarea)::placeholder{
  color:#557798 !important;
  -webkit-text-fill-color:#557798 !important;
  opacity:1 !important;
}
html body select option,
html body select optgroup{
  background:#FFFFFF !important;
  color:var(--v8420-ink) !important;
  -webkit-text-fill-color:var(--v8420-ink) !important;
}
html body select option:checked,
html body select option[selected]{
  background:#D9F1FF !important;
  color:var(--v8420-ink) !important;
}

/* 6. Barra de idioma: estética propia, opciones legibles */
html body [data-i18n-select]{
  color-scheme:dark !important;
}
html body [data-i18n-select] option{
  background:#FFFFFF !important;
  color:var(--v8420-ink) !important;
  -webkit-text-fill-color:var(--v8420-ink) !important;
}

/* 7. Etiquetas blancas institucionales: un solo componente, texto oscuro */
html body :is(.eyebrow,.v91-eyebrow,.lab84-kicker,.lab84-badge,.badge-label,.section-badge,.pill-label):not(.is-dark):not(.dark){
  background:#FFFFFF !important;
  border:2px solid #58B8EA !important;
  color:var(--v8420-ink) !important;
  -webkit-text-fill-color:var(--v8420-ink) !important;
}
html body :is(.eyebrow,.v91-eyebrow,.lab84-kicker,.lab84-badge,.badge-label,.section-badge,.pill-label):not(.is-dark):not(.dark) *{
  color:inherit !important;
  -webkit-text-fill-color:inherit !important;
}

/* 8. Botones: texto visible en todos los fondos */
html body :is(button,.btn,.button,.v91-btn,.lab84-btn,[class*="btn"],[class*="button"]):not(.secondary):not(.btn-outline):not(.outline){
  color:#FFFFFF !important;
  -webkit-text-fill-color:#FFFFFF !important;
}
html body :is(.secondary,.btn-outline,.button-outline,.outline,.lab84-btn.secondary){
  color:var(--v8420-ink) !important;
  -webkit-text-fill-color:var(--v8420-ink) !important;
  background:#FFFFFF !important;
}

/* 9. Tablas: encabezados y celdas siempre legibles */
html body table{
  background:#FFFFFF !important;
}
html body :is(table,thead,tbody,tr,td,th){
  color:var(--v8420-ink) !important;
  -webkit-text-fill-color:var(--v8420-ink) !important;
}
html body thead th{
  background:#E8F4FC !important;
  color:var(--v8420-ink) !important;
  -webkit-text-fill-color:var(--v8420-ink) !important;
}

/* 10. No recorte de texto ni paneles */
html body :is(.card,.panel,.box,.tile,.v91-sim-card,.v83-proof-panel,.v83-proof-list div,.lab84-card,.lab84-panel,.lab84-sim,.learning-mode-panel,.assessment-panel,.assessment-question,.physics-validation-panel,.scientific-report-tools){
  overflow:visible !important;
  max-height:none !important;
}

/* 11. Foco accesible */
html body :is(a,button,input,select,textarea,[tabindex]):focus-visible{
  outline:3px solid #8BD4FF !important;
  outline-offset:3px !important;
}
