/* ── Xtend Health website redesign — theme system ─────────────────────── */

:root {
  --page-max: 1120px;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

/* Theme: brand (current identity — teal→indigo gradient) */
body[data-theme="brand"] {
  --bg: #fafbfc;
  --bg-alt: #f3f5f8;
  --surface: #ffffff;
  --ink: #0f1117;
  --ink-mid: #3a3d47;
  --muted: #7a7e8a;
  --line: #e8eaef;
  --accent: oklch(0.55 0.14 125);
  --grad: oklch(0.80 0.17 122);
  --grad-subtle: oklch(0.96 0.04 122);
  --btn-bg: oklch(0.80 0.17 122);
  --btn-ink: #0f1117;
  --font-display: 'DM Sans', sans-serif;
  --display-weight: 700;
  --display-tracking: -0.03em;
  --radius: 12px;
}

/* Theme: calm (existing palette, quieter — single teal accent, no gradients) */
body[data-theme="calm"] {
  --bg: #fbfcfd;
  --bg-alt: #f2f6f8;
  --surface: #ffffff;
  --ink: #101318;
  --ink-mid: #3a3f48;
  --muted: #798088;
  --line: #e6eaee;
  --accent: oklch(0.52 0.12 220);
  --grad: oklch(0.52 0.12 220);
  --grad-subtle: oklch(0.96 0.015 220);
  --btn-bg: oklch(0.38 0.09 230);
  --btn-ink: #ffffff;
  --font-display: 'DM Sans', sans-serif;
  --display-weight: 600;
  --display-tracking: -0.025em;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 32px; }

/* ── Type ── */
.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.08;
  text-wrap: balance;
}
.display em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.eyebrow::after { content: ''; width: 48px; height: 1px; background: var(--line); }

.section-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.12;
  max-width: 640px;
  text-wrap: balance;
}
.section-sub {
  margin-top: 16px;
  font-size: 18px;
  color: var(--ink-mid);
  max-width: 560px;
  text-wrap: pretty;
}

section { padding: 96px 0; }
section.tight { padding: 64px 0; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-logo img { height: 24px; display: block; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 15px; font-weight: 500; color: var(--ink-mid); }
.nav-links a:hover { color: var(--ink); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: calc(var(--radius) * 4);
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.15s;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); }
.btn-primary:hover { color: var(--btn-ink); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn-secondary:hover { box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); }
.btn-sm { padding: 9px 20px; font-size: 14px; }

/* ── Hero ── */
.hero { padding: 96px 0 72px; position: relative; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background: var(--bg-alt);
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent);
  mask-image: linear-gradient(to bottom, black, transparent);
}
.hero .wrap { position: relative; }
.hero-content { max-width: 780px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: clamp(40px, 5.6vw, 68px); }
.hero-sub {
  margin: 24px auto 0;
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-mid);
  max-width: 620px;
  text-wrap: pretty;
}
.hero-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 36px;
  flex-wrap: wrap;
}
.hero-shot { margin-top: 72px; }
.browser-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 80px -24px rgba(15, 17, 23, 0.18);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.browser-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.browser-frame img { display: block; width: 100%; }

/* ── Stat bar ── */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.stat {
  padding: 44px 40px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: none; padding-left: 0; }
.stat-num {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-size: 44px;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.stat-label { margin-top: 12px; font-weight: 600; font-size: 16px; }
.stat-sub { margin-top: 4px; font-size: 14.5px; color: var(--muted); }

/* ── Problem ── */
.problem-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.problem-cell { background: var(--surface); padding: 28px; }
.problem-cell h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.problem-cell p { font-size: 14.5px; color: var(--muted); line-height: 1.55; }

/* ── How it works ── */
.steps { margin-top: 64px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.step h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-size: 26px;
  margin: 14px 0 12px;
}
.step p { font-size: 15.5px; color: var(--ink-mid); line-height: 1.65; }
.step { border-top: 1px solid var(--line); padding-top: 24px; }

/* ── Feature rows (providers) ── */
.feature-row {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 72px;
  align-items: center;
  margin-top: 88px;
}
.feature-row:first-of-type { margin-top: 72px; }
.feature-row.flip .feature-copy { order: 2; }
.feature-copy h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 14px;
  text-wrap: balance;
}
.feature-copy p { font-size: 16.5px; color: var(--ink-mid); line-height: 1.65; max-width: 440px; text-wrap: pretty; }
.feature-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.feature-shot img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 16px 56px -20px rgba(15, 17, 23, 0.16);
}

