/* ==========================================================================
   Temas de las páginas independientes (02-10-2026): portadas (index.html de
   Intelliti, RutaCC y FuenteCC) y documentación (docs/*). Sus hojas usan las
   mismas variables que RutaCC (--bg, --surface, --accent…) con la paleta
   oscura; aquí se redefinen para los otros tres temas y se adaptan los pocos
   colores fijos pensados para fondo oscuro. El tema lo fija js/temas_paginas.js
   en <html data-theme> (Intelliti por defecto), que además pone el botón.
   Se carga DESPUÉS de la hoja propia de la página.
   Copias (cada dominio .lan solo ve su carpeta y /docs/): css/, rutacc/css/, fuentecc/css/ y
   docs/. Mantenerlas iguales (lo revisa rutacc/tests/regresion/estatico.py).
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ── Paletas (oscuro = la de cada hoja, sin cambios) ─────────────────────── */
html[data-theme="light"] {
  --bg: #f8fafc; --surface: #ffffff; --surface2: #f1f5f9; --border: #cbd5e1;
  --accent: #0284c7; --accent2: #ea580c; --accent3: #16a34a;
  --text: #090d16; --muted: #475569; --danger: #dc2626; --warning: #ca8a04; --success: #15803d;
  color-scheme: light;
}
html[data-theme="blue"] {
  --bg: #0b132b; --surface: #1c2541; --surface2: #3a506b; --border: #48cae4;
  --accent: #00b4d8; --accent2: #ea580c; --accent3: #00f5d4;
  --text: #edf2f4; --muted: #a2d2ff; --danger: #ff4d6d; --warning: #ffb703; --success: #00f5d4;
  color-scheme: dark;
}
/* Intelliti: identidad de intelliti.cl — navy #102A43 dirige la acción, turquesa
   #0E7C86 texto activo e íconos (AA sobre blanco), turquesa vivo #14B8C4 decorativo */
html[data-theme="intelliti"] {
  --bg: #F6F8FA; --surface: #FFFFFF; --surface2: #F1F5F8; --border: #E2EAF0;
  --accent: #0E7C86; --accent2: #0E7C86; --accent3: #15803d;
  --text: #102A43; --muted: #52677A; --danger: #dc2626; --warning: #b45309; --success: #15803d;
  color-scheme: light;
}

/* Documentación de FuenteCC y del superusuario (fuentecc_docs.css, superusuario_docs.css):
   usan su juego --fcc-*; fuera del tema oscuro siguen la paleta del tema elegido. */
html:is([data-theme="light"], [data-theme="blue"], [data-theme="intelliti"]) {
  --fcc-accent: var(--accent); --fcc-accent-2: var(--accent2); --fcc-deep: var(--bg);
  --fcc-card: var(--surface); --fcc-card-2: var(--surface2); --fcc-line: var(--border);
  --fcc-text: var(--text); --fcc-muted: var(--muted); --fcc-good: var(--accent3);
}
html:is([data-theme="light"], [data-theme="blue"], [data-theme="intelliti"]) .slide { background: linear-gradient(145deg, var(--fcc-card, var(--surface)), var(--fcc-card-2, var(--surface2))); }
html:is([data-theme="light"], [data-theme="blue"], [data-theme="intelliti"]) :is(.slide .card, .field input) { background: var(--surface2); }

