body {
  margin: 0;
  font-family: "Poppins", Arial, sans-serif;
  background: #f5f7f4;
  color: #333;
}
/* -------- ENCABEZADO -------- */
.header {
  text-align: center;
  background: linear-gradient(135deg, #88c9b6, #4a7c74);
  color: white;
  padding: 40px 20px;
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.header .title {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0;
  text-transform: uppercase;
}

.header .subtitle {
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 400;
  margin-top: 8px;
}
/* -------- CHAT -------- */
.chat-container {
  max-width: 600px;
  margin: 30px auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  padding: 20px;
}

.chat-box {
  max-height: 450px;
  overflow-y: auto;
  padding: 15px;
  border-radius: 15px;
  margin-bottom: 15px;
  background: #fdfdfd;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Mensajes */
.msg {
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.4;
  font-size: 0.95rem;
  max-width: 80%;
  word-wrap: break-word;
}

.msg.user {
  background: #d8f3dc;
  align-self: flex-end;
  text-align: right;
  border-bottom-right-radius: 4px;
}

.msg.bot {
  background: #edf6f9;
  align-self: flex-start;
  text-align: left;
  border-bottom-left-radius: 4px;
}

.msg.error {
  background: #ffe0e0;
  color: #b00020;
  border: 1px solid #f5c2c7;
}

/* -------- INPUT -------- */
.chat-input {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.chat-input input {
  flex: 1;
  padding: 12px;
  border-radius: 25px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  outline: none;
  transition: 0.3s;
}

.chat-input input:focus {
  border-color: #4a7c74;
  box-shadow: 0 0 6px rgba(74, 124, 116, 0.3);
}

.chat-input button {
  padding: 12px 20px;
  border: none;
  background: #4a7c74;
  color: white;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: 0.3s;
}

.chat-input button:hover {
  background: #3c665e;
}

/* -------- TIPOS -------- */
.typing span::after {
  content: "...";
  animation: dots 1.2s infinite steps(3);
}

@keyframes dots {
  0% { content: ""; }
  33% { content: "."; }
  66% { content: ".."; }
  100% { content: "..."; }
}
/* -------- ADAPTACIÓN SMARTPHONE -------- */
@media (max-width: 768px) {
  .header {
    padding: 20px 15px;
    border-radius: 0 0 20px 20px;
  }

  .header-text h1 {
    font-size: 1.4rem;
  }

  .header-text p {
    font-size: 0.9rem;
  }

  .chat-container {
    margin: 0;
    border-radius: 0;
    height: calc(100vh - 160px); /* ocupa toda la pantalla salvo header */
    display: flex;
    flex-direction: column;
  }

  .chat-box {
    flex: 1;
    max-height: none;
    overflow-y: auto;
    border-radius: 0;
    padding: 15px;
  }

  .msg {
    max-width: 95%;
    font-size: 1rem;
    padding: 10px 14px;
  }

  .chat-input {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 8px;
    border-top: 1px solid #ddd;
  }

  .chat-input input {
    padding: 10px;
    font-size: 1rem;
  }

  .chat-input button {
    padding: 10px 16px;
    font-size: 0.95rem;
  }
}
