/* ============================================================
   BLUE MOUNTAIN WELLNESS — HOME CARE PROGRAM
   Single-file app. Edit sections marked with ✏️ to customize.
   ============================================================ */

:root {
  /* ✏️ Brand Colors */
  --navy:    #1a2e3b;
  --teal:    #2d7d6f;
  --teal-lt: #3a9e8d;
  --sage:    #7aab96;
  --cream:   #f7f4ef;
  --warm:    #e8e2d9;
  --amber:   #c9954a;
  --red:     #c0392b;
  --white:   #ffffff;
  --text:    #1a2e3b;
  --muted:   #6b7c88;
  --border:  #ddd8d0;

  --radius:  14px;
  --shadow:  0 4px 24px rgba(26,46,59,0.10);
  --shadow-sm: 0 2px 8px rgba(26,46,59,0.08);
  --nav-h:   68px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 16px);
  -webkit-font-smoothing: antialiased;
}

/* ── PAGE SYSTEM ── */
.page { display: none; padding: 20px 16px; max-width: 480px; margin: 0 auto; }
.page.active { display: block; }

/* ── HEADER ── */
.app-header {
  background: var(--navy);
  color: var(--white);
  padding: 20px 20px 16px;
  position: sticky; top: 0; z-index: 100;
  max-width: 100%;
}
.app-header-inner { max-width: 480px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.logo-area { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 36px; height: 36px; background: var(--teal);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 18px; color: var(--white);
}
.logo-text { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.9; }
.header-date { font-size: 12px; opacity: 0.6; }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(26,46,59,0.08);
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  padding: 8px 12px; border-radius: 10px;
  color: var(--muted); font-size: 10px; font-weight: 500;
  font-family: var(--font-body); letter-spacing: 0.04em; text-transform: uppercase;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn.active { color: var(--teal); }
.nav-btn svg { width: 22px; height: 22px; stroke-width: 1.8; }

/* ── CARDS ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 14px;
}
.card-accent {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 14px;
}
.card-teal {
  background: var(--teal);
  color: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}

/* ── TYPOGRAPHY ── */
.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 12px; margin-top: 4px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px; color: var(--navy);
  margin-bottom: 6px; line-height: 1.2;
}
h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
h4 { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
p { font-size: 14px; line-height: 1.6; color: var(--muted); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--teal); color: var(--white);
  border: none; border-radius: 12px;
  font-family: var(--font-body); font-size: 15px; font-weight: 600;
  padding: 14px 24px; cursor: pointer; width: 100%;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-navy { background: var(--navy); }
.btn-outline {
  background: transparent; border: 2px solid var(--border);
  color: var(--text); font-size: 14px; padding: 10px 18px;
}
.btn-sm { padding: 9px 16px; font-size: 13px; border-radius: 9px; width: auto; }

/* ── PROGRESS BAR ── */
.progress-wrap { background: var(--warm); border-radius: 100px; height: 8px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; border-radius: 100px; background: var(--teal); transition: width 0.4s ease; }
.progress-fill.amber { background: var(--amber); }
.progress-fill.red { background: var(--red); }

/* ── STREAK ── */
.streak-row { display: flex; gap: 6px; margin: 12px 0; }
.streak-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--warm); display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: var(--muted);
}
.streak-dot.done { background: var(--teal); color: var(--white); }
.streak-dot.today { background: var(--amber); color: var(--white); }