/* ── Temas claros (claro e Intelliti): colores fijos pensados para fondo oscuro ── */
html:is([data-theme="light"], [data-theme="intelliti"]) tr:nth-child(even) td { background: rgba(15, 23, 42, .03); }
html:is([data-theme="light"], [data-theme="intelliti"]) nav { background: rgba(255, 255, 255, .92); }
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.glow-1, .glow-2, .orb-1, .orb-2) { opacity: .35; }
html:is([data-theme="light"], [data-theme="intelliti"]) :is(th) { background: var(--surface2); }
html:is([data-theme="light"], [data-theme="intelliti"]) tr:nth-child(even) { background: rgba(15, 23, 42, .03); }
html:is([data-theme="light"], [data-theme="intelliti"]) tr:hover { background: rgba(15, 23, 42, .05); }
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.doc-contents, .stats, .info-section, .doc-header, .security-item, .modulo-tag) { background: var(--surface2); }
html:is([data-theme="light"], [data-theme="intelliti"]) .infografia .header { background: linear-gradient(135deg, var(--surface), var(--surface2)); }
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.slide-problem, .slide-solution, .slide-cta) { background-color: var(--surface); }
html:is([data-theme="light"], [data-theme="intelliti"]) .slide { box-shadow: 0 8px 24px rgba(15, 23, 42, .08); }
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.card, .feature, .stat-big, .pricing-card, .testim) { box-shadow: 0 8px 24px rgba(15, 23, 42, .06); }
/* Texto sobre el acento: blanco (el acento de los temas claros es oscuro) */
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.doc-link, .doc-link:hover, .btn-primary, .btn-new, .flujo-step-number, .nav-badge) { color: #FFFFFF; }
/* Insignias: los tonos pastel del tema oscuro no se leen sobre blanco */
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.badge-alto, .badge-critical, .badge-high) { color: #b91c1c; background: rgba(220, 38, 38, .1); }
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.badge-medio, .badge-medium) { color: #92400e; background: rgba(202, 138, 4, .14); }
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.badge-bajo, .badge-low) { color: #075985; background: rgba(2, 132, 199, .1); }
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.badge-obligatorio, .badge-required) { color: #047857; background: rgba(16, 185, 129, .12); }
/* Marca "intelliTI" de las portadas (blanca en el tema oscuro) */
html:is([data-theme="light"], [data-theme="intelliti"]) .intelliti-brand { color: var(--text); }
html:is([data-theme="light"], [data-theme="intelliti"]) .intelliti-brand span { color: #0E7C86; }

/* Textos de color propio (nombres de módulos, métodos de API, cifras): en fondo claro
   se oscurecen conservando su tono (los neón del tema oscuro no se leen sobre blanco) */
html:is([data-theme="light"], [data-theme="intelliti"]) .modulo-name { color: color-mix(in srgb, var(--card-color, var(--accent)) 55%, #0b1220); }
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.api-get, .api-post, .api-put, .api-delete, .saving-value, .stat-value, .db-pk, .db-fk) {
  color: color-mix(in srgb, currentColor 58%, #0b1220);
}
/* Diagramas de arquitectura: fondo claro (con el oscuro fijo, el texto del tema no se veía) */
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.diagram, .arch-diagram) { background: var(--surface2); }
/* Azul: títulos de capa y métodos sobre su propio tinte */
html[data-theme="blue"] :is(.layer-title, .api-method) { color: var(--text); }
html[data-theme="blue"] .db-pk { color: #ffb38a; }

/* Manual de usuario de RutaCC (manual_usuario.css): sus variables y la barra superior blanca fija */
html:is([data-theme="light"], [data-theme="blue"], [data-theme="intelliti"]) {
  --ink: var(--text); --line: var(--border); --brand: var(--accent); --brand-dark: var(--accent);
}
html:is([data-theme="light"], [data-theme="intelliti"]) .topbar { background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--border); }
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.brand-caption, .search input::placeholder) { color: var(--muted); }
html:is([data-theme="light"], [data-theme="intelliti"]) :is(.search input, .system-link, .menu-toggle) { color: var(--text); }
html:is([data-theme="light"], [data-theme="intelliti"]) .system-link { border-color: var(--border); }
html:is([data-theme="light"], [data-theme="intelliti"]) .brand-caption { border-left-color: var(--border); }

/* Demo de la grilla (docs: "Grilla avanzada Tabulator"): diseño claro propio en todos los temas */
.px-card-header h2 { color: inherit; }
.pagina-clara { --text: #2C3E50; --muted: #52677A; --accent: #1B4F72; --accent2: #2E86C1; --border: #CBCBCB; }
.pagina-clara :is(nav, .site-footer) { background: rgba(255, 255, 255, .94); }

/* ── Intelliti: tipografía, aire y botones del sitio ─────────────────────── */
html[data-theme="intelliti"] body *:not(.fa):not([class*="fa-"]):not(code):not(pre):not(pre *):not(kbd) {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
html[data-theme="intelliti"] body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: -0.005em; }
html[data-theme="intelliti"] :is(h1, h2, h3) { letter-spacing: -0.025em; }
html[data-theme="intelliti"] :is(.glow-1, .glow-2, .orb, .orb-1, .orb-2, .grid-bg, .scanline) { display: none; }
html[data-theme="intelliti"] body { background: #FFFFFF; }
html[data-theme="intelliti"] nav { border-bottom: 1px solid var(--border); backdrop-filter: blur(14px); box-shadow: none; }
html[data-theme="intelliti"] :is(.logo, .nav-logo) { color: #102A43; }
html[data-theme="intelliti"] :is(.logo span, .nav-logo span, .footer-logo span) { color: #0E7C86; }
html[data-theme="intelliti"] :is(.btn-primary, .btn-new, .doc-link) { background: #102A43; border-color: #102A43; border-radius: 9px; box-shadow: none; }
html[data-theme="intelliti"] :is(.btn-primary, .btn-new, .doc-link):hover { background: #0B2239; box-shadow: none; }
html[data-theme="intelliti"] :is(.card, .feature, .doc-card, .modulo, .modulo-card, .stat-card, .tech-card, .pricing-card, .testim, .stat-big) {
  border-radius: 14px; box-shadow: 0 8px 24px rgba(16, 42, 67, .055);
}
html[data-theme="intelliti"] :is(.hero-tag, .badge, .version) { border-radius: 999px; }
html[data-theme="intelliti"] ::selection { background: rgba(20, 184, 196, .22); }
