/* ============================================================
   Sandbar Health — member-app demo (preview)
   Layered on top of styles.css (which provides :root tokens,
   fonts, the paper grain, and the logo mark). These styles
   power the ungated, clickable product mockup: the activation
   flow, the member home, the concierge chat, and scheduling.
   ============================================================ */

:root {
  --over: #7A4A2A;          /* overdue / needs attention */
  --over-tint: rgba(122, 74, 42, 0.10);
  --card: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(28,28,40,0.04), 0 8px 28px rgba(28,28,40,0.06);
}

.app-body { background: var(--cream-warm); }

/* ---------- App top bar ---------- */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 249, 246, 0.88);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.app-bar-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.app-bar .logo { gap: 9px; }
.app-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-deep);
  background: rgba(26, 122, 109, 0.10);
  border-radius: 999px;
  padding: 4px 10px;
  margin-left: 10px;
  white-space: nowrap;
}
.app-exit {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.app-exit:hover { color: var(--teal); }

/* ---------- App page wrapper ---------- */
.app-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 24px 96px;
  position: relative;
  z-index: 2;
}

/* ---------- Greeting ---------- */
.greeting { margin-bottom: 28px; }
.greeting-date {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}
.greeting h1 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 8px;
}
.greeting-status { color: var(--ink-soft); font-size: 17px; }
.greeting-status strong { color: var(--ink); font-weight: 600; }

/* ---------- Generic app card ---------- */
.acard {
  background: var(--card);
  border: 1px solid var(--stone);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.acard-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 16px;
}
.acard h3 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 10px;
}

/* ---------- Quick actions ---------- */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.qa {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--stone);
  border-radius: 12px;
  padding: 18px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.qa:hover { transform: translateY(-2px); border-color: var(--teal-light); box-shadow: var(--shadow-sm); }
.qa-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: rgba(26, 122, 109, 0.10);
  color: var(--teal-deep);
  font-size: 18px;
  margin-bottom: 12px;
}
.qa-title { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 3px; }
.qa-hint { font-size: 13px; color: var(--ink-faint); line-height: 1.4; }

/* ---------- Doctor message (the wow) ---------- */
.dm {
  display: flex;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--stone);
  border-left: 3px solid var(--teal);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}
.avatar {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--teal-light);
  color: var(--teal-deep);
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 15px;
}
.dm-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; flex-wrap: wrap; }
.dm-name { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); }
.dm-role { font-size: 13px; color: var(--ink-faint); }
.dm-body { color: var(--ink); font-size: 15.5px; line-height: 1.6; }
.dm-foot { margin-top: 12px; display: flex; align-items: center; gap: 16px; }
.dm-time { font-size: 12px; color: var(--ink-faint); }

/* ---------- Dashboard grid ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

/* Sandbar Score */
.score-row { display: flex; align-items: baseline; gap: 4px; margin-bottom: 6px; }
.score-num { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 46px; line-height: 1; color: var(--ink); letter-spacing: -0.03em; }
.score-max { font-size: 16px; color: var(--ink-faint); font-weight: 600; }
.score-delta { font-size: 14px; color: var(--teal); font-weight: 600; }
.score-track { height: 6px; border-radius: 999px; background: var(--stone); margin: 16px 0 4px; overflow: hidden; }
.score-fill { height: 100%; width: 72%; background: linear-gradient(90deg, var(--teal), var(--teal-light)); border-radius: 999px; }

/* Open items */
.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--ink); line-height: 1.45; }
.item:first-child { border-top: none; padding-top: 0; }
.item:last-child { padding-bottom: 0; }
.udot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; }
.udot.over { background: var(--over); }
.udot.soon { background: var(--teal); }
.udot.routine { background: var(--ink-faint); }
.item-note { display: block; font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }

/* Up next */
.pill {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--teal-deep);
  background: rgba(26, 122, 109, 0.10);
  border-radius: 999px;
  padding: 3px 10px;
}
.upnext-title { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.upnext-meta { font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; }

/* ---------- Concierge invite ---------- */
.concierge {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--stone);
  border-radius: 16px;
  padding: 26px 28px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}
