/* =====================================================================
   Pot & Bloom — Wireframe Prototype
   Low-fidelity, mobile-first design system (shared across Flow A & B)
   Material Design 3 + Apple HIG inspired · 2026
   ===================================================================== */

:root {
  /* Wireframe greyscale */
  --ink:        #2b2f2c;
  --ink-soft:   #5c635d;
  --ink-faint:  #9aa39c;
  --line:       #d9ddd8;
  --line-soft:  #e7eae5;
  --surface:    #ffffff;
  --surface-2:  #f4f6f2;
  --ph:         #e6e9e3;   /* image placeholder fill */
  --ph-2:       #dfe3dc;

  /* Single brand accent (plant green) kept restrained for low-fi */
  --leaf:       #3f6b52;
  --leaf-soft:  #e4efe7;
  --leaf-ink:   #2e4f3c;

  /* Status / utility */
  --good:       #5b9e6f;
  --warn:       #c9a23d;
  --alert:      #c75c5c;

  /* Geometry */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* Spacing scale (4pt) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px;

  --shadow: 0 6px 20px rgba(35, 45, 38, .08);
  --shadow-sm: 0 2px 8px rgba(35, 45, 38, .06);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #eef2ec 0%, #e7ebe4 60%, #e2e7df 100%);
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 12px;
}

/* ----------------------------- Phone frame ------------------------- */
.phone {
  position: relative;
  width: 390px;
  height: 844px;
  max-height: calc(100vh - 48px);
  background: var(--surface);
  border-radius: 44px;
  box-shadow: 0 30px 70px rgba(30, 40, 33, .28), 0 0 0 11px #1d211e, 0 0 0 13px #2c322d;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 150px; height: 28px; background: #1d211e;
  border-bottom-left-radius: 16px; border-bottom-right-radius: 16px;
  z-index: 60;
}

.status-bar {
  height: 50px; flex: 0 0 50px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; font-size: 13px; font-weight: 600; color: var(--ink);
  z-index: 55; background: transparent;
}
.status-bar .sb-right { display: flex; gap: 6px; align-items: center; }
.status-bar svg { display: block; }

/* --------------------------- Screen stack -------------------------- */
.viewport {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  background: var(--surface);
}

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--surface);
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform .34s cubic-bezier(.22,.61,.36,1), opacity .28s ease;
  z-index: 1;
}
.screen.active   { transform: translateX(0);   opacity: 1; visibility: visible; z-index: 2; }
.screen.behind   { transform: translateX(-22%); opacity: .65; visibility: visible; z-index: 0; }

/* Splash never slides */
.screen.splash { transform: translateX(0); opacity: 0; }
.screen.splash.active { opacity: 1; }

.scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding-bottom: 96px; /* space for bottom nav */
}
.scroll::-webkit-scrollbar { width: 0; height: 0; }

/* ------------------------------ Splash ----------------------------- */
.splash-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--s6);
  background: linear-gradient(180deg, #eaf2ec 0%, #ffffff 70%);
  text-align: center; padding: var(--s8);
}
.logo-mark {
  width: 108px; height: 108px; border-radius: 30px;
  background: var(--leaf-soft);
  display: grid; place-items: center;
  border: 2px dashed var(--leaf);
  color: var(--leaf);
}
.logo-mark svg { width: 56px; height: 56px; }
.brand-name { font-size: 26px; font-weight: 800; letter-spacing: .5px; color: var(--leaf-ink); }
.brand-name span { font-weight: 400; color: var(--ink-soft); }
.brand-sub { font-size: 12px; color: var(--ink-faint); margin-top: 8px; letter-spacing: .14em; text-transform: uppercase; }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--leaf-soft); border-top-color: var(--leaf);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.splash-illus {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(circle at 20% 80%, var(--leaf-soft) 0 40px, transparent 41px),
    radial-gradient(circle at 85% 20%, var(--leaf-soft) 0 28px, transparent 29px),
    radial-gradient(circle at 78% 88%, var(--leaf-soft) 0 18px, transparent 19px);
}

