/* La ventana del chat, dentro del iframe. --cb es el color de la clínica. */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #1f2933;
  background: #fff;
}
body.fijo { background: transparent; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.chat { display: flex; flex-direction: column; height: 100%; background: #f6f7f9; }
body.fijo .chat { border: 1px solid #e3e6ea; border-radius: 12px; overflow: hidden; }

.chat__cab {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px 12px 14px; background: var(--cb); color: #fff;
}
.chat__avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
  background: rgba(255, 255, 255, .22);
}
.chat__quien { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat__quien span { font-size: 12.5px; opacity: .88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__icono {
  flex: none; width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center;
}
.chat__icono:hover, .chat__icono:focus-visible { background: rgba(255, 255, 255, .18); outline: none; }

.chat__prueba { padding: 6px 14px; background: #fff7e0; color: #7a5a00; font-size: 12.5px; text-align: center; }

.chat__mensajes { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.msj {
  max-width: 86%; padding: 9px 12px; border-radius: 14px; word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}
.msj p { margin: 0 0 6px; }
.msj p:last-child { margin: 0; }
.msj ul { margin: 4px 0; padding-left: 18px; }
.msj--bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.msj--yo { align-self: flex-end; background: var(--cb); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }

.escribiendo { display: flex; gap: 4px; padding: 12px 14px; }
.escribiendo span { width: 7px; height: 7px; border-radius: 50%; background: #9aa5b1; animation: punto 1.2s infinite; }
.escribiendo span:nth-child(2) { animation-delay: .2s; }
.escribiendo span:nth-child(3) { animation-delay: .4s; }
@keyframes punto { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat__sugeridas { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--cb); color: var(--cb); background: #fff;
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13.5px; cursor: pointer; text-align: left;
}
.chip:hover, .chip:focus-visible { background: var(--cb); color: #fff; outline: none; }

.accion {
  align-self: flex-start; display: inline-block; padding: 9px 16px; border-radius: 10px;
  background: var(--cb); color: #fff; text-decoration: none; font-weight: 600;
}

.datos {
  align-self: stretch; background: #fff; border: 1px solid #e3e6ea; border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.datos__titulo { margin: 0; font-weight: 600; }
.datos label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: #52606d; }
.datos input:not([type=checkbox]), .datos textarea {
  font: inherit; color: #1f2933; padding: 8px 10px; border: 1px solid #cbd2d9; border-radius: 8px; width: 100%;
}
.datos input:focus, .datos textarea:focus { outline: 2px solid var(--cb); outline-offset: -1px; border-color: transparent; }
.datos .datos__ok { flex-direction: row; align-items: flex-start; gap: 8px; color: #1f2933; }
.datos .datos__ok input { margin-top: 3px; flex: none; }
.datos .trampa { position: absolute; left: -9999px; }
.datos__error { margin: 0; color: #b42318; font-size: 13px; }
.datos button {
  border: 0; border-radius: 10px; padding: 10px; background: var(--cb); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.datos button:disabled { opacity: .6; cursor: wait; }

.chat__enviar { display: flex; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid #e3e6ea; }
.chat__enviar textarea {
  flex: 1; resize: none; font: inherit; padding: 9px 12px; border: 1px solid #cbd2d9; border-radius: 12px; max-height: 120px;
}
.chat__enviar textarea:focus { outline: 2px solid var(--cb); outline-offset: -1px; border-color: transparent; }
.chat__enviar button {
  flex: none; width: 42px; border: 0; border-radius: 12px; background: var(--cb); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.chat__pie { padding: 6px 12px 8px; font-size: 11px; color: #7b8794; text-align: center; background: #fff; }
