:root { color-scheme: dark; }
/* ============================================================
   FLUBLER · APLICACIONESMCOM — Sistema de interfaz compartido
   Una sola paleta, una sola escala de controles, estados claros.
   Se carga después de eco_shell.css en todas las páginas.
   Sin degradados decorativos, sin brillos, sin tipografía técnica
   fuera de los datos.
   ============================================================ */

:root {
  /* Superficies */
  --ui-bg: #070b12;
  --ui-surface: #0c131f;
  --ui-surface-2: #111a28;
  --ui-line: rgba(148, 163, 184, 0.14);
  --ui-line-strong: rgba(148, 163, 184, 0.24);

  /* Texto */
  --ui-text: #e7edf6;
  --ui-text-soft: #b6c2d3;
  --ui-muted: #8a99ae;

  /* Acentos */
  --ui-accent: #06b6d4;
  --ui-accent-hi: #22d3ee;
  --ui-accent-ink: #04141b;
  --ui-accent-soft: rgba(6, 182, 212, 0.12);
  --ui-gold: #d4af37;

  /* Semánticos */
  --ui-ok: #10b981;
  --ui-warn: #f59e0b;
  --ui-danger: #e11d48;

  /* Controles */
  --ui-h-sm: 30px;
  --ui-h-md: 38px;
  --ui-h-lg: 46px;
  --ui-r: 9px;
  --ui-font: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, sans-serif;

  /* Sombras sobrias: un borde de luz arriba, nada de resplandores */
  --ui-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  --ui-shadow-lg: 0 18px 40px -28px rgba(0, 0, 0, 0.9);
}

/* ------------------------------------------------------------
   1. Controles: misma forma, misma altura, mismos estados
   ------------------------------------------------------------ */
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
[role="button"] {
  font-family: var(--ui-font);
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

/* Radio único para todo lo que no sea píldora o círculo */
button:not([class*="rounded-full"]):not([class*="rounded-none"]),
input[type="button"],
input[type="submit"],
input[type="reset"] {
  border-radius: var(--ui-r);
}

/* Escala de alturas: pequeña, media y grande */
button[class~="py-1"],
button[class~="py-1.5"],
button[class~="py-px"] {
  min-height: var(--ui-h-sm);
}

button[class~="py-2"],
button[class~="py-2.5"] {
  min-height: var(--ui-h-md);
}

button[class~="py-3"],
button[class~="py-3.5"],
button[class~="py-4"] {
  min-height: var(--ui-h-lg);
}

/* Botones solo-icono: cuadrados y centrados */
button[class*="w-8"][class*="h-8"],
button[class*="w-9"][class*="h-9"],
button[class*="w-10"][class*="h-10"] {
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Texto legible: nada por debajo de 11.5 px en un control */
button[class*="text-[9px]"],
button[class*="text-[10px]"],
button[class*="text-[11px]"] {
  font-size: 11.5px;
  line-height: 1.2;
}

/* La tipografía monoespaciada se reserva a datos, no a controles */
button[class*="font-mono"],
[role="button"][class*="font-mono"] {
  font-family: var(--ui-font);
  font-weight: 600;
}

/* Rótulos en mayúsculas: tipografía de interfaz, no de terminal */
[class*="font-mono"][class*="uppercase"] {
  font-family: var(--ui-font);
  letter-spacing: 0.03em;
}

/* Estados */
button:focus-visible,
[role="button"]:focus-visible,
input[type="submit"]:focus-visible {
  outline: 2px solid var(--ui-accent-hi);
  outline-offset: 2px;
}

button:disabled,
button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

/* Acción principal: un solo color sólido en todo el ecosistema.
   Los degradados decorativos de botón desaparecen. */
button[class*="bg-gradient-to"] {
  background-image: none;
  background-color: var(--ui-accent);
  border: 1px solid rgba(34, 211, 238, 0.9);
  color: var(--ui-accent-ink);
  font-weight: 700;
  box-shadow: var(--ui-shadow);
}

button[class*="bg-gradient-to"]:hover {
  background-color: var(--ui-accent-hi);
  border-color: var(--ui-accent-hi);
  color: var(--ui-accent-ink);
}

/* Relleno de acento: texto oscuro para garantizar contraste legible */
button[class~="bg-cyan-400"],
button[class~="bg-cyan-500"],
button[class~="bg-cyan-600"],
button[class~="bg-cyan-700"],
button[class~="bg-sky-500"],
button[class~="bg-sky-600"],
button[class~="bg-teal-500"],
button[class~="bg-teal-600"] {
  color: var(--ui-accent-ink);
}

/* Brillos fuera: los botones se separan por color, no por resplandor */
button[class*="shadow-lg"],
button[class*="shadow-xl"],
button[class*="shadow-2xl"],
button[class*="shadow-md"] {
  box-shadow: var(--ui-shadow);
}

/* ------------------------------------------------------------
   2. Controles de formulario alineados con los botones
   ------------------------------------------------------------ */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
select,
textarea {
  font-family: var(--ui-font);
  border-radius: var(--ui-r);
}

input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="number"]:focus-visible,
input[type="password"]:focus-visible,
input[type="search"]:focus-visible,
input[type="tel"]:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.65);
  outline-offset: 1px;
}

