/* LEGASIST · Revisión visual v2 · 12 octubre 2026.
   Capa exclusivamente CSS sobre los estilos existentes, incluida la capa
   visual anterior. Sin modificación de autenticación, pagos ni formularios.
   Regla: NO pintar textos blancos en tarjetas blancas ni fondos transparentes. */

/* Paleta cerrada de dos temas y variables heredadas de módulos. */
:root,
html:not([data-theme="royal-dark"]){
  color-scheme:light;
  --lg-canvas:#ffffff;--lg-paper:#ffffff;--lg-inset:#f4f8ff;
  --lg-heading:#0c4f9d;--lg-foreground:#121c2b;--lg-secondary:#42516a;
  --lg-header:#0e4d98;--lg-header-foreground:#ffffff;
  --lg-accent:#135eb5;--lg-accent-foreground:#ffffff;
  --lg-line:#cfdef0;--lg-shadow:0 9px 25px rgba(5,39,78,.06);
  --lg-blue-050:#ffffff;--lg-blue-100:#eaf3ff;--lg-blue-200:#d6e9ff;
  --bg:#ffffff!important;--bg-2:#ffffff!important;--surface:#ffffff!important;
  --surface-soft:#f4f8ff!important;--surface-blue:#eef5ff!important;
  --navy:#0c4f9d!important;--text:#121c2b!important;--muted:#42516a!important;
  --primary:#135eb5!important;--primary-2:#135eb5!important;
  --border:#cfdef0!important;--border-strong:#a9c3e0!important;
  --law-ink:#121c2b!important;--law-panel:#ffffff!important;
  --law-panel-soft:#f4f8ff!important;--law-blue:#0c4f9d!important;
  --law-blue-2:#135eb5!important;--law-muted:#42516a!important;
  --login-bg:#ffffff!important;--login-card:#ffffff!important;
  --login-text:#121c2b!important;--login-muted:#42516a!important;
  --login-soft:#eff5fc!important;--login-primary:#135eb5!important;
  --dash-bg:#ffffff!important;--dash-surface:#ffffff!important;
  --dash-surface-2:#f4f8ff!important;--dash-text:#121c2b!important;
  --dash-muted:#42516a!important;--dash-line:#cfdef0!important;
  --dash-primary:#135eb5!important;--ls-surface:#ffffff!important;
  --ls-surface-2:#f4f8ff!important;--ls-text:#121c2b!important;
  --ls-muted:#42516a!important;
}
html[data-theme="royal-dark"]{
  color-scheme:dark!important;
  --lg-canvas:#071a34;--lg-paper:#102b4c;--lg-inset:#0b2341;
  --lg-heading:#ffffff;--lg-foreground:#f6faff;--lg-secondary:#d4e5f6;
  --lg-header:#06162e;--lg-header-foreground:#ffffff;
  --lg-accent:#2d78bf;--lg-accent-foreground:#ffffff;
  --lg-line:#335879;--lg-shadow:0 9px 25px rgba(0,0,0,.12);
  --lg-blue-050:#071a34;--lg-blue-100:#173a5f;--lg-blue-200:#264b72;
  --bg:#071a34!important;--bg-2:#071a34!important;
  --surface:#102b4c!important;--surface-soft:#0b2341!important;
  --surface-blue:#173a5f!important;
  --navy:#ffffff!important;--text:#f6faff!important;--muted:#d4e5f6!important;
  --primary:#a8d8ff!important;--primary-2:#9fd2ff!important;
  --border:#335879!important;--border-strong:#557b9d!important;
  --law-ink:#f6faff!important;--law-panel:#102b4c!important;
  --law-panel-soft:#0b2341!important;--law-blue:#a8d8ff!important;
  --law-blue-2:#a8d8ff!important;--law-muted:#d4e5f6!important;
  --login-bg:#071a34!important;--login-card:#102b4c!important;
  --login-text:#f6faff!important;--login-muted:#d4e5f6!important;
  --login-soft:#18395d!important;--login-primary:#a8d8ff!important;
  --dash-bg:#071a34!important;--dash-surface:#102b4c!important;
  --dash-surface-2:#0b2341!important;--dash-text:#f6faff!important;
  --dash-muted:#d4e5f6!important;--dash-line:#335879!important;
  --dash-primary:#a8d8ff!important;--ls-surface:#102b4c!important;
  --ls-surface-2:#0b2341!important;--ls-text:#f6faff!important;
  --ls-muted:#d4e5f6!important;
}

/* Superficie real de todas las pantallas: se eliminan gradientes grises
   residuales del login, del alta profesional y de las vistas internas. */
