/* ═══════════════════════════════════════════════════════════════════════════
   Family Shopping List — Botanical Watercolor Theme
   Inspired by Sarah Coyne's botanical illustrations
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --sage:         #8fae8b;
  --sage-light:   #c5d9c0;
  --sage-pale:    #e8f0e4;
  --cream:        #fdf8f0;
  --cream-warm:   #f9f1e3;
  --ivory:        #fffef9;
  --dusty-rose:   #d4a0a0;
  --rose-light:   #f0d5d1;
  --rose-pale:    #faf0ee;
  --terracotta:   #c67a5c;
  --earth-brown:  #8b6f5e;
  --bark:         #5c4a3d;
  --text:         #3e3433;
  --text-light:   #7a6b64;
  --gold:         #c9a84c;
  --gold-light:   #f0e2b8;
  --sky-blue:     #8ab4c7;
  --sky-pale:     #dceef5;

  --font-display: 'Caveat', cursive;
  --font-body:    'Nunito', sans-serif;

  --radius:       12px;
  --radius-lg:    20px;
  --shadow:       0 4px 20px rgba(92,74,61,0.10);
  --shadow-sm:    0 2px 8px rgba(92,74,61,0.08);
}

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

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── Watercolor background wash ─────────────────────────────────────────── */
.watercolor-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(143,174,139,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(212,160,160,0.14) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(201,168,76,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 90%, rgba(138,180,199,0.10) 0%, transparent 45%),
    linear-gradient(170deg, var(--cream) 0%, var(--cream-warm) 50%, var(--cream) 100%);
}

/* ─── Botanical corner decorations ───────────────────────────────────────── */
.botanical-border {
  position: fixed;
  font-size: 2.5rem;
  opacity: 0.20;
  z-index: 0;
  pointer-events: none;
}
.botanical-border.top-left     { top: 20px; left: 20px; }
.botanical-border.top-right    { top: 20px; right: 20px; transform: scaleX(-1); }
.botanical-border.bottom-left  { bottom: 20px; left: 20px; }
.botanical-border.bottom-right { bottom: 20px; right: 20px; transform: scaleX(-1); }
.botanical-border.top-left::after     { content: '🌿🍃🌸'; }
.botanical-border.top-right::after    { content: '🌸🍃🌿'; }
.botanical-border.bottom-left::after  { content: '🌻🌾🍂'; }
.botanical-border.bottom-right::after { content: '🍂🌾🌻'; }

/* ═══════════════════════════════════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.landing-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.landing-container {
  width: 100%;
  max-width: 660px;
  z-index: 1;
}

.landing-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(143,174,139,0.25);
  text-align: center;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.landing-header h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--bark);
  line-height: 1.1;
}

.leaf-accent { font-size: 2rem; opacity: 0.5; }

.landing-subtitle {
  color: var(--text-light);
  font-size: 1.05rem;
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

.landing-divider {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 1.5rem;
  opacity: 0.4;
  margin-bottom: 2rem;
}

/* ─── Role Cards ─────────────────────────────────────────────────────────── */
.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.25rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.role-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(92,74,61,0.15);
}

.consumer-card {
  background: linear-gradient(145deg, var(--sage-pale), rgba(197,217,192,0.5));
  border: 1px solid rgba(143,174,139,0.30);
}

.shopper-card {
  background: linear-gradient(145deg, var(--rose-pale), rgba(240,213,209,0.5));
  border: 1px solid rgba(212,160,160,0.30);
}

.role-icon { font-size: 3rem; margin-bottom: 0.75rem; }

.role-card h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  color: var(--bark);
}

.role-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.role-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.4;
}

.role-arrow {
  margin-top: 1rem;
  font-size: 1.5rem;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
}

.role-card:hover .role-arrow {
  opacity: 0.8;
  transform: translateX(4px);
}

.landing-footer-art {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 1.8rem;
  opacity: 0.3;
  margin-bottom: 1.5rem;
}

.landing-footer {
  color: var(--text-light);
  font-size: 0.85rem;
}

.landing-footer a {
  color: var(--sage);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP LAYOUT (Consumer + Shopper)
   ═══════════════════════════════════════════════════════════════════════════ */
.app-page {
  min-height: 100vh;
  padding-bottom: 2rem;
}

.app-header {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(253,248,240,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(143,174,139,0.15);
}

.app-header h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--bark);
  line-height: 1;
}

.app-header .subtitle {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.2rem;
}

.header-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.header-nav a {
  font-size: 0.8rem;
  color: var(--sage);
  text-decoration: none;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.header-nav a:hover { background: var(--sage-pale); }

.app-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--sage);
  color: white;
  box-shadow: 0 2px 8px rgba(143,174,139,0.3);
}
.btn-primary:hover {
  background: #7a9e76;
  box-shadow: 0 4px 14px rgba(143,174,139,0.35);
}

.btn-rose {
  background: var(--dusty-rose);
  color: white;
  box-shadow: 0 2px 8px rgba(212,160,160,0.3);
}
.btn-rose:hover {
  background: #c08e8e;
}

.btn-gold {
  background: var(--gold);
  color: white;
  box-shadow: 0 2px 8px rgba(201,168,76,0.3);
}
.btn-gold:hover { background: #b8983f; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--sage);
  color: var(--sage);
}
.btn-outline:hover {
  background: var(--sage-pale);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  border-radius: 6px;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background: rgba(0,0,0,0.05); }