/* ------------------------------------------------------------
   3. Tarjetas Liquid Glassmorphism: translucidez, desenfoque y bisel
   ------------------------------------------------------------ */
.glass-panel {
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.085), rgba(12, 19, 31, 0.72) 52%, rgba(7, 11, 18, 0.86));
  backdrop-filter: blur(20px) saturate(165%);
  -webkit-backdrop-filter: blur(20px) saturate(165%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(255, 255, 255, 0.05), var(--ui-shadow-lg);
}

/* ------------------------------------------------------------
   4. Ayuda flotante: botón circular, discreto, sin tapar contenido
   ------------------------------------------------------------ */
.sovereign-protips-fab {
  width: 40px;
  height: 40px;
  padding: 0;
  gap: 0;
  justify-content: center;
  bottom: 18px;
  right: 18px;
  border-radius: 50%;
  background: rgba(12, 19, 31, 0.92);
  border: 1px solid var(--ui-line-strong);
  color: var(--ui-text-soft);
  font-family: var(--ui-font);
  font-size: 0;
  box-shadow: var(--ui-shadow);
}

.sovereign-protips-fab:hover {
  background: var(--ui-surface-2);
  border-color: rgba(34, 211, 238, 0.55);
  color: var(--ui-accent-hi);
  transform: none;
  box-shadow: var(--ui-shadow);
}

.sovereign-protips-fab svg {
  width: 18px;
  height: 18px;
}

.sovereign-protips-drawer {
  border-left: 1px solid var(--ui-line);
  background: var(--ui-bg);
}

.sovereign-protips-drawer h4 {
  font-family: var(--ui-font);
  letter-spacing: 0;
}

/* ------------------------------------------------------------
   5. Filas de controles: los botones no parten su texto; la fila
      salta de línea cuando no cabe (escritorio y móvil).
   ------------------------------------------------------------ */
body.eco-has-shell .flex.items-center.space-x-2,
body.eco-has-shell .flex.items-center.space-x-3 {
  flex-wrap: wrap;
  row-gap: 8px;
}

body.eco-has-shell .flex.items-center.space-x-2 > button,
body.eco-has-shell .flex.items-center.space-x-3 > button,
body.eco-has-shell .flex.items-center.space-x-2 > a,
body.eco-has-shell .flex.items-center.space-x-3 > a {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   6. Avisos operativos (pasarela, credenciales): texto legible
   ------------------------------------------------------------ */
.live-gateway-banner,
.cred-banner {
  font-family: var(--ui-font);
  letter-spacing: 0;
}

@media (max-width: 640px) {
  .live-gateway-banner,
  .cred-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    font-size: 0.78rem;
  }

  .live-gateway-banner > div,
  .cred-item {
    width: 100%;
    flex-wrap: wrap;
  }

  .live-gateway-banner > div:first-child > span:last-child {
    flex: 1 1 100%;
  }
}

/* ------------------------------------------------------------
   7. Micromovimiento contenido: nada de desplazamientos al pasar
   ------------------------------------------------------------ */
.studio-dock-btn,
.viral-dock-btn,
.cat-dock-btn {
  will-change: auto;
}

.studio-dock-btn:hover,
.viral-dock-btn:hover,
.cat-dock-btn:hover {
  transform: none;
}

/* ------------------------------------------------------------
   8. Rendimiento en móvil: menos capas de desenfoque al desplazar
   ------------------------------------------------------------ */
