:root {
  --bg: #0b1020;
  --bg-soft: #121a33;
  --card: #161f3d;
  --text: #e8ecf6;
  --muted: #9aa6c4;
  --brand: #5b8cff;
  --brand-2: #21d4b4;
  --line: #24304f;
  --radius: 16px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: clip; /* prevent sideways scroll without breaking sticky nav */
}
a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
section { padding: 84px 0; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(26px, 4vw, 38px); }
p { color: var(--muted); }
.accent { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(11,16,32,.72);
  border-bottom: 1px solid var(--line);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.brand span { color: var(--brand-2); }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--muted); font-size: 15px; }
.nav-links a:hover { color: var(--text); }
.nav-links .btn { color: #0b1020; }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 15px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #06111f; border: 0; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(33,212,180,.25); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brand); box-shadow: none; }

/* Hero */
.hero { padding: 96px 0 72px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% 0 auto 0; height: 520px;
  background: radial-gradient(600px 300px at 50% 0, rgba(91,140,255,.28), transparent 70%);
  pointer-events: none;
}
.hero h1 { font-size: clamp(34px, 6vw, 60px); position: relative; }
.hero p.lead { font-size: clamp(17px, 2.4vw, 21px); max-width: 720px; margin: 0 auto 28px; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.pill { display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--brand-2); font-size: 13px; margin-bottom: 20px; }

/* Grid cards */
.grid { display: grid; gap: 22px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform .15s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--brand); }
.card .ico { font-size: 30px; margin-bottom: 12px; }
.card h3 { font-size: 20px; }
.card p { margin: 0; font-size: 15px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 46px; }
.section-head p { font-size: 17px; }

/* Pricing */
.price { text-align: center; position: relative; }
.price.popular { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.price .tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #06111f; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.price .amt { font-size: 38px; font-weight: 800; margin: 8px 0 2px; }
.price .amt small { font-size: 15px; color: var(--muted); font-weight: 500; }
.price ul { list-style: none; padding: 0; margin: 18px 0 24px; text-align: left; }
.price li { padding: 7px 0; color: var(--muted); font-size: 15px; border-bottom: 1px solid var(--line); }
.price li::before { content: "✓ "; color: var(--brand-2); font-weight: 800; }

/* Steps */
.steps { counter-reset: step; }
.step { display: flex; gap: 18px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.step .n { counter-increment: step; flex: 0 0 44px; height: 44px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; color: var(--brand-2); }
.step .n::before { content: counter(step); }

/* CTA band */
.band { background: linear-gradient(90deg, rgba(91,140,255,.14), rgba(33,212,180,.14)); border: 1px solid var(--line); border-radius: 22px; padding: 44px; text-align: center; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 34px 0; color: var(--muted); font-size: 14px; }
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; }

/* ===== Chat widget ===== */
.sx-chat { --w: 384px; }
/* Light theme (used on the light clinic demo) — re-scopes the widget's variables
   so it matches a bright page. Dark theme uses the global :root values. */
.sx-theme-light {
  --bg: #f5f9ff;
  --bg-soft: #ffffff;
  --card: #eef4fd;
  --line: #e2eaf6;
  --text: #16243c;
  --muted: #6b7a95;
}
.sx-panel { color: var(--text); }
.sx-float { position: fixed; right: 24px; bottom: 24px; z-index: 60; }

/* Launcher — circular, with attention pulse */
.sx-launcher {
  position: relative; width: 62px; height: 62px; border: 0; cursor: pointer;
  border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 30px rgba(33,212,180,.35); transition: transform .15s ease;
}
.sx-launcher:hover { transform: scale(1.06); }
.sx-launcher-ico { font-size: 26px; line-height: 1; }
.sx-launcher-ring {
  position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(33,212,180,.5); animation: sxpulse 2.2s infinite;
}
@keyframes sxpulse { 0% { box-shadow: 0 0 0 0 rgba(33,212,180,.45); } 70% { box-shadow: 0 0 0 16px rgba(33,212,180,0); } 100% { box-shadow: 0 0 0 0 rgba(33,212,180,0); } }

.sx-float .sx-panel {
  position: fixed; right: 24px; bottom: 96px;
  width: min(var(--w), calc(100vw - 32px)); height: min(600px, calc(100vh - 130px));
  display: none; flex-direction: column;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,.55);
  transform-origin: bottom right;
}
.sx-float.sx-open .sx-panel { display: flex; animation: sxpop .22s cubic-bezier(.2,.9,.3,1.2); }
.sx-float.sx-open .sx-launcher { display: none; }
@keyframes sxpop { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }

