/**
 * «¿En cuál sigues?» — modal al terminar la tarea en curso (js/siguiente.js).
 * Cabecera de celebración (check + confeti), tarjeta destacada y filas con atajos.
 * @author Aris Mota <soy@aris.do>
 * @version 3.198.0
 */

.modal.crm-sig {
  --sig-navy: #06223f;
  --sig-azul: #004481;
  --sig-cian: #00a9e0;
  --sig-verde: #22c55e;
  --sig-texto: #102a43;
  --sig-sec: #52606d;
  --sig-muted: #7b8794;
  --sig-borde: #e4e9f0;
  --sig-suave: #f4f7fa;
  background: transparent;
  padding: 0;
  font-style: normal;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.crm-sig .modal-dialog {
  max-width: 560px;
}

.crm-sig *,
.crm-sig input::placeholder {
  font-style: normal;
}

.crm-sig .modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(6, 34, 63, 0.35), 0 0 0 1px rgba(6, 34, 63, 0.04);
}

.crm-sig.fade .modal-dialog {
  transform: translateY(16px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.crm-sig.show .modal-dialog {
  transform: none;
}

.crm-sig kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 5px;
  background: #eef1f5;
  box-shadow: inset 0 -1px 0 #d6dde6;
  color: var(--sig-sec);
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

/* ---------- Cabecera de celebración ---------- */

.crm-sig__hero {
  position: relative;
  flex-shrink: 0;
  padding: 28px 28px 22px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(34, 197, 94, 0.32) 0%, rgba(34, 197, 94, 0) 60%),
    radial-gradient(90% 80% at 100% 100%, rgba(0, 169, 224, 0.28) 0%, rgba(0, 169, 224, 0) 60%),
    var(--sig-navy);
  color: #f4f7f9;
  text-align: center;
}

.crm-sig__cerrar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(244, 247, 249, 0.7);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.crm-sig__cerrar:hover,
.crm-sig__cerrar:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  outline: none;
}

.crm-sig__check {
  position: relative;
  z-index: 1;
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--sig-verde);
  box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.16), 0 10px 30px rgba(34, 197, 94, 0.45);
}

.crm-sig__check svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #fff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-sig__check circle {
  stroke: none;
}

.crm-sig__check path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
}

.crm-sig.show .crm-sig__check {
  animation: crm-sig-pop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}

.crm-sig.show .crm-sig__check path {
  animation: crm-sig-trazo 0.4s 0.25s ease-out forwards;
}

.crm-sig.show .crm-sig__check::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--sig-verde);
  animation: crm-sig-onda 1s 0.2s ease-out both;
}

.crm-sig__confeti {
  position: absolute;
  top: 58px;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.crm-sig__confeti i {
  position: absolute;
  top: 0;
  left: 0;
  width: 7px;
  height: 11px;
  margin: -5px 0 0 -3px;
  border-radius: 2px;
  background: var(--c);
  opacity: 0;
}

.crm-sig.show .crm-sig__confeti i {
  animation: crm-sig-confeti 1.1s calc(0.2s + var(--t)) cubic-bezier(0.15, 0.7, 0.3, 1) both;
}

.crm-sig__kicker {
  position: relative;
  margin: 0 0 4px;
  color: #86efac;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.crm-sig__titulo {
  position: relative;
  display: -webkit-box;
  margin: 0 auto;
  max-width: 440px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #fff;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.crm-sig__chips {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}

.crm-sig__chips span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(244, 247, 249, 0.85);
  font-size: 0.75rem;
  font-weight: 500;
}

/* ---------- Cuerpo ---------- */

.crm-sig__cuerpo {
  padding: 20px 20px 8px;
  background: #fff;
}

.crm-sig__pregunta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0 0 12px;
  color: var(--sig-texto);
  font-size: 1.0625rem;
  font-weight: 700;
}

.crm-sig__modo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #fff1ec;
  color: #c2410c;
  font-size: 0.75rem;
  font-weight: 600;
}

