@import url("/tokens.css");

:root {
  color-scheme: dark;
  font-family: var(--font-body);
  --dealer-brand: var(--blue);
  --dealer-ink: var(--text);
  --dealer-muted: var(--muted);
  --dealer-line: var(--border);
  --dealer-surface: var(--surface);
  --dealer-soft: var(--bg-elev);
  --dealer-shadow: var(--shadow-md);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--dealer-ink);
}

button,
input {
  font: inherit;
}

.vehicle-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(8, 18, 25, 0.78), rgba(8, 18, 25, 0.22)),
    var(--hero-image, url("https://images.unsplash.com/photo-1609521263047-f8f205293f24?auto=format&fit=crop&w=1600&q=80"));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  padding: 56px;
}

.hero {
  max-width: 640px;
  color: var(--text);
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 13px;
  font-weight: 800;
  color: var(--cyan);
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 560px;
  margin: 22px 0;
  font-size: 18px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-action,
.secondary-action {
  border: 1px solid rgba(255, 255, 255, 0.7);
  height: 44px;
  padding: 0 22px;
  text-transform: uppercase;
  font-weight: 800;
  cursor: pointer;
}

.primary-action {
  background: var(--grad-brand);
  color: var(--bg);
}

.secondary-action {
  background: transparent;
  color: var(--text);
}

.agent-shell {
  position: fixed;
  inset: 28px 44px;
  z-index: 20;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  background: var(--dealer-surface);
  border: 1px solid var(--dealer-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--dealer-shadow);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.embed-mode {
  min-height: 100vh;
  background: transparent;
}

.embed-mode .vehicle-page {
  display: none;
}

.embed-mode .agent-shell {
  position: fixed;
  inset: 0;
  border-radius: 0;
  border: 0;
}

.agent-is-collapsed .agent-shell {
  display: none;
}

.agent-header {
  height: 64px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--dealer-line);
}

.agent-header h2 {
  margin: 0;
  color: var(--dealer-brand);
  text-align: center;
  font-size: 28px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button {
  border: 0;
  background: transparent;
  font-size: 28px;
  cursor: pointer;
  color: #0f172a;
}

.status-pill {
  justify-self: end;
  color: #0b5b6d;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.agent-log {
  overflow: auto;
  padding: 28px clamp(18px, 9vw, 120px) 18px;
}

.message {
  display: grid;
  gap: 14px;
  margin: 0 0 22px;
}

.message.user {
  justify-items: end;
}

.bubble {
  max-width: 920px;
  line-height: 1.55;
  font-size: 17px;
}

.user .bubble {
  max-width: 520px;
  padding: 13px 16px;
  border: 1px solid var(--dealer-line);
  border-radius: 16px;
  background: var(--surface-2);
}

.assistant .bubble {
  color: var(--dealer-ink);
}

.component-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 12px;
  font-size: 21px;
  font-weight: 800;
}

.media-row,
.trim-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 280px);
  gap: 12px;
  max-width: 900px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.media-card,
.trim-card,
.finance-card,
.lead-card {
  border: 1px solid var(--dealer-line);
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}

.media-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #111827;
}

.media-card p {
  margin: 0;
  min-height: 48px;
  padding: 9px 12px;
  background: #f7f7f7;
  font-size: 14px;
}

.video-thumb {
  position: relative;
}

.video-duration,
.play-mark {
  position: absolute;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
}

.video-duration {
  right: 8px;
  bottom: 8px;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 12px;
}

.play-mark {
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
}

.tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 10px 10px;
}

.tag-list span,
.check {
  color: #047e46;
  font-size: 13px;
}

.trim-grid {
  grid-auto-columns: minmax(300px, 420px);
}

.trim-card {
  padding: 18px;
}

.trim-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.trim-card .price {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 900;
}

.trim-card .desc {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.trim-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.trim-card li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.finance-card {
  max-width: 540px;
  padding: 22px 24px;
  box-shadow: 0 10px 30px rgba(15, 37, 48, 0.08);
}

.payment-number {
  margin: 0;
  font-size: 38px;
  text-align: center;
  font-weight: 950;
}

.payment-label {
  margin: 2px 0 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.slider-row {
  margin: 18px 0;
}

.slider-row label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  accent-color: #1f2937;
}

.range-ends {
  display: flex;
  justify-content: space-between;
  color: #9ca3af;
  font-size: 12px;
}

.lead-card {
  max-width: 520px;
  padding: 18px;
  display: grid;
  gap: 10px;
}

.lead-card input,
.lead-card select {
  height: 44px;
  border: 1px solid var(--dealer-line);
  border-radius: 8px;
  padding: 0 12px;
}

.lead-card button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--dealer-brand);
  color: var(--bg);
  font-weight: 900;
  cursor: pointer;
}

.quick-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px 8px;
}

.quick-actions button {
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 54px;
  align-items: center;
  gap: 10px;
  max-width: 780px;
  width: calc(100% - 36px);
  margin: 0 auto;
}

.composer input {
  min-width: 0;
  height: 56px;
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 0 16px;
  font-size: 16px;
  box-shadow: 0 0 0 3px rgba(2, 184, 214, 0.08);
}

.send-button,
.voice-button {
  height: 48px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.send-button {
  background: var(--dealer-brand);
  color: var(--bg);
  font-size: 24px;
  font-weight: 900;
}

.voice-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: var(--grad-brand);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.voice-button.is-live {
  background: linear-gradient(145deg, #0aae61, #045a35);
  animation: voicePulse 1.4s ease-in-out infinite;
}

.voice-button span {
  width: 3px;
  border-radius: 999px;
  background: var(--text);
}

.voice-button span:nth-child(1) {
  height: 12px;
}

.voice-button span:nth-child(2) {
  height: 20px;
}

.voice-button span:nth-child(3) {
  height: 14px;
}

@keyframes voicePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(10, 174, 97, 0.25), inset 0 0 0 2px rgba(255, 255, 255, 0.3);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(10, 174, 97, 0), inset 0 0 0 2px rgba(255, 255, 255, 0.3);
  }
}

.consent-copy,
.disclaimer {
  margin: 6px auto 0;
  max-width: 760px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.disclaimer {
  margin-bottom: 14px;
}

@media (max-width: 760px) {
  .vehicle-page {
    padding: 28px;
  }

  .agent-shell {
    inset: 10px;
    border-radius: 16px;
  }

  .agent-header {
    grid-template-columns: 36px 1fr;
    padding: 0 14px;
  }

  .status-pill {
    display: none;
  }

  .agent-header h2 {
    font-size: 22px;
  }

  .agent-log {
    padding: 20px 14px;
  }

  .quick-actions {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 44px 48px;
  }
}
