/* ============================================================
   BrightPath Home Services — Demo site for the AI Scheduling
   & Support Agent (Datawebify / AgAI-7). Visual language matches
   the existing /monitor dashboard: Inter font, indigo/violet
   gradient, soft rounded cards.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --indigo: #4f46e5;
  --violet: #7c3aed;
  --indigo-dark: #3730a3;
  --ink: #1e293b;
  --ink-soft: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --bg-tint: #f0f4ff;
  --green: #16a34a;
  --amber: #d97706;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(79, 70, 229, 0.10);
  --shadow-sm: 0 2px 12px rgba(15, 23, 42, 0.06);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Demo ribbon ---------- */
.demo-ribbon {
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 9px 16px;
}
.demo-ribbon strong { color: #fde68a; }

/* ---------- Nav ---------- */
header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1120px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.2px; }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 500; }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
}
.nav-links a:hover { color: var(--indigo); }
.nav-cta {
  display: flex; align-items: center; gap: 14px;
}
.phone-pill {
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  display: flex; align-items: center; gap: 6px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff;
  box-shadow: 0 6px 18px rgba(79,70,229,0.35);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(79,70,229,0.45); }
.btn-ghost {
  background: var(--bg-tint);
  color: var(--indigo);
}
.btn-ghost:hover { background: #e5e9ff; }

@media (max-width: 820px) {
  .nav-links { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 15% -10%, #eef0ff 0%, rgba(238,240,255,0) 60%),
    radial-gradient(900px 500px at 100% 0%, #f3e8ff 0%, rgba(243,232,255,0) 55%);
  padding: 80px 24px 60px;
}
.hero-inner {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--indigo); background: var(--bg-tint);
  padding: 7px 14px; border-radius: 999px; margin-bottom: 20px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

h1.hero-title {
  font-size: 44px; line-height: 1.12; font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 18px;
}
h1.hero-title .grad {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  font-size: 17px; color: var(--ink-soft); max-width: 46ch; margin-bottom: 30px;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-note { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

.hero-card {
  background: #fff; border-radius: 20px; box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 22px; position: relative;
}
.hero-card .hc-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.hc-head .name { font-size: 14px; font-weight: 700; }
.hc-head .status { font-size: 12px; color: var(--green); display: flex; align-items: center; gap: 5px; }
.hc-head .status .d { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.hc-bubble {
  font-size: 13.5px; border-radius: 14px; padding: 10px 14px; margin-bottom: 10px;
  max-width: 88%; line-height: 1.45;
}
.hc-bubble.bot { background: var(--bg-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.hc-bubble.user {
  background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff;
  margin-left: auto; border-bottom-right-radius: 4px;
}
.hc-foot {
  margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 14px;
  font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between;
}

/* ---------- Sections ---------- */
section { padding: 64px 24px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head .kicker {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--indigo); margin-bottom: 10px;
}
.section-head h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 10px; }
.section-head p { color: var(--ink-soft); font-size: 15.5px; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 1120px; margin: 0 auto; }
.step {
  background: var(--bg-soft); border-radius: var(--radius); padding: 26px;
  border: 1px solid var(--line);
}
.step .num {
  width: 32px; height: 32px; border-radius: 9px; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff;
}
.step h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--ink-soft); }

/* Services */
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 1120px; margin: 0 auto;
}
.service-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  background: #fff; transition: box-shadow .15s ease, transform .15s ease;
}
.service-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.service-icon {
  width: 42px; height: 42px; border-radius: 11px; background: var(--bg-tint);
  color: var(--indigo); display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.service-card h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 6px; }
.service-card p { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.service-card .try {
  font-size: 12.5px; font-weight: 700; color: var(--indigo);
  display: inline-flex; align-items: center; gap: 5px;
}

/* Stats */
.stats-section { background: var(--bg-tint); }
.stats-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; max-width: 1120px; margin: 0 auto;
}
.stat {
  background: #fff; border-radius: 14px; padding: 22px 16px; text-align: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.stat .big { font-size: 26px; font-weight: 800; color: var(--indigo); margin-bottom: 6px; }
.stat .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .from { font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* Try it */
.try-section { max-width: 1120px; margin: 0 auto; }
.try-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.prompt-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  background: var(--bg-soft);
}
.prompt-card .txt { font-size: 14px; color: var(--ink); }
.prompt-card .txt .label { display: block; font-size: 11px; color: var(--indigo); font-weight: 700; margin-bottom: 3px; letter-spacing: .03em; text-transform: uppercase; }
.prompt-card button {
  flex-shrink: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; font-size: 12.5px; font-weight: 700; color: var(--indigo);
}
.prompt-card button:hover { background: var(--bg-tint); }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 40px 24px 30px; }
.footer-inner {
  max-width: 1120px; margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer-inner .left { font-size: 13px; color: var(--muted); }
.footer-inner .right { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.footer-inner .right a:hover { color: var(--indigo); }
.built-by {
  font-size: 12px; color: var(--muted); text-align: center; padding-top: 18px;
  border-top: 1px dashed var(--line); margin-top: 22px;
}
.built-by a { color: var(--indigo); font-weight: 600; }

/* ---------- Chat Widget ---------- */
#chat-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 90;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  box-shadow: 0 10px 30px rgba(79,70,229,0.45);
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: transform .18s ease;
}
#chat-fab:hover { transform: scale(1.06); }
#chat-fab .badge {
  position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 700; min-width: 19px; height: 19px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid #fff;
}
#chat-fab .badge[hidden] { display: none; }
#chat-fab .icon-close { display: none; }
#chat-fab.open .icon-chat { display: none; }
#chat-fab.open .icon-close { display: block; }

#chat-panel {
  position: fixed; bottom: 98px; right: 24px; z-index: 89;
  width: 378px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 140px);
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15,23,42,0.25);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
#chat-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.cp-head {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.cp-head .avatar { background: rgba(255,255,255,0.2); }
.cp-head .meta { flex: 1; min-width: 0; }
.cp-head .meta .n { font-size: 14.5px; font-weight: 700; }
.cp-head .meta .s { font-size: 12px; color: #e0e7ff; display: flex; align-items: center; gap: 6px; }
.cp-head .meta .s .d { width: 6px; height: 6px; border-radius: 50%; background: #86efac; }
.cp-head .reset-btn { color: #e0e7ff; opacity: .85; }
.cp-head .reset-btn:hover { opacity: 1; }

.cp-body {
  flex: 1; overflow-y: auto; padding: 16px; background: var(--bg-soft);
  display: flex; flex-direction: column; gap: 10px;
}
.msg {
  max-width: 84%; font-size: 13.8px; line-height: 1.48; padding: 10px 13px; border-radius: 14px;
  word-wrap: break-word; white-space: pre-wrap;
}
.msg.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user {
  background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.msg.err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; align-self: flex-start; }

.typing { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 15px; display: flex; gap: 4px; border-bottom-left-radius: 4px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: bounce 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.quick-replies { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 12px; }
.quick-replies button {
  font-size: 12.5px; font-weight: 600; color: var(--indigo); background: #fff;
  border: 1px solid #d9ddff; border-radius: 999px; padding: 7px 12px;
}
.quick-replies button:hover { background: var(--bg-tint); }

.cp-input {
  display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--line);
  background: #fff; flex-shrink: 0;
}
.cp-input input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  font-size: 13.8px; font-family: inherit; outline: none;
}
.cp-input input:focus { border-color: var(--indigo); }
.cp-input button {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.cp-input button:disabled { opacity: .5; }
.cp-foot {
  text-align: center; font-size: 10.5px; color: #94a3b8; padding: 6px 0 10px;
}

@media (max-width: 480px) {
  #chat-panel {
    right: 16px; left: 16px; width: auto; bottom: 90px; height: calc(100vh - 150px);
  }
  #chat-fab { right: 16px; bottom: 16px; }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .steps, .services-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .try-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .steps, .services-grid, .stats-grid { grid-template-columns: 1fr 1fr; }
  h1.hero-title { font-size: 32px; }
}
