:root {
  color-scheme: light;
  --bg: #eef4ff;
  --card: #ffffff;
  --text: #101827;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #10b981;
  --user: #dbeafe;
  --bot: #ecfdf5;
  --border: #dbe3ef;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #ffffff 0%, var(--bg) 45%, #dbeafe 100%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.site-header, main, .site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--primary);
  color: white;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-links a {
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.75);
}

.nav-links .nav-cta {
  background: var(--text);
  color: white;
}

.nav-links .nav-cta:hover,
.nav-links .nav-cta.active {
  background: var(--primary);
  color: white;
}

.hero, .page-hero, .section {
  margin: 28px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 28px;
  align-items: center;
  min-height: 520px;
}

.page-hero {
  max-width: 820px;
  padding: 42px 0 16px;
}

.page-hero.compact { max-width: 900px; }

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

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 16px;
  font-size: clamp(40px, 8vw, 78px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.page-hero h1 {
  font-size: clamp(38px, 6vw, 64px);
}

h2 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -0.04em;
}

h3 { margin-bottom: 8px; }

.subtitle, .section p, li {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.subtitle {
  max-width: 680px;
  font-size: 19px;
}

.hero-actions, .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button, button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
}

.button.primary, button.primary, button[type="submit"] {
  background: var(--primary);
  color: white;
}

.button.primary:hover, button.primary:hover, button[type="submit"]:hover:not(:disabled) {
  background: var(--primary-dark);
}

