/* ============================================================================
   LSPI — shared design system
   Dark, high-contrast and athletic, matching the clinic's print collateral.
   Iconography is SVG throughout; there are no emoji anywhere in this product.
   ========================================================================= */

:root {
  --bg:        #070A09;
  --bg-2:      #0C110F;
  --surface:   #121815;
  --surface-2: #18201C;
  --surface-3: #1F2924;
  --line:      rgba(255, 255, 255, .085);
  --line-2:    rgba(255, 255, 255, .16);

  --text:      #EEF3F0;
  --text-2:    #A8B4AE;
  --muted:     #6F7C76;

  --green:     #2BD46E;
  --green-2:   #23B85E;
  --green-dim: rgba(43, 212, 110, .12);
  --green-line:rgba(43, 212, 110, .32);

  --amber:     #F5B94A;
  --amber-dim: rgba(245, 185, 74, .12);
  --red:       #F2645A;
  --red-dim:   rgba(242, 100, 90, .12);
  --blue:      #4CB4F5;
  --blue-dim:  rgba(76, 180, 245, .12);
  --violet:    #A78BFA;

  --r-sm: 8px;  --r: 14px;  --r-lg: 20px;  --r-xl: 28px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --nav-h: 68px;
  --max: 1440px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

::selection { background: var(--green); color: #04140A; }

h1, h2, h3, h4 { margin: 0; font-weight: 750; letter-spacing: -.022em; line-height: 1.14; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
p  { margin: 0; }
a  { color: inherit; text-decoration: none; }

/* The clinic's collateral leans on tight, heavy, uppercase display type. */
.display {
  font-weight: 800;
  letter-spacing: -.03em;
  text-transform: uppercase;
  line-height: .96;
}

.eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num  { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ------------------------------------------------------------------ logo */

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark {
  font-weight: 900; font-size: 22px; letter-spacing: -.06em;
  font-style: italic; line-height: 1;
}
.logo-mark .g { color: var(--green); }
.logo-sub {
  font-size: 8.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; line-height: 1.25; max-width: 96px;
}

/* --------------------------------------------------------------- surface */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.card-flush { padding: 0; overflow: hidden; }
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-hd h2, .card-hd h3 { display: flex; align-items: center; gap: 9px; }

.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap    { flex-wrap: wrap; }
.grow    { flex: 1 1 auto; min-width: 0; }
.gap-4 { gap: 4px } .gap-6 { gap: 6px } .gap-8 { gap: 8px } .gap-10 { gap: 10px }
.gap-12 { gap: 12px } .gap-16 { gap: 16px } .gap-20 { gap: 20px } .gap-24 { gap: 24px }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.muted   { color: var(--muted); }
.dim     { color: var(--text-2); }
.tiny    { font-size: 11.5px; }
.small   { font-size: 13px; }
.big     { font-size: 26px; font-weight: 780; letter-spacing: -.03em; }
.huge    { font-size: 38px; font-weight: 800; letter-spacing: -.035em; }
.center  { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* -------------------------------------------------------------- controls */

button, .btn {
  font-family: inherit; font-size: 14px; font-weight: 640;
  border-radius: 999px; border: 1px solid transparent;
  padding: 11px 20px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .13s ease, border-color .13s ease, opacity .13s ease, transform .08s ease;
  white-space: nowrap; color: var(--text); background: transparent;
}
button:active, .btn:active { transform: translateY(1px); }
button:disabled, .btn[aria-disabled="true"] { opacity: .42; cursor: not-allowed; }

.btn-primary { background: var(--green); color: #04140A; font-weight: 720; }
.btn-primary:hover:not(:disabled) { background: #46E084; }
.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-2); }
.btn-quiet { color: var(--text-2); padding: 8px 12px; }
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { border-color: rgba(242,100,90,.4); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red-dim); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 26px; font-size: 15.5px; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--green); width: auto; }

input, select, textarea {
  font-family: inherit; font-size: 15px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 12px 14px; width: 100%;
  transition: border-color .13s ease, background .13s ease;
}
input:focus, select, textarea:focus { outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--green-line); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236F7C76' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
label.field { display: block; }
label.field > span { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 620; color: var(--text-2); }

/* ---------------------------------------------------------------- pieces */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 660; letter-spacing: .01em;
  border: 1px solid var(--line-2); color: var(--text-2);
  white-space: nowrap;
}
.pill svg { width: 12px; height: 12px; }
.pill-green  { background: var(--green-dim); border-color: var(--green-line); color: var(--green); }
.pill-amber  { background: var(--amber-dim); border-color: rgba(245,185,74,.34); color: var(--amber); }
.pill-red    { background: var(--red-dim);   border-color: rgba(242,100,90,.34); color: var(--red); }
.pill-blue   { background: var(--blue-dim);  border-color: rgba(76,180,245,.34); color: var(--blue); }
.pill-solid  { background: var(--green); border-color: var(--green); color: #04140A; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 760; letter-spacing: .01em;
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--line-2);
}
.avatar-sm { width: 30px; height: 30px; font-size: 10.5px; }
.avatar-lg { width: 54px; height: 54px; font-size: 17px; }

.icon { width: 18px; height: 18px; flex: 0 0 auto; stroke-width: 1.9; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 22px; height: 22px; }

/* progress + meters */
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--green); transition: width .4s cubic-bezier(.2,.8,.2,1); }