/* ─── Add Item Form ──────────────────────────────────────────────────────── */
.add-item-section {
  margin-bottom: 1.25rem;
}

.add-item-toggle {
  width: 100%;
  text-align: center;
  margin-bottom: 0.75rem;
}

.add-item-form {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(143,174,139,0.2);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: none;
}

.add-item-form.open { display: block; }

.form-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
}

.form-group input,
.form-group textarea {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid rgba(143,174,139,0.3);
  border-radius: 8px;
  background: var(--ivory);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--sage);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ─── Checklist ──────────────────────────────────────────────────────────── */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checklist-item {
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(143,174,139,0.15);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.checklist-item:hover {
  background: rgba(255,255,255,0.95);
  box-shadow: var(--shadow-sm);
}

.checklist-item.needed {
  border-left: 3px solid var(--terracotta);
  background: rgba(250,240,238,0.6);
}

.checklist-item.collected {
  border-left: 3px solid var(--sage);
  background: rgba(232,240,228,0.5);
}

.checklist-item.unavailable {
  border-left: 3px solid var(--text-light);
  background: rgba(200,200,200,0.15);
  opacity: 0.7;
}

.checklist-item.substituted {
  border-left: 3px solid var(--gold);
  background: rgba(240,226,184,0.3);
}

/* ─── Custom checkbox ────────────────────────────────────────────────────── */
.check-wrap {
  flex-shrink: 0;
  margin-top: 2px;
}

.check-wrap input[type="checkbox"] { display: none; }

.check-wrap .checkmark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--sage-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-size: 14px;
  color: transparent;
}

.check-wrap input:checked + .checkmark {
  background: var(--sage);
  border-color: var(--sage);
  color: white;
}

/* ─── Item info ──────────────────────────────────────────────────────────── */
.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

.item-desc {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.3;
}

.item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.qty-input {
  font-family: var(--font-body);
  font-size: 0.85rem;
  width: 70px;
  padding: 0.25rem 0.5rem;
  border: 1.5px solid rgba(143,174,139,0.3);
  border-radius: 6px;
  background: var(--ivory);
  color: var(--text);
  outline: none;
}
.qty-input:focus { border-color: var(--sage); }
.qty-input::placeholder { color: #bbb; }

.qty-label {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 600;
}

/* ─── Shopper-specific ───────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-left: auto;
}

.status-badge.needed     { background: var(--rose-light); color: var(--terracotta); }
.status-badge.collected  { background: var(--sage-pale); color: #5a7a56; }
.status-badge.unavailable { background: #e0e0e0; color: #666; }
.status-badge.substituted { background: var(--gold-light); color: #8a7030; }

.shopper-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.shopper-actions .btn-sm {
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
}

.note-area {
  margin-top: 0.4rem;
}

.note-input {
  font-family: var(--font-body);
  font-size: 0.82rem;
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 1.5px solid rgba(201,168,76,0.3);
  border-radius: 6px;
  background: rgba(255,254,249,0.9);
  color: var(--text);
  outline: none;
  resize: none;
}
.note-input:focus { border-color: var(--gold); }
.note-input::placeholder { color: #c0b89a; }

/* ─── Shopping action bar ────────────────────────────────────────────────── */
.shopping-bar {
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(143,174,139,0.2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.shopping-bar .status-text {
  font-size: 0.9rem;
  color: var(--text-light);
}

.shopping-bar .status-text strong {
  color: var(--text);
}

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}

.empty-state .empty-icon {
  font-size: 3rem;
  opacity: 0.4;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 1rem;
}

/* ─── Decorative section divider ─────────────────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0;
  opacity: 0.3;
  font-size: 1rem;
}

.section-divider::before,
.section-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--sage-light);
}

/* ─── Filter bar (consumer) ──────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  border: 1.5px solid var(--sage-light);
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn.active {
  background: var(--sage);
  border-color: var(--sage);
  color: white;
}
.filter-btn:hover:not(.active) {
  background: var(--sage-pale);
}

/* ─── Search bar ─────────────────────────────────────────────────────────── */
.search-bar {
  position: relative;
  margin-bottom: 1rem;
}

.search-bar input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem 0.6rem 2.2rem;
  border: 1.5px solid rgba(143,174,139,0.25);
  border-radius: 10px;
  background: rgba(255,255,255,0.7);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.search-bar input:focus { border-color: var(--sage); }

.search-bar .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.4;
}

/* ─── Toasts / notifications ─────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bark);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.88rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease-out;
  max-width: 300px;
}

.toast.success { background: #5a7a56; }
.toast.error   { background: var(--terracotta); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Page footer decoration ─────────────────────────────────────────────── */
.page-footer {
  text-align: center;
  padding: 2rem 1rem 1rem;
  color: var(--text-light);
  font-size: 0.8rem;
  opacity: 0.6;
}

.page-footer .footer-art {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
  letter-spacing: 0.3em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .landing-card {
    padding: 2rem 1.25rem;
  }

  .landing-header h1 {
    font-size: 2.3rem;
  }

  .role-cards {
    grid-template-columns: 1fr;
  }

  .app-header h1 { font-size: 1.8rem; }

  .app-container { padding: 0.75rem 0.75rem 2rem; }

  .checklist-item { padding: 0.75rem; }

  .form-row { flex-direction: column; gap: 0.5rem; }

  .shopping-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .toast-container {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .toast { max-width: 100%; }
}
