/* =============================================================
   ARSIM — Hoja de marca para landings
   -------------------------------------------------------------
   FUENTE DE VERDAD: client/src/index.css del repo arsim-studio.
   Los tokens de :root son copia literal de la app. Si cambian
   alla, se cambian aca. NO inventar colores fuera de esta lista.

   Uso: <link rel="stylesheet" href="arsim-brand.css">
   Requiere Inter de Google Fonts (ver README, seccion 2).
   ============================================================= */

/* ---------- 1. TOKENS (identicos a la app) ---------- */

:root {
  /* Fondos, de mas claro a mas oscuro */
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #0f1b35;
  --bg-panel: #0d1526;

  /* Cian de ARSIM. Es el unico color de marca: se usa POCO y
     siempre para lo que importa (un CTA, un dato, un borde vivo). */
  --accent: #00d4ff;
  --accent-dim: rgba(0, 212, 255, 0.15);
  --accent-hover: #33ddff;

  /* Semaforo industrial. NO son colores decorativos. */
  --danger: #ff4444;
  --success: #00e676;
  --warning: #ffaa00;

  /* Texto */
  --text-primary: #e8eaf0;
  --text-mid: #a9b4d0;
  --text-secondary: #7986a8;

  /* Bordes */
  --border: #1e2d4d;
  --border-accent: rgba(0, 212, 255, 0.3);

  /* Pulsador industrial: luz arriba, canto abajo */
  --btn-face: linear-gradient(180deg, #1d2c4f 0%, #15213f 100%);
  --btn-edge: #0a1124;
  --btn-line: #2c4270;

  --font-mono: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Consolas, monospace;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  /* Radios reales de la app: 6px paneles/botones, 4px controles,
     3px chips. No usar 12px+ : la app no tiene esa curva. */
  --r-panel: 6px;
  --r-control: 4px;
  --r-chip: 3px;
}

/* ---------- 2. BASE ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-control);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 3. LAYOUT ---------- */

.arsim-wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.arsim-section {
  padding: 72px 0;
}

/* Resplandor cian desde arriba: el fondo del login de la app.
   Aplicar a la seccion hero, no al body entero. */
.arsim-glow {
  background-image: radial-gradient(
    ellipse at 50% 0%,
    rgba(0, 212, 255, 0.08) 0%,
    transparent 60%
  );
}

/* ---------- 4. TIPOGRAFIA ---------- */

.arsim-h1 {
  font-size: clamp(30px, 6vw, 54px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.arsim-h2 {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.arsim-lead {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--text-mid);
  max-width: 60ch;
}

.arsim-muted {
  color: var(--text-secondary);
}

/* Etiqueta de tablero: mono + mayusculas + tracking abierto.
   Es LA marca tipografica de ARSIM. Usarla en eyebrows y chips,
   nunca en parrafos largos. */
.arsim-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}

.arsim-data {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- 5. PANEL DE OPERADOR (la tarjeta de ARSIM) ---------- */

.arsim-panel {
  background: rgba(13, 21, 38, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--r-panel);
  padding: 24px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(0, 212, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Variante sin el filo cian: para tarjetas secundarias en grilla,
   asi el acento no se repite doce veces en la misma pantalla. */
.arsim-panel--plain {
  border-top: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* Cabecera con LEDs, como el panel de login */
.arsim-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.arsim-leds {
  display: flex;
  gap: 7px;
}

.arsim-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
  background: #222c45;
}

.arsim-led--on {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.arsim-led--comm {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: arsimBlink 1.1s steps(2, start) infinite;
}

@keyframes arsimBlink {
  50% {
    opacity: 0.25;
  }
}

/* ---------- 6. PULSADOR (el boton fisico de ARSIM) ---------- */

.arsim-btn {
  display: inline-block;
  background: var(--btn-face);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 14px 28px;
  border: 1px solid var(--btn-line);
  border-top-color: #3a5486;
  border-radius: var(--r-panel);
  cursor: pointer;
  box-shadow:
    0 3px 0 var(--btn-edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
}

.arsim-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow:
    0 4px 0 var(--btn-edge),
    0 6px 20px rgba(0, 212, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Se HUNDE al apretarlo. Este detalle es media identidad: no lo quites. */
.arsim-btn:active {
  transform: translateY(2px);
  box-shadow:
    0 0 0 var(--btn-edge),
    inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

.arsim-btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-mid);
  box-shadow: none;
}

.arsim-btn--ghost:hover {
  border-color: var(--border-accent);
  color: var(--accent);
  box-shadow: none;
  transform: translateY(-1px);
}

/* ---------- 7. CHIP / BADGE ---------- */

.arsim-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: var(--r-chip);
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border-accent);
}

.arsim-chip--ok {
  background: rgba(0, 230, 118, 0.12);
  color: var(--success);
  border-color: rgba(0, 230, 118, 0.3);
}

.arsim-chip--warn {
  background: rgba(255, 170, 0, 0.12);
  color: var(--warning);
  border-color: rgba(255, 170, 0, 0.3);
}

/* ---------- 8. GRILLA ---------- */

.arsim-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ---------- 9. REGLA DIVISORIA ---------- */

.arsim-rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
  margin: 40px 0;
}

/* =============================================================
   PARTE 2 — Componentes del hub
   Extraidos de Dashboard.module.css: es la pantalla de seleccion
   de plantas. Badges, candados, estrellas, linea de tiempo,
   tarjetas con barrido de escaner.
   ============================================================= */

/* ---------- 10. TOKENS ADICIONALES ---------- */

:root {
  /* Oro de las estrellas y el puntaje */
  --gold: #ffc23d;
  --gold-deep: #ffaa00;

  /* LED apagado */
  --led-off: #3b4560;

  /* Boton primario solido (el "EMPEZAR" del hub). Es distinto al
     pulsador: este es cian lleno y pide el click. */
  --cta-face: linear-gradient(180deg, #35dfff 0%, #00c2ea 55%, #00a8cc 100%);
  --cta-text: #04222e;
  --cta-border: #0891b2;
  --cta-border-top: #7deaff;
  --cta-edge: #056e8a;

  /* Dificultad. Es semaforo: verde facil, ambar medio, rojo dificil. */
  --diff-inicial: #00e676;
  --diff-intermedio: #ffaa00;
  --diff-avanzado: #ff4444;

  /* Linea de la grilla de fondo */
  --grid-line: rgba(140, 170, 255, 0.025);
}

/* ---------- 11. FONDO DE PAGINA CON GRILLA ---------- */

/* El fondo real del hub: resplandor cian arriba + grilla tenue de 40px. */
.arsim-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 40% at 50% -5%, rgba(0, 212, 255, 0.07), transparent),
    repeating-linear-gradient(0deg, transparent 0 39px, var(--grid-line) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, var(--grid-line) 39px 40px),
    var(--bg-primary);
}

/* ---------- 12. TITULO CON BARRA ---------- */

/* El titulo de seccion lleva una barra cian encendida a la izquierda. */
.arsim-title-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.arsim-title-bar::before {
  content: '';
  width: 4px;
  height: 1.05em;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* ---------- 13. BADGE DE DIFICULTAD ---------- */

.arsim-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-chip);
  border: 1px solid;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  flex-shrink: 0;
}

/* El patron es siempre igual: texto al 100%, borde al 27%, fondo al 8%. */
.arsim-badge--inicial {
  color: var(--diff-inicial);
  border-color: rgba(0, 230, 118, 0.27);
  background: rgba(0, 230, 118, 0.08);
}

.arsim-badge--intermedio {
  color: var(--diff-intermedio);
  border-color: rgba(255, 170, 0, 0.27);
  background: rgba(255, 170, 0, 0.08);
}

.arsim-badge--avanzado {
  color: var(--diff-avanzado);
  border-color: rgba(255, 68, 68, 0.27);
  background: rgba(255, 68, 68, 0.08);
}

/* ---------- 14. LED DE ESTADO CON ETIQUETA ---------- */

.arsim-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.arsim-state-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.5);
  background: var(--led-off);
  flex-shrink: 0;
}