/* ── SCORE INPUTS ── */
.score-row { display: flex; gap: 8px; margin: 8px 0; }
.score-btn {
  flex: 1; padding: 9px 0; border: 2px solid var(--border);
  border-radius: 8px; background: var(--white);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; color: var(--text);
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.score-btn.sel-low  { border-color: var(--teal); background: var(--teal); color: var(--white); }
.score-btn.sel-mid  { border-color: var(--amber); background: var(--amber); color: var(--white); }
.score-btn.sel-high { border-color: var(--red); background: var(--red); color: var(--white); }

/* ── EXERCISE CARD ── */
.ex-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 12px; overflow: hidden;
}
.ex-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ex-card-header:active { background: var(--cream); }
.ex-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 100px;
  background: var(--warm); color: var(--muted);
}
.ex-badge.warmup   { background: #fef3e0; color: #b46e1a; }
.ex-badge.mobility { background: #e0f0ee; color: #1d6b5e; }
.ex-badge.activate { background: #e8eef6; color: #2c4a7c; }
.ex-badge.stretch  { background: #f0ebe8; color: #7a4535; }
.ex-badge.breath   { background: #edf0e8; color: #45652a; }
.ex-body {
  display: none; padding: 0 18px 18px; border-top: 1px solid var(--border);
  padding-top: 14px;
}
.ex-body.open { display: block; }
.ex-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ex-meta span {
  font-size: 12px; font-weight: 600; color: var(--teal);
  background: var(--warm); padding: 4px 10px; border-radius: 100px;
}
.ex-section { margin-bottom: 10px; }
.ex-section strong { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); display: block; margin-bottom: 3px; }
.ex-section p { font-size: 14px; color: var(--text); line-height: 1.55; }
.ex-video-placeholder {
  background: var(--warm); border-radius: 10px; height: 140px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; color: var(--muted); font-size: 13px;
  border: 2px dashed var(--border);
}
.ex-video-placeholder svg { margin-right: 6px; }
.check-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.check-box {
  width: 28px; height: 28px; border-radius: 8px;
  border: 2px solid var(--border); background: var(--white);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.check-box.checked { background: var(--teal); border-color: var(--teal); }
.check-box svg { display: none; }
.check-box.checked svg { display: block; }

/* ── TRACK SELECTOR ── */
.track-card {
  background: var(--white); border-radius: var(--radius);
  border: 2px solid var(--border); padding: 16px 18px;
  margin-bottom: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.track-card.selected { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45,125,111,0.12); }
.track-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--warm); display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.track-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.track-desc { font-size: 12px; color: var(--muted); }

/* ── PHASE TIMELINE ── */
.phase-card {
  background: var(--white); border-radius: var(--radius);
  border-left: 4px solid var(--border); padding: 16px 18px;
  margin-bottom: 10px;
}
.phase-card.active-phase { border-left-color: var(--teal); }
.phase-card.done-phase { border-left-color: var(--sage); opacity: 0.7; }
.phase-num { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.phase-name { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.phase-weeks { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.phase-focus { font-size: 13px; color: var(--text); line-height: 1.5; }

/* ── RED FLAG BOX ── */
.red-flag-box {
  background: #fff5f5; border: 2px solid #f5c0bb;
  border-radius: var(--radius); padding: 18px;
  margin-bottom: 14px;
}
.red-flag-title { color: var(--red); font-size: 15px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.red-flag-box ul { list-style: none; }
.red-flag-box li { font-size: 13px; color: #8b2e2e; padding: 4px 0; display: flex; align-items: flex-start; gap: 8px; }
.red-flag-box li::before { content: "⚠"; font-size: 12px; margin-top: 1px; flex-shrink: 0; }
.disclaimer {
  background: var(--warm); border-radius: 10px; padding: 14px 16px;
  font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 14px;
}

/* ── STAT ROW ── */
.stat-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-box { background: var(--white); border-radius: 12px; padding: 14px 10px; text-align: center; box-shadow: var(--shadow-sm); }
.stat-num { font-family: var(--font-display); font-size: 26px; color: var(--teal); line-height: 1; }
.stat-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 4px; }

/* ── WEEKLY CHART (simple bar) ── */
.mini-chart { display: flex; align-items: flex-end; gap: 6px; height: 60px; margin: 12px 0 4px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar {
  width: 100%; border-radius: 4px 4px 0 0;
  background: var(--teal); opacity: 0.85;
  transition: height 0.4s ease;
}
.chart-day { font-size: 9px; font-weight: 600; color: var(--muted); text-transform: uppercase; }

/* ── NOTES TEXTAREA ── */
textarea {
  width: 100%; border: 2px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-family: var(--font-body); font-size: 14px;
  color: var(--text); background: var(--white); resize: none;
  outline: none; transition: border-color 0.2s;
}
textarea:focus { border-color: var(--teal); }

/* ── TAGS ── */
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tag { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 100px; background: var(--warm); color: var(--muted); }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 14px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: var(--white);
  padding: 12px 22px; border-radius: 100px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(26,46,59,0.3);
  opacity: 0; transition: all 0.3s; z-index: 300;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── SEPARATOR ── */
.sep { height: 1px; background: var(--border); margin: 16px 0; }

/* ── SMOOTH SCROLL & MISC ── */
html { scroll-behavior: smooth; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mb4 { margin-bottom: 4px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ── GATE SCREENS ── */
#gate-notoken, #gate-dob {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--navy);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px; text-align: center;
}
.lock-logo { font-family: var(--font-display); font-size: 13px; font-weight: 300; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 48px; }
.lock-title { font-family: var(--font-display); font-size: 36px; color: var(--white); margin-bottom: 8px; }
.lock-sub { font-size: 14px; color: rgba(255,255,255,0.5); margin-bottom: 40px; max-width: 300px; }
.lock-hint { font-size: 12px; color: rgba(255,255,255,0.3); margin-top: 16px; }
.lock-form { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 300px; }
.lock-input { width: 100%; padding: 14px 18px; background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.12); border-radius: 12px; color: var(--white); font-family: var(--font-body); font-size: 15px; outline: none; transition: border-color 0.2s; }
.lock-input:focus { border-color: var(--teal-lt); }
.lock-btn { width: 100%; padding: 14px; background: var(--teal); border: none; border-radius: 12px; color: var(--white); font-family: var(--font-body); font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s, transform 0.1s; }
.lock-btn:hover { background: var(--teal-lt); }
.lock-btn:active { transform: scale(0.98); }
.lock-error { color: #f87171; font-size: 13px; text-align: center; }
