/* IrisWebFlow — shell alrededor del editor visual (`editor/editor.css` estila
   el lienzo, los nodos y el panel de propiedades con prefijo `ifw-`).
   Paleta IRIS (ver CONTEXTO_IRISWEB.md §1). */

:root {
  --iris-ink: #2B2140;
  --iris-petal: #4A3B78;
  --aperture-gold: #D6A24C;
  --signal-teal: #2F7A6B;
  --paper: #F6F3EE;
  --mist: #DCD6E8;
  --gold-tenue: rgba(214, 162, 76, 0.14);
  --texto: #2B2140;
  --texto-suave: #6b6480;
  --peligro: #B23A48;
  --radio: 7px;
  --borde: 0.5px solid var(--mist);
  --fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 var(--fuente); color: var(--texto); background: var(--paper); }
button { font: inherit; cursor: pointer; }

/* ---------- Login / splash ------------------------------------------- */

.login { display: grid; place-items: center; min-height: 100vh; background: var(--iris-ink); }
.login__caja { background: var(--paper); border-radius: 10px; padding: 30px 32px; width: 300px; display: grid; gap: 12px; }
.wordmark { display: block; }
.wordmark--login { height: 30px; margin: 0 auto 2px; }
.login__sub { margin: 0 0 10px; text-align: center; font-size: 12px; color: var(--texto-suave); letter-spacing: .03em; }
.login label { display: grid; gap: 4px; font-size: 13px; color: var(--texto-suave); }
.login input { padding: 9px 11px; border: var(--borde); border-radius: var(--radio); font: inherit; background: #fff; }
.login input:focus { outline: none; border-color: var(--iris-petal); }
.login__error { color: var(--peligro); font-size: 13px; min-height: 18px; }
.cargando { display: grid; place-items: center; min-height: 100vh; color: var(--texto-suave); background: var(--iris-ink); }

/* ---------- Botones ------------------------------------------------------ */

.btn { border: 1px solid var(--mist); background: #fff; color: var(--texto); padding: 7px 13px; border-radius: var(--radio); }
.btn:hover { border-color: var(--iris-petal); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primario { background: var(--aperture-gold); border-color: var(--aperture-gold); color: #2a2010; font-weight: 600; }
.btn--primario:hover { filter: brightness(.96); }
.btn--secundario { background: var(--iris-petal); border-color: var(--iris-petal); color: #fff; }

/* ---------- Shell del editor ---------------------------------------- */

.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); height: 100vh; }

.lateral {
  background: var(--iris-ink); color: #d9d4e8;
  display: flex; flex-direction: column; min-height: 0;
}
.lateral__cab { padding: 16px 16px 10px; }
.lateral__cab .wordmark { height: 24px; width: auto; }
.lateral__sub { font-size: 11px; color: #8f88a8; margin-top: 3px; letter-spacing: .03em; }

.paleta { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.paleta__busca {
  width: 100%; margin: 4px 0 8px; padding: 6px 9px; border-radius: var(--radio); font: inherit;
  background: #3a2f52; color: #fff; border: 1px solid rgba(255,255,255,.14);
}
.paleta__busca::placeholder { color: #8f88a8; }

.paleta__grupo { margin-bottom: 2px; }
.paleta__tit {
  width: 100%; text-align: left; background: none; border: none; color: #c7c0dd;
  padding: 7px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  display: flex; align-items: center; gap: 6px; border-radius: 6px;
}
.paleta__tit:hover { background: rgba(255,255,255,.05); }
.paleta__tit .cuenta { margin-left: auto; opacity: .6; font-size: 10px; }
.paleta__items { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 6px; }
.paleta__item {
  text-align: left; background: none; border: none; color: #e7e3f2;
  padding: 6px 10px 6px 20px; font-size: 13px; border-radius: 6px; border-left: 2px solid transparent;
}
.paleta__item:hover { background: var(--gold-tenue); border-left-color: var(--aperture-gold); }
.paleta__item { touch-action: none; }

/* Fantasma que sigue al puntero mientras arrastras una caja al lienzo. */
.paleta__fantasma {
  position: fixed; z-index: 999; pointer-events: none;
  background: #fff; color: var(--texto); border: 1px solid var(--aperture-gold);
  border-radius: var(--radio); padding: 4px 10px; font-size: 12px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(43, 33, 64, .22);
}

/* ---------- Zona principal ---------------------------------------------- */

.principal { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.barra {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 14px;
  background: #fff; border-bottom: var(--borde);
}
.barra__flujos {
  padding: 7px 9px; border-radius: var(--radio); font: inherit;
  border: var(--borde); background: #fff; color: var(--texto); max-width: 260px;
}
.barra .crece { flex: 1; }
.barra__sucio { color: var(--aperture-gold); font-size: 12px; white-space: nowrap; }

.zona { flex: 1; display: flex; min-height: 0; }
.lienzo { flex: 1; min-width: 0; min-height: 0; position: relative; }
.props {
  width: 300px; flex: none; border-left: var(--borde); background: #fff;
  overflow-y: auto; padding: 12px;
}
/* Propiedades del flujo (Nombre/Descripción/Autor/Empresa) cuando no hay
   nodo/conexión seleccionado — mismas clases `.ifw-property-*` que pinta el
   editor para las cajas (editor/editor.css), así el panel no cambia de
   estilo al alternar entre los dos. */
.props-flujo textarea.ifw-property-input { min-height: 90px; }
.diag {
  border-top: var(--borde); background: var(--paper);
  max-height: 130px; overflow-y: auto; padding: 8px 14px; font-size: 12px;
}

.vacio-editor { flex: 1; display: grid; place-items: center; color: var(--texto-suave); }
