/* ═══════════════════════════════════════════
   OMNI AI — Onboarding Landing Page
   Design: Dark, clean, confident. No slop.
   ═══════════════════════════════════════════ */

:root {
  --bg: #0a0a0b;
  --bg-elevated: #141417;
  --bg-card: #1a1a1f;
  --border: #2a2a30;
  --border-light: #3a3a42;
  --text: #f0f0f2;
  --text-muted: #8a8a95;
  --text-dim: #5a5a65;
  --accent: #4f7fff;
  --accent-hover: #6b93ff;
  --accent-glow: rgba(79, 127, 255, 0.15);
  --accent-subtle: rgba(79, 127, 255, 0.08);
  --green: #34d399;
  --green-glow: rgba(52, 211, 153, 0.15);
  --red: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── States ── */
.state { display: none; }
.state.active { display: block; }

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 32px; width: auto; }
.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
}
.logo-accent { color: var(--accent); margin-left: 2px; }
.nav-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }

/* ── Hero ── */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 80px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--accent-subtle);
  border: 1px solid rgba(79, 127, 255, 0.2);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 1.35rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 36px;
  line-height: 1.7;
}

/* ── CTA Block ── */
.cta-block { margin-bottom: 40px; }

.name-input-wrap { margin-bottom: 12px; }

.name-input {
  width: 100%;
  max-width: 380px;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.name-input::placeholder { color: var(--text-dim); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  min-width: 240px;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 24px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--border-light);
  background: var(--bg-elevated);
  color: var(--text);
}

.spinner {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.cta-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ── Trust Row ── */
.trust-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.trust-item svg { color: var(--accent); flex-shrink: 0; }

/* ── Hero Visual ── */
.hero-visual {
  display: flex;
  justify-content: center;
}

.video-preview {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.preview-avatar {
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
}

.preview-placeholder {
  text-align: center;
}

.avatar-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent-subtle);
  border: 2px solid rgba(79, 127, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); border-color: rgba(79, 127, 255, 0.3); }
  50% { transform: scale(1.05); border-color: rgba(79, 127, 255, 0.5); }
}

.avatar-inner {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.preview-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.preview-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--green-glow); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px transparent; }
}

/* ── How It Works ── */
.how-it-works {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
}

.how-it-works h2 {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
  letter-spacing: -0.02em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s;
}

.step:hover { border-color: var(--border-light); }

.step-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.5;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
}

.step h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Differentiator ── */
.differentiator {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.diff-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.diff-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.diff-old .diff-label { color: var(--text-dim); }
.diff-new .diff-label { color: var(--accent); }

.diff-old ul, .diff-new ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diff-old li, .diff-new li {
  font-size: 0.95rem;
  padding-left: 24px;
  position: relative;
  line-height: 1.5;
}

.diff-old li { color: var(--text-dim); }
.diff-old li::before {
  content: '✕';
  position: absolute;
  left: 0;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 700;
}

.diff-new li { color: var(--text); }
.diff-new li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.diff-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 40px;
}

.diff-divider span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Form Fallback ── */
.form-fallback {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
}

.form-fallback p {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer a { color: var(--text-muted); }

/* ═══════════════════════════════════════════
   STATE 2: ACTIVE CALL
   ═══════════════════════════════════════════ */

#state-call {
  height: 100vh;
  display: none;
  flex-direction: column;
}

#state-call.active {
  display: flex;
}

.call-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.call-header-inner {
  max-width: 100%;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.call-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--green);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.btn-end {
  padding: 8px 20px;
  background: rgba(248, 113, 113, 0.1);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-end:hover { background: rgba(248, 113, 113, 0.2); }

.call-container {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

.tavus-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--bg);
}

.call-sidebar {
  position: fixed;
  right: 0;
  top: 56px;
  bottom: 0;
  width: 320px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 50;
}

.call-sidebar.visible {
  transform: translateX(0);
}

.call-sidebar h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-empty {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.captured-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.captured-item:last-child { border-bottom: none; }

.captured-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.captured-value {
  font-size: 0.95rem;
  color: var(--text);
}

/* ═══════════════════════════════════════════
   STATE 3: POST-CALL
   ═══════════════════════════════════════════ */

#state-done.active { display: block; }

.done-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 120px 24px 80px;
  text-align: center;
}

.done-check {
  color: var(--green);
  margin-bottom: 24px;
}

.done-wrap h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.done-sub {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.done-desc {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 40px;
}

.done-summary {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 40px;
}

.done-summary h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.done-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 100px;
  }

  .hero-visual { order: -1; }
  .video-preview { max-width: 280px; }
  .preview-avatar { aspect-ratio: 1; }

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

  .diff-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .diff-divider {
    padding-top: 0;
    padding: 8px 0;
  }

  .call-sidebar {
    position: fixed;
    width: 100%;
    height: auto;
    max-height: 40vh;
    top: auto;
    bottom: 0;
    transform: translateY(100%);
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .call-sidebar.visible {
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 1.1rem; }
  .trust-row { flex-direction: column; gap: 12px; }
  .btn-primary { width: 100%; }
  .name-input { max-width: 100%; }
}