.button.secondary, .reset-button {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

.hero-card, .service-card, .price-card, .note-card, .contact-card, .chat-container, .demo-panel, .stats-grid article, .feature-list article, .steps article {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(219, 227, 239, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-card { padding: 24px; }

.card-label {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mini-chat {
  display: grid;
  gap: 12px;
}

.mini-chat p {
  margin: 0;
  padding: 14px;
  background: #f8fafc;
  border-radius: 16px;
  color: var(--text);
  line-height: 1.5;
}

.stats-grid, .service-grid, .pricing-grid, .steps {
  display: grid;
  gap: 16px;
}

.stats-grid { grid-template-columns: repeat(3, 1fr); }
.service-grid { grid-template-columns: repeat(2, 1fr); }
.pricing-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.steps { grid-template-columns: repeat(3, 1fr); }

.stats-grid article, .service-card, .price-card, .steps article, .feature-list article, .note-card, .contact-card, .demo-panel {
  padding: 24px;
}

.stats-grid strong {
  display: block;
  font-size: 34px;
  letter-spacing: -0.04em;
}

.stats-grid span { color: var(--muted); }

.two-column, .contact-layout, .demo-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
  align-items: start;
}

.feature-list { display: grid; gap: 16px; }

.service-card span, .steps strong {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #dbeafe;
  color: var(--primary);
  font-weight: 900;
  margin-bottom: 14px;
}

.service-card ul, .price-card ul, .contact-card ul {
  padding-left: 18px;
  margin-bottom: 0;
}

.price-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px;
}

.price-card.featured {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-10px);
}

.plan {
  color: var(--primary);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.price-card h2 {
  margin: 0;
  font-size: 42px;
}

.price-card .button { margin-top: auto; }

.cta-band {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 30px;
  background: var(--text);
  color: white;
  border-radius: 28px;
}

.cta-band p { color: #cbd5e1; margin-bottom: 0; }

.chat-container {
  width: 100%;
  padding: 24px;
}

.chat-container.embedded { box-shadow: var(--shadow); }

.chat-box {
  height: 430px;
  overflow-y: auto;
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 14px;
  background: #f8fafc;
  border-radius: 18px;
}

.message {
  display: grid;
  gap: 4px;
  max-width: 82%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.message strong {
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.message.user {
  margin-left: auto;
  background: var(--user);
  border-bottom-right-radius: 6px;
}

.message.bot {
  background: var(--bot);
  border-bottom-left-radius: 6px;
}

.input-row {
  display: flex;
  gap: 10px;
}

input, textarea, select {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  color: var(--text);
  font: inherit;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.input-row input { flex: 1; }

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.reset-button {
  margin-top: 12px;
  width: 100%;
  color: var(--muted);
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 14px;
}

.suggestion-chip, .prompt-chip {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 14px;
}

.prompt-chip {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.demo-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.lead-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.lead-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
}

.full-span { grid-column: 1 / -1; }
.form-status { grid-column: 1 / -1; margin: 0; font-weight: 800; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  padding: 36px 0;
}

.site-footer p { margin: 0; }
.site-footer a { color: var(--primary); font-weight: 800; }

@media (max-width: 860px) {
  .site-header, .site-footer, .cta-band { align-items: flex-start; flex-direction: column; }
  .hero-grid, .two-column, .contact-layout, .demo-layout, .pricing-grid, .service-grid, .steps, .stats-grid { grid-template-columns: 1fr; }
  .price-card.featured { transform: none; }
  h1 { font-size: clamp(38px, 12vw, 58px); }
}

@media (max-width: 560px) {
  .site-header, main, .site-footer { width: min(100% - 24px, 1120px); }
  .nav-links { width: 100%; }
  .nav-links a { padding: 9px 10px; }
  .chat-container, .lead-form, .service-card, .price-card, .demo-panel { padding: 18px; border-radius: 18px; }
  .chat-box { height: 360px; }
  .message { max-width: 94%; }
  .input-row, .lead-form { grid-template-columns: 1fr; flex-direction: column; }
  .button, button { width: 100%; }
}

/* Admin portal */
.admin-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  background: #f1f5f9;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: #0f172a;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-logo { color: white; }

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav a {
  padding: 12px 14px;
  border-radius: 14px;
  color: #cbd5e1;
  font-weight: 800;
}

.admin-nav a:hover {
  color: white;
  background: rgba(255,255,255,0.08);
}

.logout-form { margin-top: auto; }
.logout-form .button { width: 100%; }

.admin-main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0;
}

.admin-login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}

.admin-login-card {
  width: min(560px, 100%);
  background: white;
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 30px;
  display: grid;
  gap: 26px;
}

.admin-login-card h1,
.admin-topbar h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.admin-login-form,
.admin-form {
  display: grid;
  gap: 16px;
}

.admin-login-form label,
.admin-form label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.admin-hint,
.empty-state,
.timeline-meta,
.suggestion-summary {
  color: var(--muted);
}

.admin-alert {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-weight: 700;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.admin-topbar.split { align-items: center; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.admin-stats article,
.admin-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
}

.admin-stats article {
  padding: 18px;
}

.admin-stats span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 38px;
  letter-spacing: -0.05em;
}

.admin-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.admin-panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-header h2 { margin: 0; font-size: 25px; }
.panel-header a,
.table-link { color: var(--primary); font-weight: 900; }

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-list-item {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
}

.admin-list-item:hover { border-color: #bfdbfe; background: #eff6ff; }
.admin-list-item span { color: var(--muted); font-size: 14px; }
.admin-list-item p { margin: 0; color: var(--muted); }

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-tabs a {
  padding: 10px 14px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 800;
}

.filter-tabs a.active,
.filter-tabs a:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #e2e8f0;
  color: #334155;
}

.status-new { background: #dbeafe; color: #1d4ed8; }
.status-contacted { background: #fef3c7; color: #92400e; }
.status-qualified { background: #dcfce7; color: #166534; }
.status-won { background: #d1fae5; color: #047857; }
.status-lost { background: #fee2e2; color: #991b1b; }

.detail-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
}

.detail-list dt { color: var(--muted); font-weight: 900; }
.detail-list dd { margin: 0; }
.detail-list a { color: var(--primary); font-weight: 800; }

.timeline {
  display: grid;
  gap: 18px;
}

.timeline-turn {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.timeline-turn .message {
  max-width: 760px;
}

.form-status.error { color: #b91c1c; }

@media (max-width: 980px) {
  .admin-body { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
  .admin-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-grid-two { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .admin-nav, .admin-stats, .detail-list { grid-template-columns: 1fr; }
  .admin-topbar, .admin-topbar.split { flex-direction: column; }
}