.arsim-state-led--on {
  background: var(--accent);
  box-shadow: 0 0 5px var(--accent);
  animation: arsimLedPulse 2.2s ease-in-out infinite;
}

.arsim-state-led--done {
  background: var(--success);
  box-shadow: 0 0 5px var(--success);
}

@keyframes arsimLedPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* ---------- 15. PROGRESO Y ESTRELLAS ---------- */

.arsim-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
}

.arsim-progress {
  width: 110px;
  height: 6px;
  border-radius: var(--r-chip);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.arsim-progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  box-shadow: 0 0 8px rgba(255, 194, 61, 0.6);
  border-radius: var(--r-chip);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.arsim-stars {
  display: flex;
  gap: 1px;
  font-size: 0.55rem;
  line-height: 1;
}

.arsim-star--on {
  color: var(--gold);
}

.arsim-star--off {
  color: rgba(255, 255, 255, 0.13);
}

/* ---------- 16. LINEA DE TIEMPO ---------- */

.arsim-step {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.arsim-step--active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.35);
}

.arsim-step--done {
  border-color: var(--success);
  color: var(--success);
}

/* Rieles punteados que unen los pasos */
.arsim-track {
  flex: 1;
  width: 2px;
  min-height: 24px;
  background: repeating-linear-gradient(180deg, var(--border) 0 6px, transparent 6px 12px);
}