.crm-sig__buscar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0 12px;
  height: 42px;
  border: 1px solid var(--sig-borde);
  border-radius: 12px;
  background: var(--sig-suave);
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.crm-sig__buscar:focus-within {
  border-color: var(--sig-cian);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 169, 224, 0.14);
}

.crm-sig__buscar > i {
  color: var(--sig-muted);
  font-size: 1.125rem;
}

.crm-sig__buscar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--sig-texto);
  font-size: 0.9375rem;
}

.crm-sig__buscar input::placeholder {
  color: #9aabba;
}

.crm-sig--buscando .crm-siguiente-listas {
  display: none;
}

/* Tarjeta destacada (primera de la cola) */
.crm-sig__destacada {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #004481 0%, #0063b1 60%, #0089cf 100%);
  box-shadow: 0 10px 24px rgba(0, 68, 129, 0.28);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.crm-sig__destacada::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  background-size: 250% 100%;
  background-position: 120% 0;
  pointer-events: none;
}

.crm-sig.show .crm-sig__destacada::after {
  animation: crm-sig-brillo 1.4s 0.7s ease-out both;
}

.crm-sig__destacada:hover,
.crm-sig__destacada:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 68, 129, 0.36), 0 0 0 3px rgba(0, 169, 224, 0.45);
}

.crm-sig__destacada-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.crm-sig__sugerida {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crm-sig__destacada-tarea {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
}

.crm-sig__destacada .crm-sig__meta,
.crm-sig__destacada .crm-sig__meta .crm-sig__proy {
  color: rgba(255, 255, 255, 0.78);
}

.crm-sig__destacada .crm-sig__fecha--tarde {
  color: #fecaca;
}

.crm-sig__empezar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 8px 14px 8px 12px;
  border-radius: 10px;
  background: #fff;
  color: var(--sig-azul);
  font-size: 0.875rem;
  font-weight: 700;
}

.crm-sig__empezar kbd {
  margin-left: 4px;
}

/* Grupos y filas */
.crm-sig__grupo {
  margin: 0 0 14px;
}

.crm-sig__grupo-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 4px 6px;
  color: var(--sig-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.crm-sig__grupo-titulo span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.crm-sig__grupo-titulo b {
  padding: 0 7px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--sig-sec);
  font-size: 0.6875rem;
  line-height: 1.6;
  letter-spacing: 0;
}

.crm-sig__lista {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crm-sig__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--sig-texto);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s;
}

.crm-sig__item:hover,
.crm-sig__item:focus-visible {
  outline: none;
  background: var(--sig-suave);
  box-shadow: inset 0 0 0 1px var(--sig-borde);
}

.crm-sig__item--extra {
  display: none;
}

.crm-sig__grupo--todo .crm-sig__item--extra {
  display: flex;
  animation: crm-sig-entra 0.25s ease-out both;
}

.crm-sig__n {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #eef1f5;
  color: var(--sig-muted);
  font-size: 0.75rem;
  font-weight: 700;
  transition: background 0.12s, color 0.12s;
}

.crm-sig__n:empty {
  visibility: hidden;
}

.crm-sig__item:hover .crm-sig__n,
.crm-sig__item:focus-visible .crm-sig__n {
  background: var(--sig-azul);
  color: #fff;
}