/* Inline mode (demo page) */
.sx-inline { width: 100%; }
.sx-inline .sx-launcher { display: none; }
.sx-inline .sx-panel {
  display: flex; flex-direction: column;
  width: 100%; height: 600px; max-height: 80vh;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}

/* Header */
.sx-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(135deg, rgba(91,140,255,.18), rgba(33,212,180,.14)); border-bottom: 1px solid var(--line); }
.sx-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: var(--card); border: 1px solid var(--line); flex: 0 0 auto; }
.sx-head-text { flex: 1; min-width: 0; }
.sx-title { font-weight: 700; font-size: 15px; }
.sx-status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sx-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fe08a; box-shadow: 0 0 0 3px rgba(47,224,138,.18); }
.sx-close { background: transparent; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }
.sx-close:hover { color: var(--text); }
.sx-inline .sx-close { display: none; }

/* Messages */
.sx-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: radial-gradient(120% 80% at 50% 0, rgba(91,140,255,.05), transparent 60%); }
.sx-row { display: flex; align-items: flex-end; gap: 8px; }
.sx-row-user { justify-content: flex-end; }
.sx-mini-avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--card); border: 1px solid var(--line); flex: 0 0 auto; }
.sx-msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; animation: sxin .2s ease; }
@keyframes sxin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sx-user { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #06111f; font-weight: 500; border-bottom-right-radius: 5px; }
.sx-assistant { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.sx-system { margin: 2px auto; background: rgba(47,224,138,.12); color: #57e6a2; font-size: 12.5px; text-align: center; border-radius: 999px; padding: 7px 14px; }

.sx-typing { display: flex; gap: 4px; }
.sx-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: sxb 1s infinite; }
.sx-typing span:nth-child(2) { animation-delay: .15s; }
.sx-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes sxb { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Quick-reply chips */
.sx-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 6px; }
.sx-quick:empty { display: none; }
.sx-chip { cursor: pointer; font-size: 13px; color: var(--brand-2); background: rgba(33,212,180,.08); border: 1px solid rgba(33,212,180,.35); border-radius: 999px; padding: 7px 13px; transition: background .15s ease; }
.sx-chip:hover { background: rgba(33,212,180,.18); }

/* Input */
.sx-inputbar { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.sx-input { flex: 1; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 12px 16px; font-size: 14.5px; outline: none; transition: border-color .15s ease; }
.sx-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91,140,255,.15); }
.sx-send { border: 0; cursor: pointer; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #06111f; transition: transform .12s ease; }
.sx-send:hover { transform: scale(1.08); }
.sx-brandline { text-align: center; font-size: 11px; color: var(--muted); padding: 0 0 9px; background: var(--bg-soft); }
.sx-brandline b { color: var(--text); }

/* Mobile nav toggle */
.nav-toggle { display: none; background: transparent; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--text); border-radius: 2px; transition: .2s; }

/* Responsive */
@media (max-width: 860px) {
  .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .nav-links { display: none; }
  .nav-links.show { display: flex; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 16px; background: var(--bg-soft); padding: 20px; border-bottom: 1px solid var(--line); box-shadow: 0 20px 40px rgba(0,0,0,.4); }
  section { padding: 56px 0; }
  .hero { padding: 64px 0 48px; }
  .band { padding: 32px 20px; }
}

/* Phone: the chat widget goes full-screen so its header never hides behind the
   browser address bar. Uses dvh (dynamic viewport) + safe-area insets. */
@media (max-width: 560px) {
  .sx-float { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .sx-float .sx-panel {
    position: fixed; inset: 0; right: 0; bottom: 0; left: 0; top: 0;
    width: 100%; max-width: 100%;
    height: 100vh; height: 100dvh; max-height: none;
    border-radius: 0;
  }
  .sx-header { padding-top: calc(14px + env(safe-area-inset-top)); }
  .sx-brandline { padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
  .sx-msg { max-width: 85%; }
}
