/* ═══════════════════════════════════════════════════════════════
   RAV4 2026 — Forum-themed single-page site
   Palette mirrors Vision Team forum: dark bg, accent teal/cyan
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --bg-card: #ffffff;
  --accent: #d32f2f;
  --accent-dim: #b71c1c;
  --accent-glow: rgba(211, 47, 47, 0.15);
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #868e96;
  --border: #dee2e6;
  --border-light: #ced4da;
  --danger: #f4212e;
  --warning: #ff7a00;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Hero ─────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(15, 20, 25, 0.9) 0%, rgba(15, 20, 25, 0.7) 100%),
    linear-gradient(45deg, var(--accent-dim) 0%, transparent 60%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, var(--accent-glow) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(0, 168, 138, 0.08) 0%, transparent 50%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="g" width="10" height="10" patternUnits="userSpaceOnUse"><circle cx="1" cy="1" r="0.5" fill="%23ffffff08"/></pattern></defs><rect fill="url(%23g)" width="100" height="100"/></svg>');
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 40px 24px;
}

.hero-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  padding: 6px 18px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(18px, 3vw, 24px);
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 40px;
}

.cta-button {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
  font-size: 16px;
  padding: 14px 32px;
  border-radius: 30px;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 0 20px var(--accent-glow);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(0, 212, 170, 0.3);
}

/* ─── Specs ────────────────────────────────────────────────────── */
.specs {
  padding: 80px 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 48px;
  letter-spacing: -0.5px;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.spec-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: all var(--transition);
}

.spec-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.spec-value {
  display: block;
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.spec-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ─── Chat Section ─────────────────────────────────────────────── */
.chat-section {
  padding: 80px 0 120px;
}

.chat-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.chat-avatar {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.chat-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.chat-status {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

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

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

.message {
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.bot {
  align-self: flex-start;
}

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

.message-content {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.7;
}

.message.bot .message-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.message.user .message-content {
  background: var(--accent-dim);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message-content strong {
  color: var(--accent);
}

.message-content em {
  opacity: 0.8;
  font-style: italic;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─── Chat Input ───────────────────────────────────────────────── */
.chat-input {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
}

.chat-input input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 12px 20px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}

.chat-input input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.chat-input input::placeholder {
  color: var(--text-muted);
}

.chat-input button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--bg-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.chat-input button:hover {
  background: #00eabb;
  transform: scale(1.05);
}

.chat-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── Footer ───────────────────────────────────────────────────── */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.footer p {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero {
    min-height: 70vh;
  }

  .specs-grid {
    grid-template-columns: 1fr 1fr;
  }

  .chat-messages {
    max-height: 400px;
    padding: 16px;
  }

  .message {
    max-width: 92%;
  }

  .chat-input {
    padding: 12px 16px;
  }
}