.crm-sig__txt {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.crm-sig__tarea {
  overflow: hidden;
  color: var(--sig-texto);
  font-size: 0.9063rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.crm-sig__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  color: var(--sig-muted);
  font-size: 0.75rem;
}

.crm-sig__meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.crm-sig__meta .crm-sig__proy {
  color: var(--sig-sec);
  font-weight: 600;
}

.crm-sig__fecha--tarde {
  color: #d64545;
  font-weight: 600;
}

.crm-sig__fecha--hoy {
  color: #0e9f6e;
  font-weight: 600;
}

.crm-sig__fecha--pronto {
  color: #b7791f;
  font-weight: 600;
}

.crm-sig__tag {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.crm-sig__tag--rojo {
  background: #fff0f0;
  color: #c53030;
}

.crm-sig__tag--ambar {
  background: #fff8e6;
  color: #975a16;
}

.crm-sig__tag--azul {
  background: #e5f7fc;
  color: #00749c;
}

.crm-sig__destacada .crm-sig__tag {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.crm-sig__play {
  flex-shrink: 0;
  color: var(--sig-azul);
  font-size: 1rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.12s, transform 0.12s;
}

.crm-sig__item:hover .crm-sig__play,
.crm-sig__item:focus-visible .crm-sig__play {
  opacity: 1;
  transform: none;
}

.crm-sig__mas {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0 0 48px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sig-azul);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.crm-sig__mas:hover,
.crm-sig__mas:focus-visible {
  outline: none;
  background: #eaf2f9;
}

.crm-sig__vacio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 16px;
  padding: 18px;
  border-radius: 12px;
  background: var(--sig-suave);
  color: var(--sig-muted);
  font-size: 0.875rem;
  text-align: center;
}

.crm-sig__vacio i {
  font-size: 1.25rem;
}

.crm-sig__vacio--fin {
  color: #0e9f6e;
  background: #eaf8f3;
}

.crm-sig__spin {
  width: 14px;
  height: 14px;
  border: 2px solid #d6dde6;
  border-top-color: var(--sig-cian);
  border-radius: 50%;
  animation: crm-sig-gira 0.7s linear infinite;
}

/* Entrada escalonada */
.crm-sig.show .crm-sig__pregunta,
.crm-sig.show .crm-sig__buscar,
.crm-sig.show .crm-sig__destacada,
.crm-sig.show .crm-sig__grupo {
  animation: crm-sig-entra 0.4s ease-out both;
}

.crm-sig.show .crm-sig__buscar { animation-delay: 0.08s; }
.crm-sig.show .crm-sig__destacada { animation-delay: 0.16s; }
.crm-sig.show .crm-sig__grupo { animation-delay: 0.24s; }
.crm-sig.show .crm-sig__grupo + .crm-sig__grupo { animation-delay: 0.32s; }

/* ---------- Pie ---------- */

.crm-sig__pie {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--sig-borde);
  background: #fafbfc;
}

.crm-sig__atajos {
  color: var(--sig-muted);
  font-size: 0.75rem;
}

.crm-sig__atajos kbd {
  margin: 0 1px;
}

.crm-sig__ahora-no {
  margin-left: auto;
  padding: 7px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--sig-sec);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.crm-sig__ahora-no:hover,
.crm-sig__ahora-no:focus-visible {
  outline: none;
  background: #eef1f5;
  color: var(--sig-texto);
}

/* ---------- Animaciones ---------- */

@keyframes crm-sig-pop {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes crm-sig-trazo {
  to { stroke-dashoffset: 0; }
}

@keyframes crm-sig-onda {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.9); opacity: 0; }
}

@keyframes crm-sig-confeti {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) rotate(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) rotate(var(--r)); }
}

@keyframes crm-sig-brillo {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

@keyframes crm-sig-entra {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes crm-sig-gira {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .crm-sig *,
  .crm-sig *::before,
  .crm-sig *::after,
  .crm-sig.fade .modal-dialog {
    animation: none !important;
    transition: none !important;
  }

  .crm-sig__check path {
    stroke-dashoffset: 0;
  }

  .crm-sig__confeti {
    display: none;
  }
}

@media (max-width: 575px) {
  .crm-sig .modal-dialog {
    margin: 12px;
  }

  .crm-sig__hero {
    padding: 24px 18px 18px;
  }

  .crm-sig__cuerpo {
    padding: 16px 12px 4px;
  }

  .crm-sig__atajos {
    display: none;
  }

  .crm-sig__item .crm-sig__tag {
    display: none;
  }
}
