/* ═══════════════════════════════════════════════════════════════════
   HALYON — tareas.css
   Automatizaciones: el recorrido real de un pedido. Entra por WhatsApp y
   las tareas se completan solas, una debajo de la otra, con el logo de
   cada herramienta y el tiempo que tardó.
   ═══════════════════════════════════════════════════════════════════ */
.tareas {
  width: 100%; max-width: 500px;
  background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: 18px;
  box-shadow: 0 40px 80px -48px rgba(26,23,18,0.45), 0 2px 0 rgba(255,255,255,0.8) inset;
  overflow: hidden;
}
.tareas-cab {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(37,211,102,0.07), transparent);
}
.tareas-cab .t-logo { width: 40px; height: 40px; }
.tareas-cab b { display: block; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.tareas-cab span { display: block; font-size: 13.5px; color: var(--ink-faint); margin-top: 2px; }
.tareas-cab time { font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.tareas-lista { list-style: none; margin: 0; padding: 8px 20px 6px; position: relative; }
/* línea que une los pasos y se va llenando */
.tareas-lista::before, .tareas-lista::after {
  content: ""; position: absolute; left: 39px; top: 30px; bottom: 30px; width: 1.5px; border-radius: 2px;
}
.tareas-lista::before { background: var(--line-soft); }
.tareas-lista::after { background: var(--gradient); transform-origin: top; transform: scaleY(var(--avance, 0)); transition: transform 0.6s var(--ease-out); }

.tarea {
  position: relative; display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 0;
}
.tarea + .tarea { border-top: 1px solid var(--line-soft); }
.t-marca {
  position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; background: #fff; border: 1px solid var(--line-soft);
  box-shadow: 0 6px 14px -10px rgba(26,23,18,0.4);
}
.t-marca img { width: 22px; height: 22px; object-fit: contain; }
.t-marca .t-ic { display: block; width: 20px; height: 20px; background: var(--ink-dim);
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.tarea b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.tarea div span { display: block; font-size: 13.5px; color: var(--ink-faint); margin-top: 1px; }
.t-estado { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.t-ok {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--line-soft); color: transparent; transition: background 0.3s, color 0.3s;
}
.t-ok::after { content: ""; width: 11px; height: 11px; background: currentColor;
  -webkit-mask: url(/assets/icons/lucide-check.svg) center / contain no-repeat; mask: url(/assets/icons/lucide-check.svg) center / contain no-repeat; }
.t-tiempo { opacity: 0; transition: opacity 0.3s; }

/* estados que maneja tareas.js */
.tareas.js .tarea { opacity: 0.32; transition: opacity 0.4s var(--ease-out); }
.tareas.js .tarea.hecha { opacity: 1; }
.tarea.hecha .t-ok { background: #1f9d55; color: #fff; }
.tarea.hecha .t-tiempo { opacity: 1; }
.tarea.en-curso .t-ok { background: none; border: 2px solid var(--line); border-top-color: var(--g-violet); animation: tGira 0.7s linear infinite; }
.tarea.en-curso .t-ok::after { display: none; }
@keyframes tGira { to { transform: rotate(360deg); } }

.tareas-pie {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--line-soft); background: var(--bg-2);
  font-size: 13.5px; color: var(--ink-dim);
}
.tareas-pie b { color: var(--ink); font-weight: 600; }
.tareas-repetir { color: var(--ink-dim); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-bright); }
.tareas-repetir:hover { color: var(--ink); }

@media (max-width: 480px) {
  .tareas-cab, .tarea { grid-template-columns: 34px 1fr auto; gap: 11px; }
  .tareas-cab .t-logo, .t-marca { width: 34px; height: 34px; }
  .tareas-lista::before, .tareas-lista::after { left: 36px; }
  .tarea b { font-size: 14px; } .tarea div span { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .tareas.js .tarea { opacity: 1; }
  .tarea.en-curso .t-ok { animation: none; }
}