html:not([data-theme="royal-dark"]) body,
html:not([data-theme="royal-dark"]) body.login-role-page,
html:not([data-theme="royal-dark"]) body.login-role-page.login-role-abogado,
html:not([data-theme="royal-dark"]) body.lawyer-register-premium,
html:not([data-theme="royal-dark"]) body.flow-lawyer,
html:not([data-theme="royal-dark"]) body.directory-page,
html:not([data-theme="royal-dark"]) body.dashboard-body,
html:not([data-theme="royal-dark"]) body.dash-page,
html:not([data-theme="royal-dark"]) body.search-lawyer-page,
html:not([data-theme="royal-dark"]) body.registration-page,
html:not([data-theme="royal-dark"]) body.legasist-tool-body,
html:not([data-theme="royal-dark"]) main.funnel-main,
html:not([data-theme="royal-dark"]) .lawyer-login-stage,
html:not([data-theme="royal-dark"]) .directory-section,
html:not([data-theme="royal-dark"]) .law-section,
html:not([data-theme="royal-dark"]) .law-hero{
  background:#ffffff!important;color:#121c2b!important;
}
html[data-theme="royal-dark"] body,
html[data-theme="royal-dark"] body.login-role-page,
html[data-theme="royal-dark"] body.login-role-page.login-role-abogado,
html[data-theme="royal-dark"] body.lawyer-register-premium,
html[data-theme="royal-dark"] body.flow-lawyer,
html[data-theme="royal-dark"] body.directory-page,
html[data-theme="royal-dark"] body.dashboard-body,
html[data-theme="royal-dark"] body.dash-page,
html[data-theme="royal-dark"] body.search-lawyer-page,
html[data-theme="royal-dark"] body.registration-page,
html[data-theme="royal-dark"] body.legasist-tool-body,
html[data-theme="royal-dark"] main.funnel-main,
html[data-theme="royal-dark"] .lawyer-login-stage,
html[data-theme="royal-dark"] .directory-section,
html[data-theme="royal-dark"] .law-section,
html[data-theme="royal-dark"] .law-hero{
  background:#071a34!important;color:#f6faff!important;
}
/* El pseudo-fondo anterior ensombrecía el registro, aun con body blanco. */
html body.login-role-page.login-role-abogado::before,
html body.login-role-page.login-role-abogado::after,
html body.lawyer-register-premium::before,
html body.lawyer-register-premium::after{
  content:none!important;display:none!important;box-shadow:none!important;
}
html body.login-role-page.login-role-abogado,
html body.lawyer-register-premium{isolation:auto!important}