.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }

/* skeleton shimmer while data loads */
@keyframes shimmer { 0% { background-position: -420px 0 } 100% { background-position: 420px 0 } }
.skel {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 42%, var(--surface-2) 84%);
  background-size: 420px 100%; animation: shimmer 1.25s linear infinite;
  color: transparent !important; pointer-events: none;
}

/* ---------------------------------------------------------------- layout */

.shell { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
/* padding-block only -- a shorthand here would wipe out .shell's gutters,
   since the two classes are applied to the same element at equal specificity */
.page { padding-block: 22px 120px; }
.page-hd { margin-bottom: 20px; }

/* toast */
#toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 18px); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(520px, calc(100% - 32px));
}
.toast {
  background: var(--surface-3); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 12px 16px; font-size: 14px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  animation: toastIn .22s cubic-bezier(.2,.9,.3,1); width: 100%;
}
.toast-good { border-color: var(--green-line); }
.toast-bad  { border-color: rgba(242,100,90,.45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* sheet / modal */
.scrim {
  position: fixed; inset: 0; background: rgba(3,6,5,.72);
  backdrop-filter: blur(6px); z-index: 150;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: min(560px, 100%); max-height: 92vh; overflow: auto;
  padding: 8px 20px 28px; box-shadow: var(--shadow-lg);
  animation: sheetUp .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes sheetUp { from { transform: translateY(28px); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet-grip { width: 38px; height: 4px; border-radius: 999px; background: var(--line-2); margin: 8px auto 16px; }
@media (min-width: 720px) {
  .scrim { align-items: center; }
  .sheet { border-radius: var(--r-xl); max-height: 88vh; }
}

/* empty state */
.empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty svg { width: 30px; height: 30px; opacity: .5; }

/* ------------------------------------------------------------- app chrome */

.appbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(7,10,9,.86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.appbar-in { max-width: var(--max); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 14px; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
  background: rgba(7,10,9,.94); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-in { max-width: 620px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 11px 4px 10px; font-size: 10px; font-weight: 620; letter-spacing: .01em;
  color: var(--muted); background: none; border: 0; border-radius: 0; position: relative;
}
.tab svg { width: 21px; height: 21px; stroke-width: 1.8; }
.tab[aria-current="true"] { color: var(--green); }
.tab[aria-current="true"]::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 2px; background: var(--green); border-radius: 0 0 3px 3px;
}
.tab .badge {
  position: absolute; top: 6px; right: calc(50% - 20px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 9.5px; font-weight: 750;
  display: grid; place-items: center; border: 2px solid var(--bg);
}

/* -------------------------------------------------------------- utility */

.hide { display: none !important; }
@media (max-width: 900px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 620px) {
  h1 { font-size: 25px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .shell { padding: 0 16px; }
  .card { padding: 16px; border-radius: var(--r); }
  .huge { font-size: 32px; }
}

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.scroll-x::-webkit-scrollbar { height: 7px; }
.scroll-x::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