/* ── Patients ── */
.patients { background: var(--bg-alt); }
.patient-grid {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.patient-card { text-align: center; }
.phone-shot {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 0.468;
  margin: 0 auto;
  border-radius: 32px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 20px 56px -20px rgba(15, 17, 23, 0.22);
  background: #f3efe8;
}
.phone-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.phone-shot img.zoom-care { transform: scale(1.15); transform-origin: 50% 100%; }
.patient-card h4 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 21px;
  margin: 26px 0 8px;
}
.patient-card p { font-size: 15px; color: var(--ink-mid); line-height: 1.6; max-width: 300px; margin: 0 auto; }

/* ── Before / After ── */
.ba {
  margin-top: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.ba-head, .ba-row { display: grid; grid-template-columns: 1fr 1fr; }
.ba-head > div {
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ba-head .before { background: var(--bg-alt); color: var(--muted); }
.ba-head .after { background: var(--btn-bg); color: var(--btn-ink); }
.ba-row { border-top: 1px solid var(--line); }
.ba-row > div { padding: 18px 24px; font-size: 15.5px; line-height: 1.55; }
.ba-row .before { color: var(--muted); background: var(--surface); border-right: 1px solid var(--line); }
.ba-row .after { color: var(--ink); background: var(--grad-subtle); }

/* ── Testimonial ── */
.quote { text-align: center; max-width: 800px; margin: 0 auto; }
.quote blockquote {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.3;
  text-wrap: balance;
}
.quote-attr { margin-top: 28px; font-size: 15px; color: var(--muted); }
.quote-attr strong { color: var(--ink); font-weight: 600; display: block; }

/* ── Integrations ── */
.integrations { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.logo-row {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 12px;
}
.logo-chip {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-mid);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 3);
  padding: 9px 18px;
  background: var(--bg);
  white-space: nowrap;
}
.logo-more { align-self: center; font-size: 14px; color: var(--muted); padding-left: 8px; }

/* ── FAQ ── */
.faq-list { margin-top: 48px; border-top: 1px solid var(--line); max-width: 800px; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 22px 40px 22px 0;
  font-size: 17.5px;
  font-weight: 600;
  position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 300;
  color: var(--muted);
}
.faq-list details[open] summary::after { content: '−'; }
.faq-list details p {
  padding: 0 40px 24px 0;
  font-size: 15.5px;
  color: var(--ink-mid);
  line-height: 1.65;
  max-width: 720px;
}

/* ── CTA / footer ── */
.cta-final { background: var(--ink); color: #fafbfc; text-align: center; }
.cta-final .section-title { color: #fafbfc; margin: 0 auto; }
.cta-final > .wrap > p { margin: 18px auto 0; max-width: 520px; opacity: 0.8; font-size: 17px; }
.cta-final .hero-ctas { margin-top: 36px; }
.cta-final .btn-primary { background: #fafbfc; color: #0f1117; }
.cta-final .btn-secondary { color: #fafbfc; box-shadow: inset 0 0 0 1.5px rgba(250, 251, 252, 0.4); }
.cta-final .btn-secondary:hover { box-shadow: inset 0 0 0 1.5px #fafbfc; color: #fafbfc; }

.demo-form {
  max-width: 620px;
  margin: 40px auto 0;
  text-align: left;
}

.demo-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.demo-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-form-group.full-width,
.demo-form-error,
.demo-form-submit {
  grid-column: 1 / -1;
}

.demo-form-group label {
  color: #fafbfc;
  font-size: 14px;
  font-weight: 600;
}

.demo-form-group label .optional {
  color: rgba(250, 251, 252, 0.58);
  font-size: 13px;
  font-weight: 400;
}

.demo-form-group input,
.demo-form-group textarea {
  width: 100%;
  border: 1px solid rgba(250, 251, 252, 0.18);
  border-radius: var(--radius);
  background: rgba(250, 251, 252, 0.08);
  color: #fafbfc;
  font-family: var(--font-body);
  font-size: 15.5px;
  outline: none;
  padding: 13px 15px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.demo-form-group input:focus,
.demo-form-group textarea:focus {
  background: rgba(250, 251, 252, 0.12);
  border-color: rgba(250, 251, 252, 0.72);
  box-shadow: 0 0 0 3px rgba(250, 251, 252, 0.12);
}

.demo-form-group input::placeholder,
.demo-form-group textarea::placeholder {
  color: rgba(250, 251, 252, 0.44);
}

.demo-form-group textarea {
  min-height: 112px;
  resize: vertical;
}

.demo-form-submit {
  margin-top: 4px;
}

.demo-form-submit .btn {
  justify-content: center;
  width: 100%;
}

.demo-form-submit .btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.demo-form-success {
  display: none;
  padding: 28px 0 0;
  text-align: center;
}

.demo-form-success .success-icon {
  align-items: center;
  background: #fafbfc;
  border-radius: 50%;
  display: inline-flex;
  height: 64px;
  justify-content: center;
  margin-bottom: 24px;
  width: 64px;
}

.demo-form-success .success-icon svg {
  height: 32px;
  width: 32px;
}

.demo-form-success h3 {
  color: #fafbfc;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.2;
  margin-bottom: 10px;
}

.demo-form-success p {
  color: rgba(250, 251, 252, 0.72);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 420px;
}

.demo-form-error {
  display: none;
  background: rgba(255, 230, 230, 0.1);
  border: 1px solid rgba(255, 210, 210, 0.32);
  border-radius: var(--radius);
  color: #ffd6d6;
  font-size: 14px;
  padding: 12px 14px;
}

.footer { padding: 40px 0 48px; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-inner img { height: 18px; opacity: 0.5; }
.footer-links { display: flex; gap: 24px; }
.footer-links a, .footer-copy { font-size: 13.5px; color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* ── Legal pages ── */
.legal-nav-links { gap: 20px; }

.privacy-container,
.legal-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 96px 32px;
}

.privacy-container h1,
.legal-container > h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 58px);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.06;
  text-wrap: balance;
}

.privacy-date,
.legal-date {
  margin-top: 14px;
  margin-bottom: 48px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.privacy-content,
.legal-content {
  color: var(--ink-mid);
  font-size: 16px;
  line-height: 1.75;
}

.privacy-content p,
.legal-content p {
  margin-bottom: 20px;
}

.privacy-content strong,
.legal-content strong {
  color: var(--ink);
  font-weight: 650;
}

.privacy-content h1,
.privacy-content h2,
.privacy-content h3,
.privacy-content h4,
.legal-content h1,
.legal-content h2,
.legal-content h3,
.legal-content h4 {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.18;
  margin: 48px 0 18px;
  text-wrap: balance;
}

.privacy-content h1,
.legal-content h1 {
  font-size: clamp(25px, 3vw, 34px);
}

.privacy-content h2,
.legal-content h2 {
  font-size: 25px;
}

.privacy-content h3,
.legal-content h3 {
  font-size: 21px;
}

.privacy-content h4,
.legal-content h4 {
  font-size: 18px;
}

.privacy-content ul,
.privacy-content ol,
.legal-content ul,
.legal-content ol {
  margin: 0 0 24px;
  padding-left: 24px;
}

.privacy-content li,
.legal-content li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.privacy-content blockquote,
.legal-content blockquote {
  margin: 18px 0 22px;
  padding-left: 20px;
  border-left: 2px solid var(--line);
  color: var(--ink-mid);
}

.privacy-content a,
.legal-content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  text-underline-offset: 4px;
}

.privacy-content a:hover,
.legal-content a:hover {
  color: var(--accent);
}

.privacy-content table,
.legal-content table {
  display: block;
  width: 100%;
  margin: 28px 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
}

.privacy-content th,
.privacy-content td,
.legal-content th,
.legal-content td {
  min-width: 180px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.privacy-content th,
.legal-content th {
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  section { padding: 64px 0; }
  .stats-grid, .steps, .problem-grid, .patient-grid { grid-template-columns: 1fr; }
  .stat { border-left: none; border-top: 1px solid var(--line); padding: 28px 0; }
  .stat:first-child { border-top: none; }
  .feature-row { grid-template-columns: 1fr; gap: 32px; margin-top: 64px; }
  .feature-row.flip .feature-copy { order: 0; }
  .nav-links a:not(.btn) { display: none; }
  .demo-form-grid { grid-template-columns: 1fr; }
  .ba-head, .ba-row { grid-template-columns: 1fr; }
  .ba-row .before { border-right: none; border-bottom: 1px solid var(--line); }
  .ba-head .before { display: none; }
  .privacy-container, .legal-container { padding: 72px 24px; }
  .privacy-date, .legal-date { margin-bottom: 36px; }
}