/* Cabeceras y menús: azul sólido + texto blanco, incluido el logo azul original. */
html:not([data-theme="royal-dark"]) :is(.topbar,.nav,.law-topbar,.dash-topbar),
html:not([data-theme="royal-dark"]) body.lawyer-register-premium .law-topbar,
html:not([data-theme="royal-dark"]) body.login-role-page.login-role-abogado .topbar{
  background:#0e4d98!important;color:#ffffff!important;
  border-color:#0a407f!important;box-shadow:0 5px 16px rgba(10,52,99,.10)!important;
  backdrop-filter:none!important;
}
html[data-theme="royal-dark"] :is(.topbar,.nav,.law-topbar,.dash-topbar),
html[data-theme="royal-dark"] body.lawyer-register-premium .law-topbar,
html[data-theme="royal-dark"] body.login-role-page.login-role-abogado .topbar{
  background:#06162e!important;color:#ffffff!important;
  border-color:#335879!important;box-shadow:0 5px 16px rgba(0,0,0,.14)!important;
  backdrop-filter:none!important;
}
html :is(.topbar,.nav,.law-topbar,.dash-topbar) :is(h1,h2,h3,h4,p,small,span,b,strong),
html body.lawyer-register-premium .law-topbar :is(p,span,b,strong){color:#ffffff!important}
html :is(.topbar,.nav,.law-topbar,.dash-topbar) :is(.nav-links>a:not(.button),.law-nav>a:not(.law-btn),.nav>a:not(.button),.dash-topbar a:not(.button)){
  color:#ffffff!important;background:transparent!important;border-color:transparent!important;
}
html :is(.topbar,.nav,.law-topbar,.dash-topbar) :is(.nav-links>a:not(.button),.law-nav>a:not(.law-btn),.dash-topbar a:not(.button)):hover,
html :is(.topbar,.nav,.law-topbar,.dash-topbar) :is(.nav-links>a:not(.button),.law-nav>a:not(.law-btn),.dash-topbar a:not(.button)):focus-visible{
  background:#1e68b2!important;color:#ffffff!important;
}
html :is(.topbar,.nav,.law-topbar,.dash-topbar) :is(img.brand-logo-img,img.law-brand__logo),
html :is(.topbar,.nav,.law-topbar,.dash-topbar) a.law-brand img{
  filter:brightness(0) invert(1)!important;opacity:1!important;
}
html:not([data-theme="royal-dark"]) :is(.topbar,.nav,.law-topbar) :is(.button.primary,.law-btn--primary,.register-visible-link),
html[data-theme="royal-dark"] :is(.topbar,.nav,.law-topbar) :is(.button.primary,.law-btn--primary,.register-visible-link){
  background:#216dc1!important;color:#ffffff!important;border:1px solid #77a9e6!important;
  box-shadow:none!important;
}
/* El botón blanco no puede tener letras blancas (pantalla de inicio). */
html :is(.topbar,.nav,.law-topbar) :is(.button.ghost,.button.secondary,.law-btn--ghost,.mini-button){
  background:#ffffff!important;color:#0a468b!important;border:1px solid #b7d1ee!important;
}
html :is(.topbar,.nav,.law-topbar) :is(.button.ghost,.button.secondary,.law-btn--ghost,.mini-button) :is(span,b,strong){
  color:#0a468b!important;
}
html :is(.topbar,.nav,.law-topbar) :is(.button.primary,.law-btn--primary,.register-visible-link) :is(span,b,strong){color:#ffffff!important}
/* Algunos contenedores blancos del encabezado ocultan un botón sin texto. */
html :is(.topbar,.law-topbar) :is(.nav-links,.law-nav){background:transparent!important}

/* Jerarquía tipográfica: títulos azules sobre blanco, todos blancos sobre azul marino. */
html:not([data-theme="royal-dark"]) :is(h1,h2,h3,h4,h5,h6){color:#0c4f9d!important;font-weight:800!important}
html[data-theme="royal-dark"] :is(h1,h2,h3,h4,h5,h6){color:#ffffff!important;font-weight:800!important}
html:not([data-theme="royal-dark"]) :is(p,li,dt,dd,blockquote,summary,legend){color:#121c2b}
html[data-theme="royal-dark"] :is(p,li,dt,dd,blockquote,summary,legend){color:#f6faff!important}
html:not([data-theme="royal-dark"]) :is(.muted,.text-muted,.hint,.field-help,.helper,.subtitle,.meta,.form-hint){color:#42516a!important}
html[data-theme="royal-dark"] :is(.muted,.text-muted,.hint,.field-help,.helper,.subtitle,.meta,.form-hint){color:#d4e5f6!important}
html:not([data-theme="royal-dark"]) :is(label,legend,.form-label,.login-field small){color:#121c2b!important}
html[data-theme="royal-dark"] :is(label,legend,.form-label,.login-field small){color:#f6faff!important}

/* Superficies claras y oscuras de tarjetas con fondos OPACOS. La tipografía
   utiliza reglas temáticas explícitas para que la descendencia sea legible. */
html:not([data-theme="royal-dark"]) :is(
  .panel,.card,.form-card,.form-panel,.form-section,.login-card,.register-card,.profile-card,
  .result-card,.role-card,.plan-card,.plans-panel,.payment-panel,.order-panel,.bill-card,
  .receipt,.receipt-body,.receipt-item,.history-row,.registration-card,.support-card,
  .support-control-card,.calendar-card,.calendar-week,.calendar-side-panel,.meet-panel,
  .modal,.modal-card,.dialog-card,.box,.info-card,.tool-card,.law-card,.plan-mini,
  .order-feature,.profile-choice,.privacy-content,.rating-summary,.list-item,.note-card,
  .file-card,.scanner-card,.source-card,.chat-bubble,.message-bubble,.payment-tabpanel,
  .manual-payment-step,.payment-method-note,.brand-strip,.search-panel,.trust-card,
  .hero-metrics,.hero-metrics>div,.trust-features>div,.law-preview,.preview-profile,
  .preview-stat,.guard-card,.step-card,.lawyer-card,.review-card,.favorite-card,
  .search-summary-card,.legal-card,.create-card,.table-panel,.kpi,.note-store-card,
  .quick-compose,.scan-card,.sheet-card,.agenda-card,.spreadsheet-card,.security-pill,
  .sheet-case-card,.google-btn,.declaration,.terms-box,.lawyer-login-form-panel,
  .login-input-wrap,.lawyer-register-box,.funnel-layout,.card-box,.search-card,
  .nav-card,.registration-wrapper,.registration-panel,.faq-item,.contacto-info){
  background-color:#ffffff!important;border-color:#cfdef0!important;color:#121c2b!important;
}
html[data-theme="royal-dark"] :is(
  .panel,.card,.form-card,.form-panel,.form-section,.login-card,.register-card,.profile-card,
  .result-card,.role-card,.plan-card,.plans-panel,.payment-panel,.order-panel,.bill-card,
  .receipt,.receipt-body,.receipt-item,.history-row,.registration-card,.support-card,
  .support-control-card,.calendar-card,.calendar-week,.calendar-side-panel,.meet-panel,
  .modal,.modal-card,.dialog-card,.box,.info-card,.tool-card,.law-card,.plan-mini,
  .order-feature,.profile-choice,.privacy-content,.rating-summary,.list-item,.note-card,
  .file-card,.scanner-card,.source-card,.chat-bubble,.message-bubble,.payment-tabpanel,
  .manual-payment-step,.payment-method-note,.brand-strip,.search-panel,.trust-card,
  .hero-metrics,.hero-metrics>div,.trust-features>div,.law-preview,.preview-profile,
  .preview-stat,.guard-card,.step-card,.lawyer-card,.review-card,.favorite-card,
  .search-summary-card,.legal-card,.create-card,.table-panel,.kpi,.note-store-card,
  .quick-compose,.scan-card,.sheet-card,.agenda-card,.spreadsheet-card,.security-pill,
  .sheet-case-card,.google-btn,.declaration,.terms-box,.lawyer-login-form-panel,
  .login-input-wrap,.lawyer-register-box,.funnel-layout,.card-box,.search-card,
  .nav-card,.registration-wrapper,.registration-panel,.faq-item,.contacto-info){
  background:#102b4c!important;border-color:#335879!important;color:#f6faff!important;
}
/* Titulares y textos intermedios que los CSS previos pintaban de blanco
   indiscriminadamente en tarjetas blancas. */
html:not([data-theme="royal-dark"]) :is(.search-panel,.trust-card,.hero-metrics,.trust-features,.form-section,.lawyer-login-form-panel,.law-preview,.guard-card,.step-card,.card,.panel,.payment-panel,.order-panel,.bill-card,.register-card,.profile-choice,.modal,.support-card,.faq-item)
  :is(h1,h2,h3,h4,h5,h6,b,strong,label,span,small,p,li,div:not([class]),legend){color:#121c2b!important}
html:not([data-theme="royal-dark"]) :is(.search-panel,.trust-card,.hero-metrics,.trust-features,.form-section,.lawyer-login-form-panel,.law-preview,.guard-card,.step-card,.card,.panel,.payment-panel,.order-panel,.bill-card,.register-card,.profile-choice,.modal,.support-card,.faq-item)
  :is(h1,h2,h3,h4,h5,h6){color:#0c4f9d!important}
html[data-theme="royal-dark"] :is(.search-panel,.trust-card,.hero-metrics,.trust-features,.form-section,.lawyer-login-form-panel,.law-preview,.guard-card,.step-card,.card,.panel,.payment-panel,.order-panel,.bill-card,.register-card,.profile-choice,.modal,.support-card,.faq-item)
  :is(h1,h2,h3,h4,h5,h6,b,strong,label,span,small,p,li,legend){color:#f6faff!important}

/* HOMEPAGE / directorio: se elimina el hero gris/azul degradado y sus textos
   blancos sin fondo. Las tarjetas vuelven a ser blancas con texto oscuro. */
html:not([data-theme="royal-dark"]) body.directory-page .directory-hero{
  background:#ffffff!important;color:#121c2b!important;
  min-height:auto!important;overflow:visible!important;
}
html[data-theme="royal-dark"] body.directory-page .directory-hero{
  background:#071a34!important;color:#f6faff!important;
  min-height:auto!important;overflow:visible!important;
}
html body.directory-page .directory-hero::before,
html body.directory-page .directory-hero::after{content:none!important;display:none!important}
html:not([data-theme="royal-dark"]) .directory-hero__copy :is(h1,h1 span,.lead,p,.kicker){
  color:#0c4f9d!important;text-shadow:none!important;
}
html:not([data-theme="royal-dark"]) .directory-hero__copy :is(.lead,p){color:#121c2b!important}
html[data-theme="royal-dark"] .directory-hero__copy :is(h1,h1 span,.lead,p,.kicker){
  color:#ffffff!important;text-shadow:none!important;
}
html:not([data-theme="royal-dark"]) .directory-hero :is(.search-panel,.trust-card,.hero-metrics,.hero-metrics>div,.trust-features>div){
  background:#ffffff!important;background-image:none!important;
  border:1px solid #cfdef0!important;backdrop-filter:none!important;
}
html[data-theme="royal-dark"] .directory-hero :is(.search-panel,.trust-card,.hero-metrics,.hero-metrics>div,.trust-features>div){
  background:#102b4c!important;background-image:none!important;
  border:1px solid #335879!important;backdrop-filter:none!important;
}
html:not([data-theme="royal-dark"]) .directory-hero :is(.search-panel,.trust-panel,.trust-card,.hero-metrics,.trust-features)
  :is(h1,h2,h3,h4,small,span,div,strong,b,label,.trust-label,.search-field>span){
  color:#121c2b!important;text-shadow:none!important;
}
html:not([data-theme="royal-dark"]) .directory-hero .trust-card h2{color:#0c4f9d!important}
html[data-theme="royal-dark"] .directory-hero :is(.search-panel,.trust-panel,.trust-card,.hero-metrics,.trust-features)
  :is(h1,h2,h3,h4,small,span,div,strong,b,label,.trust-label,.search-field>span){
  color:#f6faff!important;text-shadow:none!important;
}
html:not([data-theme="royal-dark"]) .directory-chips a{
  background:#f4f8ff!important;border:1px solid #cfdef0!important;color:#0c4f9d!important;
}
html[data-theme="royal-dark"] .directory-chips a{
  background:#173a5f!important;border:1px solid #335879!important;color:#ffffff!important;
}

/* LOGIN PROFESIONAL: fuera el negro/gris de imagen y body; en su lugar, blanco
   general y bloque de acceso AZUL institucional con texto inequívoco. */
html:not([data-theme="royal-dark"]) body.login-role-page.login-role-abogado .lawyer-login-card{
  background:#ffffff!important;border:1px solid #cfdef0!important;
  box-shadow:0 18px 42px rgba(8,53,108,.12)!important;
}
html:not([data-theme="royal-dark"]) body.login-role-page.login-role-abogado .lawyer-login-copy.lawyer-login-image-only{
  background:#0e4d98!important;background-image:none!important;color:#ffffff!important;
}
html[data-theme="royal-dark"] body.login-role-page.login-role-abogado .lawyer-login-card{
  background:#102b4c!important;border:1px solid #335879!important;
  box-shadow:0 18px 42px rgba(0,0,0,.22)!important;
}
html[data-theme="royal-dark"] body.login-role-page.login-role-abogado .lawyer-login-copy.lawyer-login-image-only{
  background:#09264a!important;background-image:none!important;color:#ffffff!important;
}
html body.login-role-page.login-role-abogado .lawyer-login-copy.lawyer-login-image-only::before,
html body.login-role-page.login-role-abogado .lawyer-login-copy.lawyer-login-image-only::after{
  content:none!important;display:none!important;
}
html body.login-role-page.login-role-abogado .lawyer-access-message,
html body.login-role-page.login-role-abogado .lawyer-access-message :is(span,strong){
  color:#ffffff!important;text-shadow:none!important;
}
html body.login-role-page.login-role-abogado .lawyer-access-message strong{
  font-size:clamp(1.65rem,3.15vw,3.1rem)!important;line-height:1.14!important;
}
html:not([data-theme="royal-dark"]) body.login-role-page.login-role-abogado .lawyer-login-form-panel{
  background:#ffffff!important;color:#121c2b!important;
}
html[data-theme="royal-dark"] body.login-role-page.login-role-abogado .lawyer-login-form-panel{
  background:#102b4c!important;color:#f6faff!important;
}
html:not([data-theme="royal-dark"]) .lawyer-login-form-panel :is(.login-kicker,.register-redirect){
  background:#f4f8ff!important;color:#0c4f9d!important;border-color:#cfdef0!important;
}
html[data-theme="royal-dark"] .lawyer-login-form-panel :is(.login-kicker,.register-redirect){
  background:#173a5f!important;color:#f6faff!important;border-color:#335879!important;
}
html:not([data-theme="royal-dark"]) .lawyer-login-form-panel .register-redirect :is(b,strong,span,p){color:#121c2b!important}
html[data-theme="royal-dark"] .lawyer-login-form-panel .register-redirect :is(b,strong,span,p){color:#f6faff!important}
html:not([data-theme="royal-dark"]) .lawyer-login-form-panel h2{color:#0c4f9d!important}
html[data-theme="royal-dark"] .lawyer-login-form-panel h2{color:#ffffff!important}

/* Registro profesional y planes: fondo blanco sin velo gris, títulos azules. */
html:not([data-theme="royal-dark"]) body.lawyer-register-premium :is(.funnel-main,.funnel-layout,.form-section,.registration-panel){
  background:#ffffff!important;color:#121c2b!important;
}
html[data-theme="royal-dark"] body.lawyer-register-premium :is(.funnel-main,.funnel-layout,.form-section,.registration-panel){
  background:#102b4c!important;color:#f6faff!important;
}
html:not([data-theme="royal-dark"]) body.lawyer-register-premium .funnel-head{
  background:#0e4d98!important;border-color:#0a407f!important;color:#ffffff!important;
}
html[data-theme="royal-dark"] body.lawyer-register-premium .funnel-head{
  background:#09264a!important;border-color:#335879!important;color:#ffffff!important;
}
html body.lawyer-register-premium .funnel-head :is(h1,h2,span,p){color:#ffffff!important}
html:not([data-theme="royal-dark"]) body.lawyer-register-premium :is(.stepper,.flow-footer){
  background:#ffffff!important;color:#121c2b!important;border-color:#cfdef0!important;
}
html[data-theme="royal-dark"] body.lawyer-register-premium :is(.stepper,.flow-footer){
  background:#102b4c!important;color:#f6faff!important;border-color:#335879!important;
}
html:not([data-theme="royal-dark"]) .form-section__title h2{color:#0c4f9d!important}
html[data-theme="royal-dark"] .form-section__title h2{color:#ffffff!important}

/* CTA y paneles deliberadamente azules: blanco sobre azul en AMBOS temas. */
html:not([data-theme="royal-dark"]) :is(.professional-cta__inner,.registration-intro,.welcome-card,.register-banner,.receipt-head,.law-final,.funnel-side--formal),
html:not([data-theme="royal-dark"]) body.lawyer-register-premium .register-banner{
  background:#0e4d98!important;color:#ffffff!important;border-color:#0e4d98!important;
}
html[data-theme="royal-dark"] :is(.professional-cta__inner,.registration-intro,.welcome-card,.register-banner,.receipt-head,.law-final,.funnel-side--formal),
html[data-theme="royal-dark"] body.lawyer-register-premium .register-banner{
  background:#103964!important;color:#ffffff!important;border-color:#335879!important;
}
html :is(.professional-cta__inner,.registration-intro,.welcome-card,.register-banner,.receipt-head,.law-final,.funnel-side--formal)
 :is(h1,h2,h3,h4,p,b,strong,small,span,li){color:#ffffff!important}
/* Los botones secundarios blancos dentro de banners retienen texto azul. */
html :is(.professional-cta__inner,.registration-intro,.welcome-card,.register-banner,.receipt-head,.law-final,.funnel-side--formal)
 :is(.button.ghost,.button.secondary,.law-btn--ghost,.btn.secondary){
  background:#ffffff!important;color:#0a468b!important;border-color:#ffffff!important;
}
html :is(.professional-cta__inner,.registration-intro,.welcome-card,.register-banner,.receipt-head,.law-final,.funnel-side--formal)
 :is(.button.ghost,.button.secondary,.law-btn--ghost,.btn.secondary) :is(span,b,strong){color:#0a468b!important}

/* Formularios, selectores y estados: contraste explícito también en autocompletado. */
html:not([data-theme="royal-dark"]) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,[contenteditable="true"]){
  background:#ffffff!important;color:#121c2b!important;
  border-color:#a9c3e0!important;-webkit-text-fill-color:#121c2b;
}
html[data-theme="royal-dark"] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,[contenteditable="true"]){
  background:#08213e!important;color:#ffffff!important;
  border-color:#507aa0!important;-webkit-text-fill-color:#ffffff;
}
html:not([data-theme="royal-dark"]) :is(input,textarea)::placeholder{color:#607b9e!important;opacity:1!important}
html[data-theme="royal-dark"] :is(input,textarea)::placeholder{color:#b8d2e8!important;opacity:1!important}
html:not([data-theme="royal-dark"]) select option{background:#ffffff!important;color:#121c2b!important}
html[data-theme="royal-dark"] select option{background:#102b4c!important;color:#ffffff!important}
html:not([data-theme="royal-dark"]) :is(input,textarea):-webkit-autofill{
  -webkit-box-shadow:0 0 0 1000px #eaf3ff inset!important;
  -webkit-text-fill-color:#121c2b!important;
}
html[data-theme="royal-dark"] :is(input,textarea):-webkit-autofill{
  -webkit-box-shadow:0 0 0 1000px #123355 inset!important;
  -webkit-text-fill-color:#ffffff!important;
}
/* Evitar que un icono superpuesto tape el texto del password. */
html .password-field input{padding-right:65px!important}
html:not([data-theme="royal-dark"]) :is(.login-button,.search-submit,button[type="submit"]:not(.ghost):not(.secondary),.button.primary,.law-btn--primary,.dash-btn.primary,.btn.primary,input[type="submit"]){
  background:#135eb5!important;color:#ffffff!important;border-color:#135eb5!important;
}
html[data-theme="royal-dark"] :is(.login-button,.search-submit,button[type="submit"]:not(.ghost):not(.secondary),.button.primary,.law-btn--primary,.dash-btn.primary,.btn.primary,input[type="submit"]){
  background:#286caa!important;color:#ffffff!important;border-color:#71acd9!important;
}
html :is(.login-button,.search-submit,button[type="submit"]:not(.ghost):not(.secondary),.button.primary,.law-btn--primary,.dash-btn.primary,.btn.primary,input[type="submit"]) :is(span,b,strong,svg){color:#ffffff!important}
html:not([data-theme="royal-dark"]) :is(.mini-button,.password-toggle,.button.secondary,.btn.secondary,.law-btn--ghost,.dash-btn:not(.primary)){
  background:#f4f8ff!important;color:#0c4f9d!important;border-color:#c5d8ed!important;
}
html[data-theme="royal-dark"] :is(.mini-button,.password-toggle,.button.secondary,.btn.secondary,.law-btn--ghost,.dash-btn:not(.primary)){
  background:#173a5f!important;color:#f6faff!important;border-color:#507aa0!important;
}
html :is(.login-input-wrap svg,.login-input-wrap .ui-icon){color:var(--lg-secondary)!important}
html :is(.login-button,.search-submit,.law-btn--primary,.button.primary,.btn.primary){font-weight:750!important}

/* Pagos, tablas y lectores deben ofrecer blancos reales en claro y azules
   sólidos en oscuro, con distinción visible entre filas y encabezados. */
html:not([data-theme="royal-dark"]) :is(.bill-kv,.history-row,.receipt-item,.manual-payment-step,.payment-layout,.payment-method-note,.calendar-shell,.agenda-shell,.hour-cell,.day-cell,.week-grid){
  background-color:#ffffff!important;color:#121c2b!important;border-color:#cfdef0!important;
}
html[data-theme="royal-dark"] :is(.bill-kv,.history-row,.receipt-item,.manual-payment-step,.payment-layout,.payment-method-note,.calendar-shell,.agenda-shell,.hour-cell,.day-cell,.week-grid){
  background:#102b4c!important;color:#f6faff!important;border-color:#335879!important;
}
html:not([data-theme="royal-dark"]) :is(thead,thead th,.week-head){background:#eaf3ff!important;color:#0c4f9d!important}
html[data-theme="royal-dark"] :is(table,thead,thead th,tbody,tbody tr,td,th,.week-head){
  background:#102b4c!important;color:#f6faff!important;border-color:#335879!important;
}
html[data-theme="royal-dark"] tbody tr:hover td{background:#173a5f!important}
html:not([data-theme="royal-dark"]) :is(.calendar-notice,.transcript-box,.mini-calendar span,.payment-method-note,.manual-payment-step){background-color:#f4f8ff!important;color:#121c2b!important}
html[data-theme="royal-dark"] :is(.calendar-notice,.transcript-box,.mini-calendar span,.payment-method-note,.manual-payment-step){background:#102b4c!important;color:#f6faff!important}

/* Footer sin choque cromático (logos sin invertir sobre blanco). */
html:not([data-theme="royal-dark"]) :is(footer,.footer,.law-footer,.flow-footer,.directory-footer){
  background:#ffffff!important;color:#121c2b!important;border-color:#cfdef0!important;
}
html[data-theme="royal-dark"] :is(footer,.footer,.law-footer,.flow-footer,.directory-footer){
  background:#06162e!important;color:#f6faff!important;border-color:#335879!important;
}
html:not([data-theme="royal-dark"]) :is(footer,.footer,.law-footer,.flow-footer) :is(a,p,span,small,b,strong){color:#121c2b!important}
html:not([data-theme="royal-dark"]) :is(footer,.footer,.law-footer,.flow-footer) a:not(.law-btn):not(.button){color:#0c4f9d!important}
html[data-theme="royal-dark"] :is(footer,.footer,.law-footer,.flow-footer) :is(a,p,span,small,b,strong){color:#ffffff!important}
html:not([data-theme="royal-dark"]) :is(footer,.footer,.law-footer,.flow-footer) :is(img.brand-logo-img,img.law-brand__logo){filter:none!important}
html[data-theme="royal-dark"] :is(footer,.footer,.law-footer,.flow-footer) :is(img.brand-logo-img,img.law-brand__logo){filter:brightness(0) invert(1)!important}

/* No sustituir los logotipos de Openpay, Visa, Mastercard y bancos. */
html :is(.payment-brands,.brand-strip__cards,.brand-strip__left,.openpay-trust) img{filter:none!important}
/* Los iconos SVG de interfaz heredan el color de su contexto. */
html :is(.ui-icon,.lg-legal-icon){fill:none;stroke:currentColor}
/* Estados de foco, campos requeridos y mensajes semánticos se preservan. */
html :is(a,button,input,textarea,select,[tabindex]):focus-visible{
  outline:3px solid #68bafa!important;outline-offset:2px!important;
}
html:not([data-theme="royal-dark"]) :is(.notice.error,.alert.err,.alert.error,.payment-status.error){background:#fff0f2!important;color:#9d1538!important;border-color:#efafbc!important}
html[data-theme="royal-dark"] :is(.notice.error,.alert.err,.alert.error,.payment-status.error){background:#472638!important;color:#ffe4ec!important;border-color:#94536a!important}
html:not([data-theme="royal-dark"]) :is(.notice.success,.alert.ok,.payment-status.ok){background:#e9faf0!important;color:#165639!important;border-color:#a2d8b6!important}
html[data-theme="royal-dark"] :is(.notice.success,.alert.ok,.payment-status.ok){background:#123b34!important;color:#d6ffeb!important;border-color:#3e7867!important}

/* Responsive: formularios y búsqueda no se desbordan. */
html :is(.container,.law-container,.funnel-main,.funnel-layout,.lawyer-login-card,.trust-panel,.search-grid,.registration-page .split-registration){max-width:100%}
html :is(.lawyer-login-card,.funnel-layout,.search-grid,.directory-hero__grid,.fields-grid,.form-grid,.payment-layout,.calendar-shell)>*{min-width:0}
html :is(input,select,textarea,.login-form,.login-input-wrap){min-width:0;max-width:100%}
html :is(.form-section,.support-card,.lawyer-login-form-panel,.search-panel){overflow-wrap:anywhere}
@media(max-width:1024px){
  html :is(.lawyer-login-card,.directory-hero__grid,.funnel-layout,.law-hero__grid){grid-template-columns:minmax(0,1fr)!important}
  html .lawyer-login-copy.lawyer-login-image-only{min-height:170px!important;padding:22px!important}
  html .lawyer-login-form-panel{padding:clamp(18px,4vw,32px)!important}
  html :is(.directory-hero,.law-hero){min-height:auto!important}
}
@media(max-width:760px){
  html :is(.search-grid,.fields-grid,.form-grid,.login-form,.lawyer-login-form,.hero-metrics,.lawyer-grid,.steps-grid,.reviews-grid,.specialty-grid,.cities-grid){grid-template-columns:minmax(0,1fr)!important}
  html :is(.topbar__inner,.law-topbar__inner){flex-wrap:wrap!important;gap:8px!important;padding-block:10px!important}
  html :is(.nav-links,.law-nav){max-width:100%;gap:5px!important;flex-wrap:wrap!important}
  html :is(.nav-links a,.law-nav a){font-size:.75rem!important;min-height:34px!important;padding:7px 9px!important}
  html .lawyer-login-stage{padding:18px 10px 30px!important}
  html .lawyer-login-card{border-radius:18px!important}
  html .lawyer-login-copy.lawyer-login-image-only{min-height:144px!important}
  html .lawyer-access-message strong{font-size:clamp(1.45rem,5vw,2.2rem)!important}
  html :is(.directory-hero,.law-hero){padding-block:34px!important}
  html :is(.search-panel,.trust-card,.form-section,.lawyer-login-form-panel){padding:clamp(14px,3vw,22px)!important}
}
@media(max-width:420px){
  html :is(.container,.law-container){width:calc(100% - 20px)!important}
  html .lawyer-login-card{width:100%!important}
  html :is(.button,.btn,.law-btn,.dash-btn,button[type="submit"]){white-space:normal!important;max-width:100%}
}
@media print{
  html,html[data-theme="royal-dark"],html body,html[data-theme="royal-dark"] body{color-scheme:light!important;background:#fff!important;color:#111!important}
  html[data-theme="royal-dark"] :is(.receipt,.receipt-head,.receipt-body,.receipt-item,.manual-payment-step,.bill-card,.privacy-content,.payment-panel,.order-panel){background:#fff!important;color:#111!important;border-color:#bbb!important}
  html[data-theme="royal-dark"] :is(.receipt,.receipt-head,.receipt-body,.receipt-item,.manual-payment-step,.bill-card,.privacy-content) :is(h1,h2,h3,p,b,strong,span,small){color:#111!important}
  html :is(.theme-toggle,.legasist-theme-toggle){display:none!important}
}

/* Ajustes de precisión después de comprobar el render del directorio,
   acceso profesional, registro y navegación en ambos temas. */
html:not([data-theme="royal-dark"]) body.directory-page .directory-hero .trust-card h2,
html:not([data-theme="royal-dark"]) body.directory-page .directory-hero .trust-card .trust-label,
html:not([data-theme="royal-dark"]) body.lawyer-register-premium .form-section__title h2,
html:not([data-theme="royal-dark"]) body.lawyer-register-premium .form-section h2,
html:not([data-theme="royal-dark"]) body.login-role-page.login-role-abogado .lawyer-login-form-panel h2,
html:not([data-theme="royal-dark"]) .form-panel :is(h1,h2,h3),
html:not([data-theme="royal-dark"]) .law-preview :is(h1,h2,h3){color:#0c4f9d!important}
html[data-theme="royal-dark"] body.directory-page .directory-hero .trust-card h2,
html[data-theme="royal-dark"] body.lawyer-register-premium .form-section__title h2,
html[data-theme="royal-dark"] body.login-role-page.login-role-abogado .lawyer-login-form-panel h2{color:#ffffff!important}
/* La cabecera pública tenía un enlace blanco sobre fondo blanco. */
html:not([data-theme="royal-dark"]) body header.topbar nav.nav-links a.button.ghost,
html:not([data-theme="royal-dark"]) body header.law-topbar nav.law-nav a.law-btn--ghost{
  background:#ffffff!important;color:#0a468b!important;border-color:#d6e9ff!important;
  -webkit-text-fill-color:#0a468b!important;
}
html:not([data-theme="royal-dark"]) body header.topbar nav.nav-links a.button.ghost :is(span,strong,b),
html:not([data-theme="royal-dark"]) body header.law-topbar nav.law-nav a.law-btn--ghost :is(span,strong,b){color:#0a468b!important}
html:not([data-theme="royal-dark"]) body header.topbar nav.nav-links a.button.primary,
html:not([data-theme="royal-dark"]) body header.law-topbar nav.law-nav a.law-btn--primary{
  background:#216dc1!important;color:#ffffff!important;border-color:#216dc1!important;
  -webkit-text-fill-color:#ffffff!important;
}
html[data-theme="royal-dark"] body header.topbar nav.nav-links a.button.primary,
html[data-theme="royal-dark"] body header.law-topbar nav.law-nav a.law-btn--primary{
  background:#286caa!important;color:#ffffff!important;border-color:#71acd9!important;
  -webkit-text-fill-color:#ffffff!important;
}
/* Etiquetas visuales de perfil jurídico: iconografía blanca en azul oscuro. */
html:not([data-theme="royal-dark"]) body.lawyer-register-premium .profile-choice .profile-icon,
html:not([data-theme="royal-dark"]) body.directory-page .trust-card .trust-icon{
  background:#0e4d98!important;color:#ffffff!important;border-color:#0e4d98!important;
}
html[data-theme="royal-dark"] body.lawyer-register-premium .profile-choice .profile-icon,
html[data-theme="royal-dark"] body.directory-page .trust-card .trust-icon{
  background:#2879bd!important;color:#ffffff!important;border-color:#67b4e9!important;
}
html body.lawyer-register-premium .profile-choice .profile-icon :is(svg,path,span){color:#ffffff!important;stroke:currentColor!important}
html:not([data-theme="royal-dark"]) body.lawyer-register-premium .profile-choice:has(input:checked){
  background:#f4f8ff!important;border:2px solid #135eb5!important;
}
html[data-theme="royal-dark"] body.lawyer-register-premium .profile-choice:has(input:checked){
  background:#173a5f!important;border:2px solid #88c2f0!important;
}
/* El texto auxiliar del perfil no debe heredar blanco en modo claro. */
html:not([data-theme="royal-dark"]) body.lawyer-register-premium .profile-choice :is(strong,p){color:#121c2b!important}
html[data-theme="royal-dark"] body.lawyer-register-premium .profile-choice :is(strong,p){color:#f6faff!important}
/* Conservar iconos de botones visibles y textos seleccionados en temas opuestos. */
html:not([data-theme="royal-dark"]) .lawyer-login-form-panel .login-button,
html:not([data-theme="royal-dark"]) .directory-hero .search-panel button[type="submit"]{color:#ffffff!important}
/* Los radios visualmente ocultos ocupaban 368px y generaban desplazamiento
   horizontal en teléfonos aunque la etiqueta fuera angosta. */
html body.lawyer-register-premium .profile-choice input[type="radio"]{
  position:absolute!important;width:1px!important;height:1px!important;
  max-width:1px!important;min-width:1px!important;
  padding:0!important;margin:0!important;
  overflow:hidden!important;clip-path:inset(50%)!important;
}
html body.lawyer-register-premium .profile-choice:focus-within{
  outline:3px solid #68bafa!important;outline-offset:2px!important;
}

/* Acceso ciudadano: la tarjeta gráfica todavía conservaba un velo gris y el
   h1 azul sobre ese velo tenía contraste insuficiente. */
html:not([data-theme="royal-dark"]) body.login-role-page .login-image-panel{
  background:#ffffff!important;background-image:none!important;border-color:#cfdef0!important;
}
html[data-theme="royal-dark"] body.login-role-page .login-image-panel{
  background:#0b2341!important;background-image:none!important;border-color:#335879!important;
}
html body.login-role-page .login-image-panel::after{
  content:none!important;display:none!important;
}
html:not([data-theme="royal-dark"]) body.login-role-page .login-image-panel .image-caption{
  background:#0e4d98!important;border-color:#0e4d98!important;color:#ffffff!important;backdrop-filter:none!important;
}
html[data-theme="royal-dark"] body.login-role-page .login-image-panel .image-caption{
  background:#0c3866!important;border-color:#335879!important;color:#ffffff!important;backdrop-filter:none!important;
}
html body.login-role-page .login-image-panel .image-caption :is(h1,h2,h3,p,span,small,b,strong){
  color:#ffffff!important;text-shadow:none!important;
}
/* Link profesional: el CSS antiguo ponía el texto azul sobre botón azul. */
html body a.professional-access-link,
html body a.professional-access-link :is(span,b,strong,svg){
  background:#135eb5!important;border-color:#135eb5!important;color:#ffffff!important;
}
html[data-theme="royal-dark"] body a.professional-access-link,
html[data-theme="royal-dark"] body a.professional-access-link :is(span,b,strong,svg){
  background:#286caa!important;border-color:#71acd9!important;color:#ffffff!important;
}
html[data-theme="royal-dark"] :is(.law-kicker,.sec-tag,.login-kicker){
  background:#173a5f!important;border-color:#335879!important;color:#ffffff!important;
}
html:not([data-theme="royal-dark"]) body :is(footer,.footer,.law-footer,.flow-footer) a.professional-access-link,
html[data-theme="royal-dark"] body :is(footer,.footer,.law-footer,.flow-footer) a.professional-access-link{
  color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;
}
html:not([data-theme="royal-dark"]) body.login-role-page.login-role-usuario footer.footer .footer-links a.professional-access-link,
html[data-theme="royal-dark"] body.login-role-page.login-role-usuario footer.footer .footer-links a.professional-access-link{
  background:#135eb5!important;color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;
}
