/* RESET BÁSICO */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
}

html, body {
    height: 100%;
    background-color: #f5f5f5;
}
/* Markdown styling inside assistant bubbles */
.message.assistant .bubble h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.message.assistant .bubble p {
  margin: 0 0 10px 0;
  line-height: 1.5;
}

.message.assistant .bubble p:last-child {
  margin-bottom: 0;
}

.message.assistant .bubble ul,
.message.assistant .bubble ol {
  margin: 8px 0 0 18px;
  padding: 0;
}

.message.assistant .bubble li {
  margin: 6px 0;
  line-height: 1.5;
}

.message.assistant .bubble strong {
  font-weight: 700;
}


/* CHAT ID */
.chat-id {
    margin-left: auto;
    font-size: 12px;
    color: #777;
    white-space: nowrap;
}

.chat-id span {
    font-weight: 600;
    color: #444;
}

/* CONTENEDOR GENERAL */
.chat-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* HEADER */
.chat-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #ddd;
}

.chat-header .logo img {
    height: 36px;
    width: auto;
}

.chat-header .title {
    margin-left: 12px;
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

/* ÁREA DE MENSAJES */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #fdfdfd;
}

/* MENSAJES */
.message {
    display: flex;
    margin-bottom: 12px;
    max-width: 100%;
}

/* MENSAJE DEL ASISTENTE */
.message.assistant {
    justify-content: flex-start;
}

.message.assistant .bubble {
    background-color: #ffffff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 14px;
    max-width: 70%;
    line-height: 1.4;
}

/* MENSAJE DEL USUARIO */
.message.user {
    justify-content: flex-end;
}

.message.user .bubble {
    background-color: #1a1a1a;
    color: #ffffff;
    border-radius: 8px;
    padding: 12px 14px;
    max-width: 70%;
    line-height: 1.4;
}

/* TEXTO (ahora textarea) */
.chat-input textarea#userInput {
  flex: 1;
  padding: 12px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  resize: none;              /* evita que el usuario lo estire */
  min-height: 52px;          /* 👈 más alto */
  line-height: 1.35;
}

.chat-input textarea#userInput:focus {
  border-color: #000;
}

/* "Thinking..." estilo */
.message.assistant .bubble.thinking {
  color: #666;
  font-style: italic;
}


/* INPUT */
.chat-input {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: #ffffff;
    border-top: 1px solid #ddd;
}

/* UPLOAD */
.chat-input .upload {
    margin-right: 8px;
}

.chat-input .upload label {
    cursor: pointer;
    font-size: 18px;
}

.chat-input .upload input {
    display: none;
}

/* TEXTO */
.chat-input input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.chat-input input[type="text"]:focus {
    border-color: #000;
}

/* BOTÓN ENVIAR */
.chat-input button {
    margin-left: 10px;
    padding: 10px 16px;
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.chat-input button:hover {
    background-color: #333;
}

/* =========================
   Contact CTA + Modal
========================= */

.hidden { display: none !important; }

.contact-cta-bar {
  position: sticky;
  bottom: 0;
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.95);
  border-top: 1px solid #e5e5e5;
  display: flex;
  justify-content: center;
  z-index: 20;
}

.contact-cta-btn {
  width: 100%;
  max-width: 520px;
  padding: 12px 14px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.contact-cta-btn:hover { background: #333; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e6e6e6;
  box-shadow: 0 10px 40px rgba(0,0,0,0.20);
  padding: 16px;
  z-index: 2;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  color: #333;
}

.modal-subtitle {
  margin: 0 0 12px 0;
  font-size: 13px;
  line-height: 1.4;
  color: #555;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field span {
  display: block;
  font-size: 12px;
  color: #444;
  margin-bottom: 4px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
}

.field input:focus { border-color: #000; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn-primary, .btn-secondary {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.btn-primary {
  background: #000;
  color: #fff;
  border: none;
}

.btn-primary:hover { background: #333; }

.btn-secondary {
  background: #fff;
  color: #111;
  border: 1px solid #ccc;
}

.btn-secondary:hover { background: #f5f5f5; }

.form-error {
  margin-top: 6px;
  padding: 10px 12px;
  background: #fff5f5;
  border: 1px solid #ffd3d3;
  border-radius: 8px;
  color: #9b1c1c;
  font-size: 13px;
}

.chat-lookup{
  display:flex;
  gap:8px;
  align-items:center;
  margin-right:14px;
  margin-left: 20px;
}
.chat-lookup input{
  width:170px;
  padding:8px 10px;
  border:1px solid #e6e6e6;
  border-radius:10px;
  outline:none;
}
.chat-lookup button{
  padding:8px 12px;
  border-radius:10px;
  border:1px solid #b38b4a;
  background:#b38b4a;
  color:#fff;
  cursor:pointer;
}
.chat-lookup button:hover{ filter:brightness(0.95); }

