/* AskRoby public pre-signup chat assistant — self-contained widget for the static
   marketing landing (light.html + dark.html). Vanilla, no dependencies. Theme is
   auto-detected from the page background luminance (see assistant-widget.js). */

#roby-assistant, #roby-assistant * { box-sizing: border-box; }

#roby-assistant {
  --ra-blue: #2563eb;
  --ra-purple: #7c3aed;
  --ra-surface: #ffffff;
  --ra-text: #0f172a;
  --ra-muted: #64748b;
  --ra-border: #e5e9f0;
  --ra-bot-bg: #f1f5f9;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  font-family: inherit;
}
#roby-assistant.ra-dark {
  --ra-surface: #161b26;
  --ra-text: #e8edf6;
  --ra-muted: #9aa6bb;
  --ra-border: #2c3442;
  --ra-bot-bg: #222a38;
}

/* El lanzador: una pastilla que dice lo que es, no un círculo mudo. Misma forma que en
   RobyBusinessSystems y RobyContracts. */
.ra-fab {
  height: 48px;
  padding: 0 20px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--ra-blue), var(--ra-purple));
  color: #fff;
  font-size: 14px; font-weight: 600; font-family: inherit;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.35);
  display: flex; align-items: center; gap: 10px;
  transition: transform .15s ease;
}
.ra-fab:hover { transform: scale(1.03); }
@media (max-width: 480px) {
  .ra-fab { padding: 0 16px; }
  .ra-fab-text { display: none; }
}

/* El mismo asistente en WhatsApp, justo encima. Verde de WhatsApp porque es el único
   botón flotante que lleva fuera del sitio, y debe parecerlo. */
.ra-wa {
  position: absolute;
  right: 0; bottom: 68px;
  width: 56px; height: 56px;
  border-radius: 9999px;
  background: #25D366;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.35);
  transition: transform .15s ease;
}
.ra-wa:hover { transform: scale(1.05); }
#roby-assistant.ra-open .ra-wa { display: none; }

/* Panel */
.ra-panel {
  width: 380px;
  max-width: calc(100vw - 32px);
  height: min(560px, 80vh);
  max-height: calc(100vh - 120px);
  background: var(--ra-surface);
  color: var(--ra-text);
  border: 1px solid var(--ra-border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#roby-assistant.ra-open .ra-panel { display: flex; }
#roby-assistant.ra-open .ra-fab { display: none; }

/* Cabecera blanca sobre el degradado suave, como en los otros dos. */
.ra-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(124,58,237,.08));
  border-bottom: 1px solid var(--ra-border);
  color: var(--ra-text);
}
.ra-head .ra-head-text { min-width: 0; }
.ra-head .ra-title { font-weight: 700; font-size: 14px; line-height: 1.2; }
.ra-head .ra-sub { margin-top: 2px; font-size: 11px; line-height: 1.35; color: var(--ra-muted); }
.ra-exits { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }
.ra-min, .ra-close {
  border: 1px solid var(--ra-border); background: var(--ra-surface);
  border-radius: 9999px; padding: 4px 12px;
  font-size: 11px; font-weight: 600; font-family: inherit;
  color: var(--ra-muted); cursor: pointer;
}
.ra-min:hover, .ra-close:hover { color: var(--ra-text); }

/* Preguntas sugeridas: lista vertical que sigue disponible después de contestar. */
.ra-sugs { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.ra-sugs-title {
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ra-muted);
}
.ra-sug {
  width: 100%; text-align: left;
  border: 1px solid var(--ra-border); background: var(--ra-surface);
  border-radius: 12px; padding: 10px 14px;
  font-size: 13.5px; font-family: inherit; color: var(--ra-text); cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.ra-sug:hover { border-color: rgba(37,99,235,.4); background: rgba(37,99,235,.04); }

.ra-body {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.ra-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.ra-msg.user { align-self: flex-end; background: var(--ra-blue); color: #fff; border-bottom-right-radius: 4px; }
.ra-msg.bot { align-self: flex-start; background: var(--ra-bot-bg); color: var(--ra-text); border-bottom-left-radius: 4px; }
.ra-msg.bot a { color: var(--ra-blue); }
.ra-msg.bot .ra-action {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; margin-top: 12px; padding: 9px 14px;
  border-radius: 10px; background: linear-gradient(135deg, var(--ra-blue), var(--ra-purple));
  color: #fff; font-weight: 700; text-align: center; text-decoration: none;
}
.ra-typing { align-self: flex-start; color: var(--ra-muted); font-size: 12px; }

.ra-foot { padding: 12px; border-top: 1px solid var(--ra-border); }
.ra-row { display: flex; align-items: flex-end; gap: 8px; }
.ra-note {
  margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; justify-content: space-between;
}
.ra-disclaimer { font-size: 11px; line-height: 1.35; color: var(--ra-muted); }
.ra-wa-link { font-size: 11px; font-weight: 600; color: var(--ra-blue); text-decoration: none; flex-shrink: 0; }
.ra-wa-link:hover { text-decoration: underline; }
.ra-input {
  flex: 1; min-width: 0;
  min-height: 96px; max-height: 160px; resize: none; overflow-y: auto;
  border: 1px solid var(--ra-border); border-radius: 10px;
  padding: 9px 11px; font-size: 13.5px; font-family: inherit;
  background: var(--ra-surface); color: var(--ra-text); outline: none;
}
.ra-input:focus { border-color: var(--ra-blue); }
.ra-send {
  min-height: 44px; border: none; cursor: pointer; border-radius: 10px; padding: 0 14px;
  background: var(--ra-blue); color: #fff; font-size: 13px; font-weight: 600;
}
.ra-send:disabled { opacity: .5; cursor: default; }
