/* ═══════════════════════════════════════════
   ASISTENTE WIDGET — Panel derecho integrado
═══════════════════════════════════════════ */

/* ── CAMPO RESALTADO ─────────────────────── */
.campo-asistente-activo {
  outline: 2.5px solid #00b4ff !important;
  box-shadow: 0 0 0 4px rgba(0,180,255,0.18), 0 0 20px rgba(0,180,255,0.25) !important;
  border-radius: 6px;
  transition: all 0.3s;
  animation: pulsoCampo 2.2s infinite;
}
@keyframes pulsoCampo {
  0%,100% { box-shadow: 0 0 0 4px rgba(0,180,255,0.18), 0 0 20px rgba(0,180,255,0.25); }
  50%      { box-shadow: 0 0 0 7px rgba(0,180,255,0.10), 0 0 32px rgba(0,180,255,0.40); }
}

/* ── TOGGLE BUTTON ───────────────────────── */
#ast-toggle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1100;
  background: linear-gradient(180deg, #003daa, #0077ee);
  color: white;
  border: none;
  width: 52px;
  padding: 22px 0;
  border-radius: 14px 0 0 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: -4px 0 24px rgba(0,120,255,0.55), 0 0 0 1px rgba(0,160,255,0.25);
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  writing-mode: vertical-rl;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-right: none;
  animation: astPulse 2.8s ease-in-out infinite;
}
#ast-toggle:hover {
  background: linear-gradient(180deg, #0055cc, #0099ff);
  width: 60px;
  box-shadow: -6px 0 32px rgba(0,140,255,0.7), 0 0 0 1px rgba(0,180,255,0.4);
  animation: none;
}
#ast-toggle .ast-toggle-icon {
  font-size: 24px;
  writing-mode: horizontal-tb;
  filter: drop-shadow(0 0 6px rgba(120,200,255,0.8));
}

/* Efecto pulso de atención */
@keyframes astPulse {
  0%,100% {
    box-shadow: -4px 0 24px rgba(0,120,255,0.55), 0 0 0 1px rgba(0,160,255,0.25);
    width: 52px;
  }
  45% {
    box-shadow: -8px 0 36px rgba(0,160,255,0.8), 0 0 0 4px rgba(0,180,255,0.18), -14px 0 50px rgba(0,100,255,0.3);
    width: 58px;
  }
}

/* Indicador "nuevo" parpadeante */
#ast-toggle::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #00ffaa;
  box-shadow: 0 0 8px #00ffaa;
  animation: astDotBlink 2s infinite;
  writing-mode: horizontal-tb;
}
@keyframes astDotBlink {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* Ocultar indicador cuando está abierto */
#ast-overlay.ast-open ~ #ast-toggle::before,
body.ast-is-open #ast-toggle::before { display: none; }

/* ── OVERLAY ─────────────────────────────── */
#ast-overlay {
  position: fixed;
  top: 0; right: -430px;
  width: 400px;
  height: 100vh;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}
#ast-overlay.ast-open {
  right: 0;
  pointer-events: all;
}

/* Cuando está abierto: mover el toggle a la derecha del panel */
#ast-overlay.ast-open + #ast-toggle {
  right: 400px;
  border-radius: 14px 0 0 14px;
  animation: none;
}
#ast-overlay.ast-open + #ast-toggle::before { display: none; }

/* ── PANEL (la "pequeña pantalla") ───────── */
.ast-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #040d1a;
  border-left: 1px solid rgba(0,140,255,0.2);
  border-top: 1px solid rgba(0,140,255,0.15);
  border-bottom: 1px solid rgba(0,140,255,0.15);
  box-shadow: -8px 0 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,100,200,0.08);
  overflow: hidden;
}

/* scanline sutil */
.ast-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 0;
}

/* ── TOP BAR ─────────────────────────────── */
.ast-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0,30,70,0.9);
  border-bottom: 1px solid rgba(0,140,255,0.2);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.ast-topbar-left {
  display: flex; align-items: center; gap: 8px;
}
.ast-logo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #00b4ff;
  animation: blinkDot 2s infinite;
  box-shadow: 0 0 6px #00b4ff;
}
@keyframes blinkDot { 0%,100%{opacity:1} 50%{opacity:0.3} }
.ast-logo-text {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #00b4ff;
  text-transform: uppercase;
}
.ast-close-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  width: 24px; height: 24px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.ast-close-btn:hover { color: white; background: rgba(255,255,255,0.12); }

/* ── PROGRESS ────────────────────────────── */
.ast-progress-wrap {
  padding: 10px 14px 0;
  flex-shrink: 0;
  position: relative; z-index: 1;
}
.ast-progress-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.ast-step-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
}
.ast-step-num {
  font-size: 11px;
  font-weight: 700;
  color: #00b4ff;
  font-family: monospace;
}
.ast-prog-bar-bg {
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}
.ast-prog-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0055cc, #00b4ff);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 8px rgba(0,180,255,0.5);
}