/* ----------------------------- Headers ----------------------------- */
.home-header {
  padding: var(--s4) var(--s5) var(--s3);
  background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.greet-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.greet { line-height: 1.2; }
.greet .hi { font-size: 12px; color: var(--ink-faint); letter-spacing: .02em; }
.greet .name { font-size: 19px; font-weight: 800; color: var(--ink); }
.header-actions { display: flex; gap: var(--s2); }

.icon-btn {
  width: 42px; height: 42px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center; position: relative; cursor: pointer;
  color: var(--ink-soft); transition: transform .12s ease, background .2s ease;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: var(--leaf); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--surface);
}

.search-bar {
  margin-top: var(--s4);
  display: flex; align-items: center; gap: var(--s3);
  height: 48px; padding: 0 var(--s4);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); color: var(--ink-faint); cursor: pointer;
}
.search-bar svg { width: 19px; height: 19px; flex: 0 0 auto; }
.search-bar span { font-size: 14px; }

/* Generic app bar for sub-screens */
.app-bar {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line-soft);
  background: var(--surface); position: sticky; top: 0; z-index: 20;
}
.app-bar .title { font-size: 17px; font-weight: 700; }
.back-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); display: grid; place-items: center; cursor: pointer;
  color: var(--ink); flex: 0 0 auto;
}
.back-btn:active { transform: scale(.92); }

/* ----------------------------- Sections ---------------------------- */
.section { padding: var(--s5) 0 0; }
.section-pad { padding-left: var(--s5); padding-right: var(--s5); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 var(--s5) var(--s3);
}
.section-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.section-sub { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.link-btn {
  font-size: 13px; font-weight: 700; color: var(--leaf); cursor: pointer;
  background: none; border: none; padding: 4px 2px;
}
.link-btn:active { opacity: .6; }

/* Horizontal scroller */
.hscroll {
  display: flex; gap: var(--s3); overflow-x: auto; overflow-y: hidden;
  padding: 0 var(--s5) var(--s2); scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: 0 0 auto; }

/* Image placeholder (wireframe) */
.img-ph {
  background:
    repeating-linear-gradient(45deg, var(--ph) 0 10px, var(--ph-2) 10px 20px);
  display: grid; place-items: center; color: var(--ink-faint);
  border-radius: var(--r-sm);
}
.img-ph svg { width: 30%; max-width: 38px; height: auto; opacity: .55; }

/* --------------------------- Hero banner --------------------------- */
.banner-carousel { position: relative; padding: var(--s4) 0 0; }
.banner-track {
  display: flex; gap: var(--s4); overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 var(--s5); scrollbar-width: none;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner {
  scroll-snap-align: center; flex: 0 0 calc(100% - 40px);
  height: 168px; border-radius: var(--r-lg);
  background: var(--leaf-soft);
  border: 1px solid var(--line);
  padding: var(--s5); position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: var(--s2);
}
.banner::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(63,107,82,.06) 0 12px, transparent 12px 24px);
}
.banner .tag { font-size: 11px; font-weight: 700; color: var(--leaf); letter-spacing: .08em; text-transform: uppercase; position: relative; }
.banner .b-title { font-size: 19px; font-weight: 800; color: var(--leaf-ink); position: relative; max-width: 70%; line-height: 1.2; }
.banner .cta {
  position: relative; align-self: flex-start; margin-top: var(--s2);
  background: var(--leaf); color: #fff; border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; padding: 9px 16px; border-radius: 999px;
}
.banner .cta:active { transform: scale(.96); }

.dots { display: flex; gap: 6px; justify-content: center; padding: var(--s3) 0 0; }
.dot {
  width: 7px; height: 7px; border-radius: 999px; background: var(--line);
  transition: width .25s ease, background .25s ease;
}
.dot.active { width: 20px; background: var(--leaf); }

/* --------------------------- Collections --------------------------- */
.collection-card {
  width: 96px; cursor: pointer; text-align: center;
}
.collection-card .ico {
  width: 96px; height: 96px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--leaf); margin-bottom: 6px;
  transition: transform .14s ease, background .2s ease;
}
.collection-card:active .ico { transform: scale(.94); background: var(--leaf-soft); }
.collection-card .ico svg { width: 34px; height: 34px; }
.collection-card .label { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.25; }