.arsim-track--h {
  width: auto;
  height: 2px;
  min-height: 0;
  background: repeating-linear-gradient(90deg, var(--border) 0 6px, transparent 6px 12px);
}

/* ---------- 17. TARJETA DE ESCENA ---------- */

.arsim-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  overflow: hidden;
  transition: all 0.25s;
}

.arsim-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px var(--border-accent),
    0 0 30px rgba(0, 212, 255, 0.07);
}

.arsim-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 21, 38, 0.6);
}

.arsim-card-head .arsim-badge {
  margin-left: auto;
}

.arsim-card-body {
  padding: 20px;
}

.arsim-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 8px;
}

.arsim-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- 18. MINIATURA CON BARRIDO DE ESCANER ---------- */

.arsim-thumb {
  position: relative;
  height: 160px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.arsim-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.arsim-card:hover .arsim-thumb img {
  transform: scale(1.04);
}

/* Vineteado: oscurece arriba y abajo para que el texto se lea */
.arsim-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(13, 21, 38, 0.35) 0%,
      transparent 30% 62%,
      rgba(15, 27, 53, 0.9) 100%
    ),
    radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(6, 10, 20, 0.5) 100%);
}

/* La linea de escaner que baja al pasar el mouse. Es marca registrada
   de ARSIM: no la saques. */
.arsim-thumb::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -8%;
  height: 6%;
  z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(0, 212, 255, 0.28), transparent);
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.25);
  opacity: 0;
  pointer-events: none;
}

.arsim-card:hover .arsim-thumb::before {
  animation: arsimScan 1.6s ease-in-out infinite;
}

@keyframes arsimScan {
  0% {
    top: -8%;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    top: 104%;
    opacity: 0;
  }
}

/* ---------- 19. CANDADO / CONTENIDO BLOQUEADO ---------- */

.arsim-lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  background: rgba(6, 10, 20, 0.35);
}

.arsim-lock-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.arsim-lock-text {
  font-size: 0.78rem;
  color: var(--text-mid);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  text-wrap: balance;
}

.arsim-lock-text strong {
  color: var(--text-primary);
}

/* Aviso ambar con borde punteado */
.arsim-note {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 1px;
  color: var(--warning);
  border: 1px dashed rgba(255, 170, 0, 0.4);
  border-radius: var(--r-control);
  padding: 3px 8px;
  background: rgba(6, 10, 20, 0.55);
}

/* ---------- 20. BOTON PRIMARIO SOLIDO ---------- */

/* Diferencia con .arsim-btn: el pulsador es oscuro y discreto; este es
   cian lleno y grita "clickeame". Uno por pantalla. */
.arsim-cta {
  position: relative;
  overflow: hidden;
  display: inline-block;
  background: var(--cta-face);
  color: var(--cta-text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: var(--r-panel);
  border: 1px solid var(--cta-border);
  border-top-color: var(--cta-border-top);
  cursor: pointer;
  box-shadow:
    0 3px 0 var(--cta-edge),
    0 4px 12px rgba(0, 212, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
}

.arsim-cta:hover {
  filter: brightness(1.08) saturate(1.1);
  transform: translateY(-1px);
  box-shadow:
    0 4px 0 var(--cta-edge),
    0 8px 24px rgba(0, 212, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.arsim-cta:active {
  transform: translateY(2px);
  box-shadow:
    0 0 0 var(--cta-edge),
    inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Destello que cruza el boton al pasar el mouse */
.arsim-cta::after {
  content: '';
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -30%;
  width: 30%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  opacity: 0;
}

.arsim-cta:hover::after {
  animation: arsimShine 0.7s ease 0.1s;
}

@keyframes arsimShine {
  from {
    left: -30%;
    opacity: 1;
  }
  to {
    left: 130%;
    opacity: 1;
  }
}

/* ---------- 21. FICHA NUMERADA ---------- */

.arsim-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.arsim-tile-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-panel);
  background: var(--btn-face);
  border: 1px solid var(--btn-line);
  border-top-color: #3a5486;
  color: var(--text-mid);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--btn-edge);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease,
    color 0.12s ease;
}

.arsim-tile-btn:hover {
  filter: brightness(1.2);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 var(--btn-edge);
}

.arsim-tile-btn:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 var(--btn-edge);
}
