/* guided-chatbot.css — CHAT-001 · AI Intent Navigator
 * Se apoya en las clases ya existentes de .chat-panel/.chat-msg/.chat-row/etc.
 * (components.css) para mantener idéntico el lenguaje visual del sitio.
 * Reglas 100% aditivas: no redefine ni sobreescribe selectores existentes,
 * excepto ocultar el log/quick/form originales mientras el modo guiado está
 * activo (chat-panel--guided-active), reversible con "escribir libremente".
 */

.chat-panel--guided-active .chat-panel__log,
.chat-panel--guided-active .chat-quick,
.chat-panel--guided-active .chat-panel__form {
  display: none !important;
}

.guided-root {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel--guided-active .guided-root { display: flex; }

.guided-progress {
  position: relative;
  padding: 8px 16px 6px;
  font-size: 11px;
  color: var(--muted);
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.guided-progress::before {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: var(--guided-progress, 0%);
  background: var(--blue);
  transition: width .35s ease;
}
@media (prefers-reduced-motion: reduce) { .guided-progress::before { transition: none; } }

.guided-stream {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--cloud) 0%, #fff 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { .guided-stream { scroll-behavior: auto; } }

.guided-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
  margin-left: 28px; /* alinea bajo el avatar del bot */
  max-width: 88%;
}
.guided-option-btn {
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--navy);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.guided-option-btn:hover,
.guided-option-btn:focus-visible {
  border-color: var(--blue);
  background: #eaf4ff;
}
.guided-option-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.guided-option-btn--primary {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
  text-align: center;
}
.guided-option-btn--primary:hover { background: var(--blue-intense, #0F7FE0); }
.guided-options--answered .guided-option-btn { cursor: default; opacity: .55; }
.guided-options--answered .guided-option-btn:hover { border-color: var(--border); background: #fff; }

.guided-options--result { margin-left: 28px; }

.guided-freetext,
.guided-identification {
  margin-left: 28px;
  max-width: 88%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.guided-field-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.guided-textarea,
.guided-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: var(--font-body, inherit);
  outline: none;
  resize: vertical;
  min-height: 38px;
}
.guided-textarea { min-height: 64px; }
.guided-textarea:focus,
.guided-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23,139,239,.16);
}
.guided-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.guided-consent input { margin-top: 2px; accent-color: var(--blue); flex: none; }
.guided-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}
.guided-inline-actions .guided-option-btn--primary { flex: 1; }

.guided-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.chat-panel--guided-active .guided-footer,
.guided-footer { display: none; }
.chat-panel--guided-active .guided-footer { display: flex; }

.guided-link {
  background: none;
  border: 0;
  padding: 4px 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.guided-link:hover,
.guided-link:focus-visible { color: var(--blue); }
.guided-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.guided-whatsapp-btn { display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 480px) {
  .guided-options,
  .guided-freetext,
  .guided-identification,
  .guided-options--result { margin-left: 20px; max-width: 92%; }
}

/* Alto contraste: refuerza bordes cuando el usuario fuerza colores del SO. */
@media (forced-colors: active) {
  .guided-option-btn { border: 1px solid CanvasText; }
  .guided-option-btn--primary { border: 1px solid Highlight; }
}