.concierge::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 380px; height: 380px;
  background: radial-gradient(closest-side, rgba(163,213,201,0.55), rgba(163,213,201,0));
  pointer-events: none;
}
.concierge-inner { position: relative; }
.concierge h2 { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -0.015em; color: var(--ink); margin-bottom: 8px; }
.concierge p { color: var(--ink-soft); font-size: 15.5px; max-width: 560px; margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.chip {
  font-size: 13.5px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--stone);
  border-radius: 999px;
  padding: 8px 14px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.chip:hover { border-color: var(--teal); background: #fff; }

/* ---------- Device vitals ---------- */
.vitals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.vital { background: var(--card); border: 1px solid var(--stone); border-radius: 12px; padding: 16px 18px; }
.vital-label { font-family: 'DM Sans', sans-serif; font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.vital-num { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 22px; color: var(--ink); letter-spacing: -0.01em; }
.vital-num span { font-size: 13px; font-weight: 600; color: var(--ink-faint); }
.vital-note { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.4; }

/* ---------- Updates ---------- */
.updates { list-style: none; margin: 0; padding: 0; }
.update { padding: 16px 0; border-top: 1px solid var(--line); }
.update:first-child { border-top: none; padding-top: 4px; }
.update-title { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 3px; }
.update-body { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.update-time { font-size: 12px; color: var(--ink-faint); margin-top: 5px; }

/* ---------- Section heading inside app ---------- */
.app-h {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 32px 0 14px;
}

/* ---------- Buttons (teal app primary) ---------- */
.btn-teal {
  display: inline-block;
  background: var(--teal);
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border: none;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-teal:hover { background: var(--teal-deep); }

/* ---------- Auth / activation screens ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
  z-index: 2;
  text-align: center;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--stone);
  border-radius: 18px;
  padding: 40px 36px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 30px; }
.auth-card .eyebrow { color: var(--teal); font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; margin-bottom: 12px; }
.auth-card h1 { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 26px; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 8px; line-height: 1.15; }
.auth-card .auth-sub { color: var(--ink-soft); font-size: 15.5px; margin-bottom: 26px; line-height: 1.5; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.input {
  width: 100%;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--stone);
  border-radius: 10px;
  padding: 13px 15px;
}
.input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(26,122,109,0.12); }
.auth-card .btn-teal { width: 100%; text-align: center; padding: 14px; }
.auth-note { font-size: 12.5px; color: var(--ink-faint); margin-top: 16px; line-height: 1.5; text-align: center; }
.auth-back { display: inline-block; margin-top: 28px; font-size: 14px; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.auth-back:hover { color: var(--teal); }

/* ---------- "Matching you" beat ---------- */
.beat-spinner {
  width: 46px; height: 46px;
  border: 3px solid var(--stone);
  border-top-color: var(--teal);
  border-radius: 50%;
  margin: 0 auto 26px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.beat-wrap h1 { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 26px; color: var(--ink); margin-bottom: 10px; letter-spacing: -0.02em; }
.beat-wrap p { color: var(--ink-soft); font-size: 16px; max-width: 380px; margin: 0 auto 24px; line-height: 1.5; }
.beat-steps { list-style: none; padding: 0; margin: 0 auto 28px; max-width: 320px; text-align: left; }
.beat-steps li { font-size: 14.5px; color: var(--ink-soft); padding: 8px 0 8px 26px; position: relative; }
.beat-steps li::before { content: '✓'; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.beat-steps li.pending { color: var(--ink-faint); }
.beat-steps li.pending::before { content: '○'; color: var(--ink-faint); font-weight: 400; }

/* ---------- Back link (deep screens) ---------- */
.app-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  text-decoration: none; margin-bottom: 22px;
}
.app-back:hover { color: var(--teal); }

/* ---------- Concierge chat screen ---------- */
.chat { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.chat-row { display: flex; }
.chat-row.is-user { justify-content: flex-end; }
.bubble {
  max-width: 80%;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.55;
}
.bubble.is-bot { background: var(--card); border: 1px solid var(--stone); color: var(--ink); border-bottom-left-radius: 5px; }
.bubble.is-user { background: var(--teal); color: var(--cream); border-bottom-right-radius: 5px; }
.bubble strong { font-weight: 700; }
.bubble.is-bot .bubble-label { display: block; font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); margin-bottom: 7px; }
.composer {
  display: flex; gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--stone); border-radius: 14px;
  padding: 10px 12px 10px 18px;
  position: sticky; bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.composer input { flex: 1; border: none; background: transparent; font-family: 'Source Sans 3', sans-serif; font-size: 15px; color: var(--ink); }
.composer input:focus { outline: none; }
.composer .send { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; border: none; background: var(--teal); color: var(--cream); font-size: 17px; cursor: pointer; }
.composer .send:hover { background: var(--teal-deep); }

/* ---------- Schedule screen ---------- */
.seg { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.seg-btn {
  font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 14px;
  color: var(--ink-soft); background: var(--card);
  border: 1px solid var(--stone); border-radius: 999px; padding: 9px 18px; cursor: pointer;
}
.seg-btn.is-active { color: var(--cream); background: var(--ink); border-color: var(--ink); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.slot {
  font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 15px;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--stone); border-radius: 11px; padding: 14px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.slot small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.slot:hover { border-color: var(--teal); }
.slot.is-selected { background: var(--teal); border-color: var(--teal); color: var(--cream); }
.slot.is-selected small { color: rgba(250,249,246,0.85); }
.confirmed { text-align: center; padding: 20px 0; }
.confirmed .check { width: 60px; height: 60px; border-radius: 50%; background: rgba(26,122,109,0.12); color: var(--teal); display: flex; align-items: center; justify-content: center; font-size: 30px; margin: 0 auto 20px; }
.confirmed h2 { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 24px; color: var(--ink); margin-bottom: 10px; }
.confirmed p { color: var(--ink-soft); font-size: 16px; max-width: 420px; margin: 0 auto 22px; line-height: 1.5; }
.hidden { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .qa-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .vitals { grid-template-columns: repeat(2, 1fr); }
  .greeting h1 { font-size: 28px; }
}
@media (max-width: 560px) {
  .app-wrap { padding: 26px 18px 80px; }
  .slots { grid-template-columns: repeat(2, 1fr); }
  .app-badge { display: none; }
  .bubble { max-width: 88%; }
}

/* ---------- Member-app preview (live app embedded in an iframe) ---------- */
.preview-body { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.preview-body .app-bar { position: static; flex: 0 0 auto; }
.preview-frame-wrap { flex: 1 1 auto; position: relative; background: var(--cream-warm); }
.preview-frame { width: 100%; height: 100%; border: 0; display: block; }

/* Welcome overlay shown on first visit */
.preview-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(28, 28, 40, 0.55);
  backdrop-filter: saturate(140%) blur(5px);
  animation: fade-in 0.25s ease;
}
.preview-overlay[hidden] { display: none; }
.preview-card {
  width: 100%; max-width: 460px;
  background: var(--card, #fff);
  border: 1px solid var(--stone);
  border-radius: 18px;
  padding: 36px 34px 30px;
  box-shadow: 0 18px 50px rgba(28, 28, 40, 0.28);
  text-align: center;
}
.preview-card .eyebrow {
  color: var(--teal); font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; margin-bottom: 12px;
}
.preview-card h1 {
  font-family: 'DM Sans', sans-serif; font-weight: 700;
  font-size: 25px; letter-spacing: -0.02em; color: var(--ink);
  margin-bottom: 10px; line-height: 1.15;
}
.preview-card p { color: var(--ink-soft); font-size: 15.5px; line-height: 1.5; margin: 0 auto 22px; max-width: 360px; }
.preview-card .beat-steps { margin-bottom: 26px; }
.preview-card .btn-teal { width: 100%; text-align: center; padding: 14px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Floating "Getting started" checklist widget + launcher */
.gs-widget {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 300px; max-width: calc(100vw - 32px);
  background: var(--card, #fff);
  border: 1px solid var(--stone);
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(28, 28, 40, 0.18);
  overflow: hidden;
}
.gs-widget[hidden] { display: none; }
.gs-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.gs-title { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 14px; color: var(--ink); }
.gs-collapse { background: none; border: none; cursor: pointer; color: var(--ink-faint); font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.gs-collapse:hover { color: var(--teal); background: rgba(26, 122, 109, 0.08); }
.gs-body { padding: 12px 16px 16px; }
.gs-progress { font-size: 12px; font-weight: 600; color: var(--teal); margin-bottom: 4px; }
.gs-body .beat-steps { margin: 0; max-width: none; }
.gs-body .beat-steps li { cursor: pointer; border-radius: 6px; transition: color 0.15s; }
.gs-body .beat-steps li:hover { color: var(--ink); }
.gs-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--teal); color: var(--cream);
  border: none; border-radius: 999px;
  padding: 12px 18px;
  font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 14px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(20, 99, 90, 0.32);
}
.gs-launcher[hidden] { display: none; }
.gs-launcher:hover { background: var(--teal-deep); }

@media (max-width: 560px) {
  .gs-widget { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; }
  .gs-launcher { right: 12px; bottom: 12px; }
}