/* ----------------------------- Cards ------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}

/* My Plants */
.plant-card {
  width: 150px; padding: var(--s3); cursor: pointer;
}
.plant-card .img-ph { width: 100%; height: 104px; margin-bottom: var(--s3); border-radius: var(--r-sm); }
.plant-card .p-name { font-size: 14px; font-weight: 700; }
.plant-card .p-meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.health { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; margin-top: 8px; }
.health .pip { width: 8px; height: 8px; border-radius: 50%; }
.health.good { color: var(--good); } .health.good .pip { background: var(--good); }
.health.warn { color: var(--warn); } .health.warn .pip { background: var(--warn); }
.health.alert{ color: var(--alert);} .health.alert .pip{ background: var(--alert); }
.water-row { font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.water-row svg { width: 13px; height: 13px; color: var(--leaf); }

/* Today's tasks */
.task-list { padding: 0 var(--s5); display: flex; flex-direction: column; gap: var(--s2); }
.task-card {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); cursor: pointer; user-select: none;
}
.task-check {
  width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--line);
  flex: 0 0 auto; display: grid; place-items: center; color: #fff;
  transition: background .2s ease, border-color .2s ease;
}
.task-check svg { width: 14px; height: 14px; opacity: 0; transition: opacity .2s; }
.task-card.done .task-check { background: var(--leaf); border-color: var(--leaf); }
.task-card.done .task-check svg { opacity: 1; }
.task-body { flex: 1; }
.task-title { font-size: 14px; font-weight: 600; }
.task-card.done .task-title { text-decoration: line-through; color: var(--ink-faint); }
.task-sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.task-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--leaf-soft); display: grid; place-items: center; color: var(--leaf); flex: 0 0 auto; }
.task-ic svg { width: 18px; height: 18px; }

