/* Estilos del widget de demo. Vanilla CSS, sin frameworks. */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1a1f2c;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --bot-bubble: #eef2ff;
  --user-bubble: #4f46e5;
  --user-text: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, #eef2ff 0%, #f4f6fb 60%, #ffffff 100%);
  min-height: 100vh;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
}

.hero {
  text-align: center;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.chat {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 460px;
}

.chat__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafbff;
}

.chat__header strong {
  display: block;
  font-size: 14px;
}

.chat__header small {
  color: var(--muted);
  font-size: 12px;
}

.chat__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 14.5px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg--bot {
  align-self: flex-start;
  background: var(--bot-bubble);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg--user {
  align-self: flex-end;
  background: var(--user-bubble);
  color: var(--user-text);
  border-bottom-right-radius: 4px;
}

.msg--typing {
  align-self: flex-start;
  background: var(--bot-bubble);
  color: var(--muted);
  font-style: italic;
  border-bottom-left-radius: 4px;
}

.msg--typing .dots {
  display: inline-block;
  animation: blink 1.2s infinite;
}

@keyframes blink {
  0%, 20% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}

.chat__form {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: #fafbff;
}

.chat__form input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
  color: var(--text);
}

.chat__form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.chat__form button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  width: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.chat__form button:hover { background: var(--primary-hover); }
.chat__form button:active { transform: scale(0.96); }
.chat__form button:disabled {
  background: #c7d2fe;
  cursor: not-allowed;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 600px) {
  .page { padding: 24px 12px; }
  .hero h1 { font-size: 22px; }
  .msg { max-width: 90%; }
}
