/* ============================================================
   Grow Tracker: shared mockup design system
   Every pages/<page>/mockup.html links this file:
     <link rel="stylesheet" href="../../assets/mock.css">
   Page-specific tweaks go in a local <style> block, but tokens,
   frame, and components defined here are the single source of
   visual truth. Change here → every mockup updates.
   ============================================================ */

:root {
  /* Surfaces: near-black with a green cast (grow-room at night) */
  --bg: #0b0e0c;
  --surface: #141914;
  --surface-2: #1b221c;
  --surface-3: #232c24;
  --line: #2a342b;

  /* Text */
  --text: #e9efe9;
  --text-dim: #94a296;
  --text-faint: #5c685e;

  /* Semantic color: used for meaning, not decoration */
  --green: #4ade80;      /* healthy / growth / primary action */
  --green-deep: #16a34a;
  --amber: #fbbf24;      /* tasks due / warnings / rotation reminders */
  --violet: #a78bfa;     /* flower stage */
  --blue: #60a5fa;       /* water / humidity */
  --red: #f87171;        /* alerts / hermie / overdue */
  --cyan: #67e8f9;       /* sensors / live data */

  --radius: 16px;
  --radius-sm: 10px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", monospace;
}

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

body {
  background: #06080a;
  color: var(--text);
  font-family: var(--font);
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 24px;
  min-height: 100vh;
}

/* Caption above each phone (state name, e.g. "Default" / "Empty state") */
.mock-label {
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ---------- Phone frame ---------- */
.phone {
  width: 390px;
  flex-shrink: 0;
}
.frame {
  width: 390px;
  height: 844px;
  background: var(--bg);
  border-radius: 44px;
  border: 6px solid #1c1f22;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.statusbar {
  height: 44px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}
.screen {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 96px;   /* room for bottom nav */
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }

/* ---------- App bar ---------- */
.appbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 16px;
}
.appbar .h1 { flex: 1; }
.appbar .back {
  color: var(--text-dim);
  font-size: 22px;
  text-decoration: none;
  padding: 4px 8px 4px 0;
}

/* ---------- Typography ---------- */
.h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.h2 { font-size: 17px; font-weight: 700; }
.label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 22px 0 10px;
}
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.mono { font-family: var(--mono); }

/* ---------- Cards & layout ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card.flat { border: none; background: var(--surface); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }
.spread { display: flex; justify-content: space-between; align-items: center; }

/* List rows (settings, logs) */
.listrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.listrow:last-child { border-bottom: none; }
.listrow .chev { color: var(--text-faint); font-size: 18px; }

/* ---------- Stat tiles ---------- */
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.stat .val { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .unit { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.stat .cap { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }

/* ---------- Chips, pills, badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.chip.on { background: rgba(74,222,128,.12); border-color: rgba(74,222,128,.4); color: var(--green); }

/* Stage pills: semantic per grow stage */
.stage {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.stage.seedling { background: rgba(103,232,249,.14); color: var(--cyan); }
.stage.veg      { background: rgba(74,222,128,.14);  color: var(--green); }
.stage.flower   { background: rgba(167,139,250,.16); color: var(--violet); }
.stage.dry      { background: rgba(251,191,36,.14);  color: var(--amber); }
.stage.cure     { background: rgba(251,191,36,.10);  color: #d9a92e; }
.stage.mother   { background: rgba(96,165,250,.14);  color: var(--blue); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}
.badge.ok    { background: rgba(74,222,128,.12); color: var(--green); }
.badge.warn  { background: rgba(251,191,36,.12); color: var(--amber); }
.badge.alert { background: rgba(248,113,113,.14); color: var(--red); }
.badge.info  { background: rgba(103,232,249,.10); color: var(--cyan); }

/* Local-first trust marker: used wherever data location matters */
.ondevice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}
.ondevice::before { content: "●"; font-size: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}
.btn.primary { background: var(--green); color: #08130b; }
.btn.ghost   { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger  { background: rgba(248,113,113,.12); color: var(--red); border: 1px solid rgba(248,113,113,.3); }
.btn.inline  { width: auto; padding: 9px 16px; font-size: 13px; border-radius: 10px; }

/* ---------- Photo / thumb placeholders ---------- */
.thumb {
  background: linear-gradient(135deg, #1d2b20, #12331e 60%, #0e2417);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 24px;
  aspect-ratio: 1;
}
.thumb.wide { aspect-ratio: 4 / 3; }
.thumb.hero { aspect-ratio: 16 / 10; font-size: 40px; border-radius: var(--radius); }

/* ---------- Progress ---------- */
.bar {
  height: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.bar.amber > i { background: var(--amber); }
.bar.violet > i { background: var(--violet); }

/* ---------- Pheno score dots (1–5) ---------- */
.dots { display: inline-flex; gap: 4px; }
.dots i {
  width: 10px; height: 10px;
  border-radius: 999px;
  background: var(--surface-3);
}
.dots i.f { background: var(--green); }

/* ---------- Bottom navigation ---------- */
.bottomnav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 78px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: stretch;
  padding: 6px 8px 18px;
}
.bottomnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
}
.bottomnav a .ic { font-size: 21px; line-height: 1; }
.bottomnav a.active { color: var(--green); }
.bottomnav a.fab-slot { position: relative; }
.bottomnav .fab {
  position: absolute;
  top: -22px;
  width: 56px; height: 56px;
  border-radius: 999px;
  background: var(--green);
  color: #08130b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(74,222,128,.35);
}

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.kv b { font-variant-numeric: tabular-nums; }
.toggle {
  width: 46px; height: 28px;
  border-radius: 999px;
  background: var(--surface-3);
  position: relative;
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--text-dim);
}
.toggle.on { background: var(--green-deep); }
.toggle.on::after { left: 21px; background: #fff; }

/* ---------- Appbar icon button (top-right) ----------
   Themed like the bottom-nav icons: muted, monochrome, quiet chrome.
   Use inline SVG w/ stroke="currentColor". NEVER glyphs that render
   as color emoji (⚙️ etc.) for interactive controls. */
.iconbtn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  flex-shrink: 0;
}
.iconbtn svg { width: 20px; height: 20px; }

/* Pinned to the app's top-right corner (just below the status bar),
   independent of the appbar's text block. */
.iconbtn.corner {
  position: absolute;
  top: 52px;
  right: 16px;
  z-index: 5;
}

/* Bottom-nav SVG icons (e.g. the Settings gear): same footprint as glyph .ic */
.bottomnav a svg { width: 21px; height: 21px; }

/* ---------- Split center FAB: quick-add (+) | camera ---------- */
.fab-split {
  position: absolute;
  top: -22px;
  display: flex;
  width: 108px;
  height: 52px;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(74,222,128,.35);
}
.fab-split > a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #08130b;
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
}
.fab-split > a + a { border-left: 1px solid rgba(8,19,11,.25); }
.fab-split svg { width: 22px; height: 22px; }
.bottomnav .fab-slot {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