@media (max-width: 1023px) {
  .glass-panel,
  [class*="backdrop-blur"]:not(.eco-mobilebar):not(.eco-scrim) {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .sovereign-protips-fab {
    width: 38px;
    height: 38px;
    bottom: 14px;
    right: 14px;
  }

  /* Story Studio: la navegación interna pasa a tira horizontal;
     los accesos de pago y soporte ya viven en la cabecera. */
  body.eco-has-shell #seriesStreamDock {
    position: static;
    max-height: none;
    overflow: visible;
    gap: 8px;
  }

  body.eco-has-shell #seriesStreamDock > a,
  body.eco-has-shell #seriesStreamDock > p {
    display: none !important;
  }

  body.eco-has-shell #seriesStreamDock > div:first-child {
    background: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.eco-has-shell #seriesStreamDock > div:first-child > div:first-child {
    display: none;
  }

  body.eco-has-shell #seriesStreamDock > div:first-child > div:last-child {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent 100%);
  }

  body.eco-has-shell #seriesStreamDock > div:first-child > div:last-child::-webkit-scrollbar {
    display: none;
  }

  body.eco-has-shell #seriesStreamDock > div:first-child > div:last-child > button {
    width: auto !important;
    flex: 0 0 auto;
    padding: 9px 12px !important;
    border-left-width: 0 !important;
    border-radius: 9px !important;
    background: rgba(148, 163, 184, 0.08) !important;
  }

  body.eco-has-shell #seriesStreamDock > div:first-child > div:last-child > button > span:last-child {
    display: none;
  }

  body.eco-has-shell #seriesStreamDock > div:first-child > div:last-child > button.stream-dock-active {
    background: rgba(212, 175, 55, 0.16) !important;
  }

  /* Viral Studio: la barra de motores también pasa a tira horizontal */
  body.eco-has-shell #viralDock {
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--ui-line);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent 100%);
  }

  body.eco-has-shell #viralDock::-webkit-scrollbar {
    display: none;
  }

  body.eco-has-shell #viralDock > div:first-child {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
  }

  body.eco-has-shell #viralDock > div:first-child > div:first-child > div:first-child,
  body.eco-has-shell #viralDock > div:first-child > div:last-child,
  body.eco-has-shell #viralDock > div:last-child {
    display: none;
  }

  body.eco-has-shell #viralDock #viralDockNav {
    display: flex;
    flex-direction: row;
    gap: 6px;
  }

  body.eco-has-shell #viralDock .viral-dock-btn {
    width: auto !important;
    flex: 0 0 auto;
    padding: 8px 10px !important;
  }

  body.eco-has-shell #viralDock .viral-dock-btn p:last-child,
  body.eco-has-shell #viralDock .dock-key {
    display: none;
  }

  /* Barras de herramientas desplazables: el corte se atenúa */
  body.eco-has-shell .module-view > div:first-child {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 94%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 94%, transparent 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  [role="button"] {
    transition: none;
  }

  button:active:not(:disabled) {
    transform: none;
  }
}

/* ============================================================
   9. Identidad por producto
   Todo el ecosistema comparte estructura, escala y estados.
   Cada aplicación aporta únicamente su acento, de modo que
   al cambiar de producto se reconoce dónde se está sin
   reaprender la interfaz.
   ============================================================ */

:root {
  --eco-proj: #d4af37;
  --eco-proj-hi: #e8c95f;
  --eco-proj-bg: rgba(212, 175, 55, 0.16);
  --eco-proj-line: rgba(212, 175, 55, 0.24);
}

html[data-project="hub"] {
  --ui-accent: #06b6d4;
  --ui-accent-hi: #22d3ee;
  --ui-accent-ink: #04141b;
  --ui-accent-soft: rgba(6, 182, 212, 0.12);
  --eco-proj: #06b6d4;
  --eco-proj-hi: #22d3ee;
  --eco-proj-bg: rgba(6, 182, 212, 0.16);
  --eco-proj-line: rgba(6, 182, 212, 0.26);
}

html[data-project="cine"] {
  --ui-accent: #e0a53a;
  --ui-accent-hi: #f5c469;
  --ui-accent-ink: #1a1204;
  --ui-accent-soft: rgba(224, 165, 58, 0.12);
  --eco-proj: #e0a53a;
  --eco-proj-hi: #f5c469;
  --eco-proj-bg: rgba(224, 165, 58, 0.16);
  --eco-proj-line: rgba(224, 165, 58, 0.26);
}

html[data-project="series"] {
  --ui-accent: #e0615c;
  --ui-accent-hi: #f58b86;
  --ui-accent-ink: #1b0706;
  --ui-accent-soft: rgba(224, 97, 92, 0.12);
  --eco-proj: #e0615c;
  --eco-proj-hi: #f58b86;
  --eco-proj-bg: rgba(224, 97, 92, 0.16);
  --eco-proj-line: rgba(224, 97, 92, 0.26);
}

html[data-project="creative"] {
  --ui-accent: #2fbe8b;
  --ui-accent-hi: #4bd9a4;
  --ui-accent-ink: #04150f;
  --ui-accent-soft: rgba(47, 190, 139, 0.12);
  --eco-proj: #2fbe8b;
  --eco-proj-hi: #4bd9a4;
  --eco-proj-bg: rgba(47, 190, 139, 0.16);
  --eco-proj-line: rgba(47, 190, 139, 0.26);
}