/* Streak */
.streak-card {
  margin: 0 var(--s5); padding: var(--s5);
  background: linear-gradient(135deg, var(--leaf-ink), var(--leaf));
  color: #fff; border-radius: var(--r-lg); position: relative; overflow: hidden;
}
.streak-card::after {
  content:""; position:absolute; right:-30px; top:-30px; width:130px; height:130px;
  border-radius:50%; background: rgba(255,255,255,.08);
}
.streak-top { display: flex; align-items: center; justify-content: space-between; }
.streak-num { font-size: 34px; font-weight: 800; line-height: 1; }
.streak-num small { font-size: 14px; font-weight: 600; opacity: .85; }
.streak-label { font-size: 12px; opacity: .85; margin-top: 4px; }
.badge-chip {
  width: 52px; height: 52px; border-radius: 16px; background: rgba(255,255,255,.16);
  display: grid; place-items: center; border: 1px dashed rgba(255,255,255,.5);
}
.week-row { display: flex; justify-content: space-between; margin-top: var(--s5); }
.day { text-align: center; font-size: 10px; opacity: .8; }
.day .pip {
  width: 24px; height: 24px; border-radius: 50%; margin: 0 auto 5px;
  background: rgba(255,255,255,.18); display: grid; place-items: center;
}
.day.on .pip { background: #fff; color: var(--leaf-ink); }
.day .pip svg { width: 13px; height: 13px; }

/* Products */
.product-card { width: 158px; padding: var(--s3); position: relative; cursor: pointer; }
.product-card .img-ph { width: 100%; height: 130px; border-radius: var(--r-sm); margin-bottom: var(--s3); }
.product-card .wish {
  position: absolute; top: var(--s4); right: var(--s4);
  width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.92);
  border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer;
  color: var(--ink-faint);
}
.product-card .wish.on { color: var(--alert); }
.product-card .wish.on svg { fill: var(--alert); }
.product-card .wish:active { transform: scale(.88); }
.product-card .pr-name { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.product-card .pr-cat  { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.price-row { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s2); }
.price { font-size: 15px; font-weight: 800; color: var(--leaf-ink); }
.price small { font-size: 11px; color: var(--ink-faint); text-decoration: line-through; font-weight: 600; margin-left: 4px; }
.add-mini {
  width: 30px; height: 30px; border-radius: 10px; background: var(--leaf); color: #fff;
  border: none; display: grid; place-items: center; cursor: pointer;
}
.add-mini:active { transform: scale(.9); }
.add-mini svg { width: 16px; height: 16px; }
.stars { display: flex; gap: 2px; color: var(--warn); margin-top: 4px; }
.stars svg { width: 12px; height: 12px; }

/* AI Plant Doctor highlight */
.ai-card {
  margin: var(--s6) var(--s5) var(--s2);
  padding: var(--s5); border-radius: var(--r-lg);
  background: var(--leaf-soft); border: 1px solid var(--line);
  display: flex; gap: var(--s4); align-items: center; cursor: pointer;
  position: relative; overflow: hidden;
}
.ai-card .cam {
  width: 60px; height: 60px; border-radius: 18px; background: var(--leaf);
  color: #fff; display: grid; place-items: center; flex: 0 0 auto;
}
.ai-card .cam svg { width: 30px; height: 30px; }
.ai-card .ai-title { font-size: 15px; font-weight: 800; color: var(--leaf-ink); line-height: 1.25; }
.ai-card .ai-sub { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.ai-card .start {
  margin-top: var(--s3); display: inline-flex; align-items: center; gap: 6px;
  background: var(--leaf); color: #fff; border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 700; padding: 8px 14px; border-radius: 999px;
}

/* ---------------------------- Bottom nav --------------------------- */
.bottom-nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
  height: 78px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-around; align-items: stretch;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; color: var(--ink-faint); border: none; background: none;
  font-size: 10.5px; font-weight: 600; position: relative;
}
.nav-item svg { width: 23px; height: 23px; transition: transform .15s ease; }
.nav-item.active { color: var(--leaf); }
.nav-item.active svg { transform: translateY(-1px); }
.nav-item.active::before {
  content:""; position:absolute; top:-9px; width:26px; height:3px; border-radius:3px; background: var(--leaf);
}
.nav-item:active svg { transform: scale(.9); }

/* --------------------------- Placeholder --------------------------- */
.placeholder {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: var(--s8); gap: var(--s4); color: var(--ink-faint);
}
.placeholder .ph-ico {
  width: 88px; height: 88px; border-radius: 26px; background: var(--surface-2);
  border: 2px dashed var(--line); display: grid; place-items: center; color: var(--leaf);
}
.placeholder .ph-ico svg { width: 40px; height: 40px; }
.placeholder h3 { margin: 0; font-size: 19px; color: var(--ink); }
.placeholder p { margin: 0; font-size: 13.5px; max-width: 240px; line-height: 1.5; }

/* ------------------------------ Intro ------------------------------ */
.intro-screen { background: var(--surface); }
.intro-track {
  flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.intro-track::-webkit-scrollbar { display: none; }
.intro-slide {
  flex: 0 0 100%; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--s8) var(--s7) var(--s6); text-align: center; gap: var(--s5);
}
.intro-illus {
  width: 220px; height: 220px; border-radius: 36px;
  background: var(--leaf-soft); border: 2px dashed var(--leaf);
  display: grid; place-items: center; color: var(--leaf); position: relative;
}
.intro-illus svg { width: 96px; height: 96px; }
.intro-illus::after {
  content: attr(data-cap); position: absolute; bottom: 12px;
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--leaf);
  opacity: .7;
}
.intro-text h2 { margin: 0 0 var(--s3); font-size: 23px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.intro-text p { margin: 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; max-width: 300px; }

.intro-footer {
  flex: 0 0 auto; padding: var(--s5) var(--s6) var(--s8);
  display: flex; flex-direction: column; gap: var(--s4);
}
.intro-dots { display: flex; gap: 7px; justify-content: center; }
.intro-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }

/* Buttons */
.btn {
  border: none; cursor: pointer; font-family: var(--font);
  font-size: 15px; font-weight: 700; border-radius: 999px; padding: 14px 22px;
  transition: transform .12s ease, opacity .2s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--leaf); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-soft); }
/* Stretch the primary action only inside the intro footer row */
.intro-actions .btn-primary { flex: 1; }
/* Placeholder action buttons size to content, centered */
.placeholder .btn { align-self: center; min-width: 200px; }
.btn-text { background: none; border: none; color: var(--ink-faint); font-size: 14px; font-weight: 600; cursor: pointer; padding: 8px; }
.btn-block { width: 100%; }

/* ------------------------------ Toast ------------------------------ */
.toast-wrap {
  position: absolute; left: 0; right: 0; bottom: 96px; z-index: 80;
  display: flex; justify-content: center; pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow);
  transform: translateY(20px); opacity: 0; transition: all .28s ease;
  max-width: 80%; text-align: center;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Reveal-on-scroll helper */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
