@import url('https://fonts.googleapis.com/css2?family=Spectral:wght@500;600&family=Hanken+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ============ DESIGN TOKENS — HAIA DS ============ */
  --bg-primary: #faf8f2; /* --paper */
  --bg-secondary: #f5f2ea; /* --ink-50 */
  --bg-card: #faf8f2;
  
  --text-primary: #14110b; /* --ink-950 */
  --text-secondary: #403a2c; /* --ink-700 */
  --text-muted: #7a7158; /* --ink-500 */
  
  --accent-primary: #c2722e; /* --amber-500 */
  --accent-gradient: linear-gradient(135deg, #c2722e 0%, #a85b1e 100%);
  --accent-glow: rgba(194, 114, 46, 0.2);
  
  --border-color: #ded8c9; /* --ink-200 */
  --border-active: #c2722e; /* --amber-500 */
  
  --bubble-model: #ece8dd; /* --ink-100 */
  --bubble-user: #f7e6cf; /* --amber-100 */
  --bubble-user-text: #8c4a18; /* --amber-700 */
  
  --shadow-sm: 0 1px 2px 0 rgba(20, 17, 11, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(20, 17, 11, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(20, 17, 11, 0.1);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --font-sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Spectral', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --tracking-tight: -0.02em;
  --tracking-snug: -0.01em;

  --success: #2e7d32;
  --success-light: #e8f5e9;
  --danger: #c62828;
  --danger-light: #ffebee;

  --ink-950: #14110b;
  --ink-700: #403a2c;
  --ink-500: #7a7158;
  --ink-200: #ded8c9;
  --ink-100: #ece8dd;
  --amber-500: #c2722e;
  --amber-700: #8c4a18;
  --amber-100: #f7e6cf;
  --paper: #faf8f2;
  --paper-secondary: #f5f2ea;
}

/* ==========================================
   Mobile responsive
   ========================================== */
@media (max-width: 480px) {
  .card { padding: 28px 20px; }
  h1 { font-size: 24px; }
  .form-row { grid-template-columns: 1fr; }
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background-image:
    radial-gradient(at 0% 0%, rgba(194, 114, 46, 0.04) 0, transparent 50%),
    radial-gradient(at 100% 100%, rgba(194, 114, 46, 0.04) 0, transparent 50%);
}

/* ==========================================
   Welcome / LGPD Consent Page
   ========================================== */
.container {
  width: 100%;
  max-width: 520px;
  padding: 24px;
  perspective: 1000px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
  animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.logo-dot {
  width: 14px;
  height: 14px;
  background: var(--accent-gradient);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(194, 114, 46, 0.3);
}

.logo-text {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 12px;
  color: var(--text-primary);
}

p.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 24px;
}

.info-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.info-item {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-icon {
  color: var(--accent-primary);
  font-weight: bold;
}

.lgpd-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 32px;
  cursor: pointer;
  user-select: none;
}

.lgpd-box input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  border-radius: 4px;
  border: 1px solid var(--border-color);
  margin-top: 3px;
  cursor: pointer;
}

.lgpd-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.lgpd-text a {
  color: var(--accent-primary);
  text-decoration: none;
}

.lgpd-text a:hover {
  text-decoration: underline;
}

.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 14px 24px;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(194, 114, 46, 0.3);
  transition: all 0.3s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(194, 114, 46, 0.4);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================
   Chat Interface Page
   ========================================== */
.chat-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
}

.chat-header {
  height: 70px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
}

.chat-info {
  display: flex;
  flex-direction: column;
}

.chat-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(194, 114, 46, 0.1);
  border: 1px solid rgba(194, 114, 46, 0.2);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-primary);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  opacity: 0.3;
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  opacity: 0.5;
}

.message-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.message-wrapper.model {
  align-self: flex-start;
}

.message-wrapper.user {
  align-self: flex-end;
}

.message-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding: 0 4px;
}

.message-wrapper.user .message-meta {
  text-align: right;
}

.message-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message-wrapper.model .message-bubble {
  background-color: var(--bubble-model);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.message-wrapper.user .message-bubble {
  background-color: var(--bubble-user);
  color: var(--bubble-user-text);
  border: 1px solid var(--border-color);
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(194, 114, 46, 0.1);
}

.chat-input-area {
  padding: 20px 24px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
}

.input-container {
  display: flex;
  gap: 12px;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}

.chat-input {
  flex: 1;
  height: 52px;
  background: rgba(20, 17, 11, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 0 18px;
  outline: none;
  transition: all 0.3s ease;
}

.chat-input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 10px rgba(194, 114, 46, 0.15);
  background: rgba(20, 17, 11, 0.04);
}

.send-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(194, 114, 46, 0.2);
}

.send-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(194, 114, 46, 0.35);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background-color: var(--bubble-model);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  width: fit-content;
  border-bottom-left-radius: 4px;
  animation: fadeIn 0.3s ease;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  animation: bounce 1.3s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

/* Overlay do Fechamento / Conclusão */
.completion-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 100;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.completion-overlay .success-icon {
  width: 80px;
  height: 80px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 36px;
  color: white;
  margin-bottom: 24px;
  box-shadow: 0 0 20px rgba(194, 114, 46, 0.4);
}

.completion-overlay h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 12px;
}

.completion-overlay p {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 400px;
  line-height: 1.6;
}

/* ==========================================
   Animations
   ========================================== */
@keyframes slideInUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(194, 114, 46, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(194, 114, 46, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(194, 114, 46, 0); }
}

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}