html[data-project="viral"] {
  --ui-accent: #f0763a;
  --ui-accent-hi: #ff9a63;
  --ui-accent-ink: #1c0c03;
  --ui-accent-soft: rgba(240, 118, 58, 0.12);
  --eco-proj: #f0763a;
  --eco-proj-hi: #ff9a63;
  --eco-proj-bg: rgba(240, 118, 58, 0.16);
  --eco-proj-line: rgba(240, 118, 58, 0.26);
}

html[data-project="marcas"] {
  --ui-accent: #d4af37;
  --ui-accent-hi: #e8c95f;
  --ui-accent-ink: #1a1305;
  --ui-accent-soft: rgba(212, 175, 55, 0.12);
  --eco-proj: #d4af37;
  --eco-proj-hi: #e8c95f;
  --eco-proj-bg: rgba(212, 175, 55, 0.16);
  --eco-proj-line: rgba(212, 175, 55, 0.26);
}

html[data-project="visor"] {
  --ui-accent: #5b8def;
  --ui-accent-hi: #7ba6f7;
  --ui-accent-ink: #050f22;
  --ui-accent-soft: rgba(91, 141, 239, 0.12);
  --eco-proj: #5b8def;
  --eco-proj-hi: #7ba6f7;
  --eco-proj-bg: rgba(91, 141, 239, 0.16);
  --eco-proj-line: rgba(91, 141, 239, 0.26);
}

html[data-project="lingua"] {
  --ui-accent: #14b8a6;
  --ui-accent-hi: #2dd4bf;
  --ui-accent-ink: #04150f;
  --ui-accent-soft: rgba(20, 184, 166, 0.12);
  --eco-proj: #14b8a6;
  --eco-proj-hi: #2dd4bf;
  --eco-proj-bg: rgba(20, 184, 166, 0.16);
  --eco-proj-line: rgba(20, 184, 166, 0.26);
}

html[data-project="estado"] {
  --ui-accent: #8b9cb3;
  --ui-accent-hi: #a9b8cb;
  --ui-accent-ink: #0b1119;
  --ui-accent-soft: rgba(139, 156, 179, 0.12);
  --eco-proj: #8b9cb3;
  --eco-proj-hi: #a9b8cb;
  --eco-proj-bg: rgba(139, 156, 179, 0.16);
  --eco-proj-line: rgba(139, 156, 179, 0.26);
}

/* Ficha de producto en la barra lateral: dónde estoy */
.eco-project {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 10px 14px;
  padding: 9px 11px 10px;
  border-radius: 9px;
  border: 1px solid var(--eco-line-soft);
  border-left: 2px solid var(--eco-proj);
  background: var(--eco-proj-bg);
}

.eco-project b {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--eco-text-strong);
  line-height: 1.25;
}

.eco-project span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--eco-proj-hi);
}

/* Con el menú contraído la ficha se reduce a su inicial: el acento
   sigue identificando el producto sin ocupar la barra. */
.eco-collapsed .eco-project {
  align-items: center;
  justify-content: center;
  margin: 0 10px 12px;
  padding: 0;
  height: 34px;
  border-radius: 8px;
  border-left-width: 1px;
}

.eco-collapsed .eco-project b,
.eco-collapsed .eco-project span {
  display: none;
}

.eco-collapsed .eco-project::after {
  content: attr(data-initial);
  font-size: 13px;
  font-weight: 800;
  color: var(--eco-proj-hi);
  letter-spacing: 0;
}

/* El elemento activo toma el acento del producto, no el de la casa */
.eco-link[aria-current="page"] {
  background: linear-gradient(90deg, var(--eco-proj-bg), rgba(148, 163, 184, 0.02));
  box-shadow: inset 0 0 0 1px var(--eco-proj-line);
}

.eco-link[aria-current="page"]::before {
  background: var(--eco-proj);
}

.eco-link[aria-current="page"] svg {
  color: var(--eco-proj-hi);
}

.eco-shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--eco-proj);
  opacity: 0.45;
  pointer-events: none;
}

/* Barra móvil: nombre del producto y regla de acento */
.eco-mb-project {
  display: inline-flex;
  align-items: center;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--ui-line-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--eco-proj-hi);
  white-space: nowrap;
}

.eco-mobilebar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--eco-proj);
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 380px) {
  .eco-mb-project {
    padding-left: 8px;
    font-size: 10px;
    letter-spacing: 0.06em;
  }
}

/* ------------------------------------------------------------
   10. Indicador de sesión en cabeceras: nunca se comprime ni
       desborda el ancho de la pantalla.
   ------------------------------------------------------------ */
[data-eco-auth-slot] {
  flex: 0 0 auto;
  min-width: max-content;
  max-width: 100%;
  white-space: nowrap;
}
