/* DISERC · Color por producto (2026-11)
   Se carga la ÚLTIMA en cada página, después de titanium.css.
   Cada página lleva en <body> una clase brand-* que fija su paleta:

     brand-portal  DISERC (portada, contacto, términos) · turquesa → azul eléctrico
     brand-labs    Portal DISERC Labs ..................... turquesa → violeta
     brand-labscan R-LabScan AI ............................ rojo sangre → coral
     brand-english R-EnglishLearn AI ....................... ámbar → naranja
     brand-nutri   R-NutriScan IA .......................... lima → esmeralda
     brand-editor  R-EditorBible ........................... magenta → violeta
     brand-tech    DISERC Tech ............................. violeta
     brand-build   DISERC Build ............................ azul acero

   Variables:
     --brand-a      color principal (texto de acento, bordes, iconos)
     --brand-b      segundo color del degradado
     --brand-light  versión clara (texto sobre fondo oscuro)
     --brand-ink    texto sobre el botón principal
   Los colores de estado (verde = bien, rojo = mal) NO se tocan.
   Contraste del texto de los botones comprobado (WCAG AA, ≥ 4,5:1). */

:root,body.brand-portal{
  --brand-a:#3ee0f0;--brand-b:#4f7dff;--brand-light:#8eefff;--brand-ink:#04121a;
}
body.brand-labs{--brand-a:#3ee0f0;--brand-b:#a78bfa;--brand-light:#9ff3fb;--brand-ink:#06121a}
body.brand-labscan{--brand-a:#ff5b6b;--brand-b:#ff9a7a;--brand-light:#ff9aa4;--brand-ink:#1f0508}
body.brand-english{--brand-a:#fbbf24;--brand-b:#fb7a2c;--brand-light:#fcd56b;--brand-ink:#1d1104}
body.brand-nutri{--brand-a:#a3e635;--brand-b:#10b981;--brand-light:#c8f27a;--brand-ink:#0b1a06}
body.brand-editor{--brand-a:#f472b6;--brand-b:#a78bfa;--brand-light:#f9a8d4;--brand-ink:#1f0716}
body.brand-tech{--brand-a:#a78bfa;--brand-b:#8b7bff;--brand-light:#c4b5fd;--brand-ink:#120a2a}
body.brand-build{--brand-a:#60a5fa;--brand-b:#94a3b8;--brand-light:#a5c8fd;--brand-ink:#06111f}

/* ── 1. Tokens de las hojas existentes, apuntando a la marca ───────── */
body[class*="brand-"]{
  --blue:var(--brand-a);
  --cyan:var(--brand-light);
  --blue-hover:var(--brand-light);
  --blue-soft:color-mix(in srgb,var(--brand-a) 14%,transparent);
  --cyan-soft:color-mix(in srgb,var(--brand-light) 10%,transparent);
  --line-brand:color-mix(in srgb,var(--brand-a) 42%,transparent);
  --focus-ring:0 0 0 3px color-mix(in srgb,var(--brand-a) 28%,transparent);
  --lb-blue:var(--brand-a);
  --lb-cyan:var(--brand-light);
  --lb-violet:var(--brand-b);
  --el-blue:var(--brand-a);
  --el-cyan:var(--brand-light);
  --green:var(--brand-a);            /* acento de las páginas de LabScan */
  --brand-grad:linear-gradient(100deg,var(--brand-light) 0%,var(--brand-a) 45%,var(--brand-b) 100%);
}

/* ── 2. Fondo: halos de color de la marca ─────────────────────────── */
body[class*="brand-"]{
  background:
    radial-gradient(ellipse 55% 45% at 85% 0%,color-mix(in srgb,var(--brand-a) 22%,transparent) 0,transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 35%,color-mix(in srgb,var(--brand-b) 16%,transparent) 0,transparent 70%),
    radial-gradient(ellipse at 16% 0%,#2b3945 0,transparent 34%),
    linear-gradient(180deg,#171d24,#11161c 75%,#0c1116) !important;
  background-attachment:fixed !important;
}
body[class*="brand-"] .ti-orb.cyan{background:radial-gradient(circle,var(--brand-a),transparent 70%)}
body[class*="brand-"] .ti-orb.red{background:radial-gradient(circle,var(--brand-b),transparent 70%)}
body[class*="brand-"] .ti-orb{opacity:.22}
body[class*="brand-"] .ti-line{background:linear-gradient(90deg,transparent,var(--brand-a),var(--brand-light),transparent);filter:drop-shadow(0 0 5px var(--brand-a))}
body[class*="brand-"] .ti-line.d{background:linear-gradient(90deg,transparent,var(--brand-b),transparent);filter:drop-shadow(0 0 6px var(--brand-b))}

/* ── 3. Titulares con degradado ───────────────────────────────────── */
/* Acentos que ya existen en cada página (em, .green, .el-grad…) */
body[class*="brand-"] h1 em,
body[class*="brand-"] h2 em,
body[class*="brand-"] .green,
body[class*="brand-"] .el-grad,
body[class*="brand-"] .lb-grad,
body[class*="brand-"] .el-title em,
body[class*="brand-"] .display-title em,
body[class*="brand-"] .el-display .el-grad{
  background:var(--brand-grad);
  -webkit-background-clip:text;background-clip:text;
  color:transparent !important;-webkit-text-fill-color:transparent;
}
/* H1 de páginas sin acento propio (portada corporativa, Tech, Build,
   Labs, NutriScan, EditorBible): degradado de blanco al color de marca */
body[class*="brand-"] h1:not([class*="eyebrow"]):not(.el-badge):not(:has(em,.el-grad,.green,.lb-grad,img)){
  background:linear-gradient(100deg,#ffffff 0%,#ffffff 35%,var(--brand-light) 70%,var(--brand-a) 100%) !important;
  -webkit-background-clip:text !important;background-clip:text !important;
  color:transparent !important;-webkit-text-fill-color:transparent !important;
  width:fit-content;max-width:100%;  /* el degradado se ajusta al texto */
}

/* ── 4. Botones ───────────────────────────────────────────────────── */
body[class*="brand-"] .boton.primario,
body[class*="brand-"] .btn-primary,
body[class*="brand-"] .lb-btn.primary,
body[class*="brand-"] .el-btn.primary,
body[class*="brand-"] .ns-btn.primary,
body[class*="brand-"] .eb-btn.primary,
body[class*="brand-"] a.btn.primary,
body[class*="brand-"] button.btn.primary{
  background:linear-gradient(135deg,var(--brand-a),var(--brand-b)) !important;
  color:var(--brand-ink) !important;
  box-shadow:0 10px 30px color-mix(in srgb,var(--brand-a) 34%,transparent),0 0 0 1px color-mix(in srgb,var(--brand-light) 30%,transparent) inset !important;
}
body[class*="brand-"] .boton.primario:hover,
body[class*="brand-"] .btn-primary:hover,
body[class*="brand-"] .el-btn.primary:hover,
body[class*="brand-"] .lb-btn.primary:hover{
  box-shadow:0 14px 38px color-mix(in srgb,var(--brand-a) 48%,transparent) !important;
}
body[class*="brand-"] .boton.secundario,
body[class*="brand-"] .lb-btn.ghost,
body[class*="brand-"] .el-btn.ghost,
body[class*="brand-"] .btn-outline{
  border-color:color-mix(in srgb,var(--brand-a) 70%,transparent) !important;
  color:var(--brand-light) !important;
  background:color-mix(in srgb,var(--brand-a) 8%,rgba(23,31,39,.72)) !important;
}

/* ── 5. Etiquetas, iconos y enlaces ───────────────────────────────── */
body[class*="brand-"] .lb-kicker,
body[class*="brand-"] .el-kicker,
body[class*="brand-"] .kicker,
body[class*="brand-"] .section-kicker{color:var(--brand-a)}
body[class*="brand-"] .eyebrow{
  color:var(--brand-light) !important;
  border-color:color-mix(in srgb,var(--brand-a) 45%,transparent) !important;
  background:color-mix(in srgb,var(--brand-a) 12%,#151d25) !important;
}
body[class*="brand-"] nav a:hover{color:var(--brand-light)}

/* ── 6. Tarjetas: borde con el color de marca y brillo al pasar ───── */
body[class*="brand-"] .lb-feature,body[class*="brand-"] .lb-step,body[class*="brand-"] .lb-plan,
body[class*="brand-"] .lb-persona,body[class*="brand-"] .lb-stat,
body[class*="brand-"] .el-feature,body[class*="brand-"] .el-step,body[class*="brand-"] .el-plan,
body[class*="brand-"] .el-persona,body[class*="brand-"] .el-pain,
body[class*="brand-"] .tech-card,body[class*="brand-"] .service-card,body[class*="brand-"] .product-card,
body[class*="brand-"] .card,body[class*="brand-"] .panel-card,body[class*="brand-"] .lab-card{
  border-color:color-mix(in srgb,var(--brand-a) 22%,#3a4a56) !important;
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--brand-light) 14%,transparent),0 18px 48px rgba(0,0,0,.28);
  transition:border-color .3s,box-shadow .3s,transform .3s;
}
body[class*="brand-"] .lb-feature:hover,body[class*="brand-"] .el-feature:hover,
body[class*="brand-"] .el-persona:hover,body[class*="brand-"] .tech-card:hover,
body[class*="brand-"] .service-card:hover,body[class*="brand-"] .product-card:hover,
body[class*="brand-"] .card:hover,body[class*="brand-"] .lab-card:hover{
  border-color:color-mix(in srgb,var(--brand-a) 60%,transparent) !important;
  box-shadow:0 0 0 1px color-mix(in srgb,var(--brand-a) 30%,transparent),0 18px 48px rgba(0,0,0,.32),0 0 34px color-mix(in srgb,var(--brand-a) 18%,transparent);
}

/* Cifras destacadas con el degradado de la marca */
body[class*="brand-"] .stat-box strong em,
body[class*="brand-"] .el-stat strong em{
  background:var(--brand-grad);-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;
}

/* Las páginas con varios productos (portal Labs) mantienen el color
   propio de cada tarjeta de producto si lo tienen. */

@media (prefers-reduced-motion:reduce){
  body[class*="brand-"] .card,body[class*="brand-"] .el-persona{transition:none}
}
@media print{
  body[class*="brand-"]{background:#fff !important}
  body[class*="brand-"] h1,body[class*="brand-"] h1 *,body[class*="brand-"] h2 em{-webkit-text-fill-color:#000;color:#000 !important;background:none}
}
