* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
  background-image: url('fundo.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  color: #111827;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
}

.chat-container {
  width: 100%;
  max-width: 750px;
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 10px 15px rgba(0,0,0,0.1);
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #E5E7EB;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(to bottom right, #6366F1, #EC4899);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
}

.chat-main {
  padding: 1rem;
}

.chat-window {
  display: flex;         
  flex-direction: column;
  gap: 0.5rem;
  height: 22rem;
  overflow-y: auto;
  padding: 1rem;
  background: linear-gradient(to bottom, #fff, #F9FAFB);
  border-radius: 0.5rem;
  border: 1px solid #E5E7EB;
}

.message-row {
  display: flex;
  width: 100%;
}

.message-row.user { justify-content: flex-end; }
.message-row.agent { justify-content: flex-start; }

.message-bubble {
  max-width: 70%;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}

.chat-form {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.chat-form textarea {
  flex: 1;
  resize: none;
  padding: 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid #D1D5DB;
  outline: none;
}

.chat-form button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background-color: #6366F1;
  color: #fff;
  border: none;
  cursor: pointer;
}

.chat-info {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #6B7280;
}

.btn-clear {
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  background-color: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
  cursor: pointer;
}

.chat-footer {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-top: 1px solid #E5E7EB;
  font-size: 0.75rem;
  color: #6B7280;
}

#modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  text-align: center;
  width: 90%;
  max-width: 400px;
}

.modal-content h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: #111827;
}

.modal-content input {
  width: 100%;
  padding: 0.65rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #D1D5DB;
  font-size: 1rem;
  outline: none;
}

.modal-content button {
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  border: none;
  background-color: #6366F1;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
}

.modal-content button:hover {
  background-color: #4F46E5;
}

@media (max-width: 600px) {
  .chat-container {
    margin: 0;
    border-radius: 0; 
    height: 100vh; 
    max-width: 100%;
  }

  .chat-header {
    padding: 0.75rem;
  }

  .chat-icon {
    width: 2rem;
    height: 2rem;
    font-size: 0.95rem;
  }

  h1 {
    font-size: 1.7rem;
  }

  .chat-window {
    height: calc(100vh - 280px); 
    font-size: 0.9rem;
  }

  .chat-form {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-form textarea {
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  .chat-form button {
    width: 100%; 
    padding: 0.6rem;
    font-size: 1rem;
  }
}