/* ── SCROLL AREA ─────────────────────────── */
.ast-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  position: relative; z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ast-scroll::-webkit-scrollbar { width: 3px; }
.ast-scroll::-webkit-scrollbar-thumb { background: rgba(0,180,255,0.25); border-radius: 2px; }

/* ── STEP HERO ───────────────────────────── */
.ast-step-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(0,60,120,0.25);
  border: 1px solid rgba(0,140,255,0.18);
}
.ast-step-emoji {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
}
.ast-step-hero-info {}
.ast-step-group {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00b4ff;
  font-weight: 700;
  margin-bottom: 4px;
}
.ast-step-title {
  font-size: 15px;
  font-weight: 700;
  color: #e8f4ff;
  line-height: 1.25;
}

/* ── BLOCKS ──────────────────────────────── */
.ast-block {
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  padding: 12px 13px;
}
.ast-block-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.ast-block-title .bdot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #00b4ff;
  flex-shrink: 0;
}
.ast-block-desc {
  font-size: 12.5px;
  color: rgba(200,220,240,0.85);
  line-height: 1.65;
}
.ast-block.inf { border-left: 2px solid rgba(251,191,36,0.6); background: rgba(251,191,36,0.03); }
.ast-block.inf .ast-block-title { color: #fbbf24; }
.ast-block.inf .bdot { background: #fbbf24; }
.ast-block.tip { border-left: 2px solid rgba(52,211,153,0.6); background: rgba(52,211,153,0.03); }
.ast-block.tip .ast-block-title { color: #34d399; }
.ast-block.tip .bdot { background: #34d399; }
.ast-block.que { border-left: 2px solid rgba(0,180,255,0.6); }
.ast-block.que .ast-block-title { color: #00b4ff; }

/* Valores típicos */
.ast-values {
  display: flex; flex-direction: column; gap: 5px;
  margin-top: 2px;
}
.ast-val-row {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 11.5px;
  color: rgba(180,210,240,0.75);
  line-height: 1.4;
}
.ast-val-row::before {
  content: '›';
  color: #00b4ff;
  font-size: 12px;
  flex-shrink: 0;
  line-height: 1.4;
}
.ast-val-row.rec { color: #34d399; font-weight: 600; }
.ast-val-row.rec::before { color: #34d399; content: '★'; font-size: 10px; }

/* ── BOTTOM NAV ──────────────────────────── */
.ast-nav {
  padding: 12px 14px;
  border-top: 1px solid rgba(0,140,255,0.15);
  background: rgba(0,20,50,0.8);
  flex-shrink: 0;
  position: relative; z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ast-nav-buttons {
  display: flex; gap: 8px;
}
.ast-btn-prev,
.ast-btn-next {
  flex: 1;
  padding: 9px 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  border: none;
}
.ast-btn-prev {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
}
.ast-btn-prev:hover:not(:disabled) { background: rgba(255,255,255,0.1); color: white; }
.ast-btn-prev:disabled { opacity: 0.25; cursor: default; }
.ast-btn-next {
  background: linear-gradient(135deg, #0055cc, #0099ff);
  color: white;
  box-shadow: 0 3px 14px rgba(0,100,220,0.4);
}
.ast-btn-next:hover { background: linear-gradient(135deg, #0066dd, #00aaff); transform: translateY(-1px); }
.ast-btn-next.final { background: linear-gradient(135deg, #059669, #34d399); box-shadow: 0 3px 14px rgba(52,211,153,0.35); }

/* Ir al campo */
.ast-ir-campo {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px;
  color: rgba(0,180,255,0.75);
  cursor: pointer;
  transition: color 0.18s;
  background: none; border: none;
  width: 100%;
}
.ast-ir-campo:hover { color: #00b4ff; }

/* ── DOTS ────────────────────────────────── */
.ast-dots {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; flex-wrap: wrap;
  padding: 6px 0 2px;
}
.ast-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  cursor: pointer; transition: all 0.18s;
}
.ast-dot.active { background: #00b4ff; width: 16px; border-radius: 3px; }
.ast-dot.done   { background: #34d399; }

/* ── FINALIZADO ──────────────────────────── */
.ast-final {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 14px; padding: 20px 14px;
}
.ast-final-icon { font-size: 48px; }
.ast-final h3 { font-size: 16px; font-weight: 700; color: #34d399; }
.ast-final p { font-size: 12.5px; color: rgba(200,220,240,0.8); line-height: 1.6; }
.ast-final-btns { display: flex; gap: 8px; flex-direction: column; width: 100%; }
.ast-btn-reiniciar {
  padding: 9px; border-radius: 7px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.18s;
}
.ast-btn-reiniciar:hover { background: rgba(255,255,255,0.1); color: white; }
.ast-btn-calcular-final {
  padding: 11px; border-radius: 7px; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, #059669, #34d399);
  color: white; border: none; cursor: pointer;
  box-shadow: 0 3px 14px rgba(52,211,153,0.3); transition: all 0.18s;
}
.ast-btn-calcular-final:hover { opacity: 0.9; transform: translateY(-1px); }
