:root {
  --primary: #0e9e46;
  --primary-dark: #0b6b30;
  --primary-container: #dff5e6;
  --secondary: #0a5fa0;
  --background: #efe8d8;
  --surface: #ffffff;
  --text: #1e2a22;
  --text-secondary: #5a6459;
  --border: #dcd3be;
  --error: #ba1a1a;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --heading: "Fraunces", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

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

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { display: block; max-width: 100%; }

.view { display: none; min-height: 100vh; }
.view.active { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; font-weight: 700; transition: background .15s, transform .05s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border: 1.5px solid var(--primary); color: var(--primary); }
.btn-lg { height: 56px; padding: 0 32px; font-size: 18px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.link { color: var(--text-secondary); font-size: 13px; }
.link:hover { text-decoration: underline; }
.link.strong { color: var(--primary); font-weight: 700; letter-spacing: .5px; }
.mobile-only { display: none; width: 100%; }

/* ---------- Landing ---------- */
.landing { position: relative; overflow: hidden; }
.landing-inner {
  position: relative; z-index: 1;
  max-width: 1040px; margin: 0 auto; padding: 32px 24px 24px;
}
.leaf {
  position: absolute; width: 90px; height: 56px; background: var(--primary-container);
  border-radius: 100% 0 100% 0; opacity: .9;
}
.leaf-tl { top: 8px; left: -10px; transform: rotate(-35deg); }
.leaf-tr { top: 24px; right: -20px; width: 130px; height: 80px; transform: rotate(-20deg); }
.leaf-bl { bottom: 90px; left: -20px; transform: rotate(-25deg); }

.brand-row { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 40px; }
.brand-icon { width: 64px; height: 64px; object-fit: contain; }
.brand-wordmark { width: 230px; height: auto; }

.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; margin-bottom: 40px; }
.hero h1 {
  font-family: var(--heading); font-weight: 700; color: var(--secondary);
  font-size: clamp(34px, 5vw, 56px); line-height: 1.15; margin-bottom: 16px;
}
.hero-sub { font-size: 17px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 28px; max-width: 460px; }
.hero-img {
  width: 100%; aspect-ratio: 450 / 233; object-fit: cover;
  border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(30, 42, 34, .15);
}

.impact-banner {
  width: fit-content; margin: 0 auto 32px; background: var(--primary); color: #fff;
  padding: 12px 32px; border-radius: 999px; font-weight: 700; font-size: 14px; letter-spacing: .5px; text-align: center;
}
.impact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 40px; }
.impact-item { text-align: center; }
.impact-circle {
  width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--primary-container); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.impact-circle svg { width: 26px; height: 26px; fill: currentColor; }
.impact-circle svg[stroke] { fill: none; }
.impact-item p { font-weight: 600; font-size: 14px; line-height: 1.4; }

.site-footer { display: flex; justify-content: center; gap: 20px; padding: 16px 0; font-size: 13px; flex-wrap: wrap; }
.site-footer a { color: var(--text-secondary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Auth ---------- */
.auth {
  position: relative; background: var(--bg) center / cover no-repeat, #d9d6bd;
}
.auth.active { display: flex; }
.auth-overlay { position: absolute; inset: 0; background: rgba(7, 64, 29, .15); }
.auth-inner {
  position: relative; z-index: 1; width: 100%; max-width: 480px; margin: 0 auto;
  padding: 32px 16px; display: flex; flex-direction: column; justify-content: center;
}
.auth-brand { text-align: center; margin-bottom: 32px; }
.auth-icon { width: 72px; height: 72px; object-fit: contain; margin: 0 auto 4px; }
.auth-wordmark { width: 220px; height: auto; margin: 0 auto 16px; }
.tagline { font-weight: 500; font-size: 14px; line-height: 1.5; color: #3a3a3a; }

.sheet {
  background: rgba(245, 245, 229, .75); backdrop-filter: blur(6px);
  border-radius: var(--radius-xl); padding: 24px 24px 20px;
}
.card {
  background: var(--surface); border-radius: var(--radius-xl); padding: 24px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}

.tabs { display: flex; gap: 32px; margin-bottom: 24px; }
.tab {
  font-weight: 600; font-size: 17px; color: var(--text-secondary);
  padding-bottom: 8px; border-bottom: 3px solid transparent;
}
.tab.active { color: var(--primary); font-family: var(--heading); border-bottom-color: var(--primary); }

.field { display: block; margin-bottom: 16px; }
.label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.req { color: var(--error); }
.input {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); flex: 1;
}
.input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 158, 70, .15); }
.input svg { width: 20px; height: 20px; fill: var(--text-secondary); flex: none; }
.input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 15px; color: var(--text); }
.input input::placeholder { color: #8a9388; }

.phone-row { display: flex; gap: 8px; margin-bottom: 16px; }
.country {
  height: 52px; padding: 0 16px; display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: 16px; font-size: 15px;
}

.error { color: var(--error); font-size: 13px; margin-bottom: 12px; }

.footer-row { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-secondary); }

.link-back { color: var(--text-secondary); font-size: 13px; margin-bottom: 12px; }
.otp-title { font-family: var(--heading); font-weight: 600; font-size: 24px; margin-bottom: 6px; }
.otp-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }
.otp-input {
  width: 100%; height: 60px; text-align: center; font-size: 28px; letter-spacing: 12px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 16px; margin-bottom: 16px; outline: 0; font-family: var(--body);
}
.otp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 158, 70, .15); }
.resend { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-secondary); }
.resend .link { color: var(--primary); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-copy { text-align: left; }
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
  .desktop-only { display: none; }
  .mobile-only { display: inline-flex; }
  .brand-wordmark { width: 200px; }
}

/* ---------- Portal (signed in) ---------- */
.portal { background: var(--background); padding-bottom: 96px; }
.portal.active { display: block; }
.p-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 20px; max-width: 100%; }
.p-top.plain { background: var(--background); }
.p-top.green { background: var(--primary); color: #fff; }
.p-top > * { max-width: 960px; }
.p-brand { display: flex; align-items: center; gap: 8px; flex: 1; }
.p-brand img { height: 48px; width: auto; }
.p-brand .wm { height: 44px; }
.p-title { flex: 1; text-align: center; font-weight: 700; font-size: 20px; }
.p-back { color: #fff; font-size: 24px; width: 36px; }
.p-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(245,240,228,.9); }
.p-top.green .p-avatar { background: none; border: 1.5px solid rgba(255,255,255,.8); }
.p-avatar svg { width: 24px; height: 24px; fill: var(--text); }
.p-top.green .p-avatar svg { fill: #fff; }
.p-body { max-width: 760px; margin: 0 auto; padding: 8px 16px 24px; }
.tab-pane { display: none; }
.tab-pane.on { display: block; }

.white-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 18px; margin-bottom: 16px; }
.hero-card { background: var(--primary-container); border-radius: 32px; padding: 32px 20px; text-align: center; margin: 12px 0 16px; }
.hero-card h2 { font-family: var(--heading); font-weight: 600; font-size: 30px; line-height: 1.25; margin-bottom: 12px; }
.hero-card p { color: var(--text-secondary); font-size: 17px; line-height: 1.5; margin-bottom: 20px; }
.pill-cta { height: 52px; padding: 0 32px; font-size: 18px; letter-spacing: .5px; }
.card-h { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.collect-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; text-align: center; }
.collect-row p { font-size: 13px; font-weight: 500; margin-top: 8px; }
.ic { width: 52px; height: 52px; border-radius: 50%; background: var(--primary-container); color: var(--primary-dark); display: inline-grid; place-items: center; }
.ic svg { width: 26px; height: 26px; }
.ic.big { width: 60px; height: 60px; flex: none; }
.sched-card { padding: 0; overflow: hidden; }
.sched-top { display: flex; gap: 16px; align-items: center; padding: 18px; }
.sched-top h3 { font-size: 20px; } .sched-top p { color: var(--text-secondary); margin-top: 4px; }
.sched-btn { width: 100%; height: 52px; background: var(--primary); color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.sec-h { font-family: var(--heading); font-weight: 600; font-size: 24px; margin: 24px 0 12px; }
.latest { display: flex; gap: 14px; align-items: center; }
.latest-txt { flex: 1; min-width: 0; }
.latest-txt b { color: var(--primary-dark); font-size: 18px; }
.latest-txt p { font-weight: 500; margin: 2px 0; } .latest-txt small { color: var(--text-secondary); }
.btn.small { height: 40px; padding: 0 18px; font-size: 14px; letter-spacing: .5px; flex: none; }
.muted { color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.muted.center { text-align: center; padding: 16px 0; }
.contrib { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.contrib b { display: block; font-size: 17px; } .contrib span { color: var(--text-secondary); font-size: 14px; }
.badge { font-style: normal; font-size: 12px; font-weight: 600; background: #dcebf8; color: var(--secondary); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.badge.bad { background: #ffdad6; color: var(--error); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--border); display: flex; justify-content: space-around; padding: 8px 8px max(8px, env(safe-area-inset-bottom)); }
.tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-secondary); min-width: 64px; }
.tabbar button span { width: 56px; height: 32px; border-radius: 16px; display: grid; place-items: center; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--primary); }
.tabbar button.on span { background: var(--primary-container); }
.tabbar .fab { margin-top: -26px; color: var(--secondary); }
.tabbar .fab span, .tabbar .fab.on span { width: 56px; height: 56px; border-radius: 50%; background: var(--secondary); color: #fff; font-size: 34px; font-weight: 400; box-shadow: 0 6px 14px rgba(10,95,160,.35); }
.tabbar .fab.on { color: var(--secondary); }
.tabbar i { position: absolute; top: 0; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--error); }

/* map */
#pane-map { margin: 0 -16px; }
.map-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; }
.pin-chip { background: var(--primary-container); color: var(--primary-dark); font-weight: 600; padding: 10px 18px; border-radius: 999px; }
.seg { display: flex; background: var(--primary-container); border-radius: 999px; padding: 3px; }
.seg button { padding: 8px 18px; border-radius: 999px; font-weight: 600; color: var(--text-secondary); }
.seg button.active { background: var(--primary); color: #fff; }
.dest-banner { display: flex; gap: 14px; align-items: center; background: var(--primary-container); padding: 14px 16px; color: var(--primary-dark); }
.dest-banner b { font-size: 18px; } .dest-banner p { color: var(--secondary); }
.nav-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 22px; flex: none; }
#map { height: min(60vh, 560px); background: #e5e3df; z-index: 1; }
.map-foot { background: #fff; padding: 16px; }
.map-foot h4 { font-size: 13px; letter-spacing: 1.5px; color: var(--text-secondary); margin-bottom: 6px; }

/* donate */
.give-banner { display: flex; gap: 16px; align-items: center; background: var(--primary-dark); color: #fff; border-radius: 28px; padding: 22px; margin: 12px 0 24px; }
.give-banner svg { width: 52px; height: 52px; fill: #fff; }
.give-banner h2 { font-family: var(--heading); font-size: 34px; font-weight: 600; } .give-banner p { opacity: .85; }
.eyebrow { display: flex; justify-content: space-between; font-size: 13px; letter-spacing: 1px; color: var(--secondary); font-weight: 600; margin: 24px 0 10px; }
.eyebrow .link { letter-spacing: 0; text-transform: none; }
.item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.item { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px; border: 2px solid var(--border); border-radius: 18px; background: #fff; font-weight: 600; font-size: 17px; text-align: left; }
.item.sel { border-color: var(--primary); background: var(--primary-container); }
.item .box { width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--border); display: grid; place-items: center; color: #fff; font-size: 16px; }
.item.sel .box { background: var(--primary); border-color: var(--primary); }
.qty { display: inline-flex; align-items: center; gap: 20px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 6px; }
.qty button { width: 44px; height: 44px; border-radius: 50%; background: var(--primary-container); color: var(--primary-dark); font-size: 24px; }
.qty span { min-width: 60px; text-align: center; font-weight: 700; font-size: 18px; }
.week-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 600; }
.week-nav button { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--primary); font-size: 22px; }
.week-nav button:disabled { color: var(--border); cursor: default; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { display: flex; flex-direction: column; align-items: center; padding: 10px 0; border-radius: 14px; background: #fff; border: 1px solid var(--border); }
.day small { color: var(--text-secondary); } .day b { font-size: 20px; }
.day.sel { background: var(--primary); color: #fff; border-color: var(--primary); } .day.sel small { color: #fff; }
.day:disabled { opacity: .4; cursor: default; }
.slot-card { margin-top: 14px; background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 14px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.slot { padding: 14px 6px; border: 1px solid var(--border); border-radius: 14px; background: #fff; font-weight: 500; display: flex; flex-direction: column; align-items: center; }
.slot small { font-size: 11px; color: var(--text-secondary); }
.slot.sel { border: 2px solid var(--primary); background: var(--primary-container); color: var(--primary-dark); }
.slot:disabled { opacity: .45; cursor: default; background: #f1ede2; }
.addr-box { background: #fff; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.addr-box input, .notes { width: 100%; border: 0; outline: 0; padding: 16px; font: inherit; font-size: 15px; background: transparent; }
.addr-box hr { border: 0; border-top: 1px solid var(--border); }
.notes { background: #fff; border: 1px solid var(--border); border-radius: 18px; resize: vertical; }
#schedule-btn { margin-top: 20px; }

.note small { color: var(--secondary); font-weight: 700; letter-spacing: 1px; font-size: 11px; }
.note b { display: block; margin: 4px 0; font-size: 17px; } .note.unread { border-left: 5px solid var(--primary); }
.cancel-pickup { color: var(--error); margin-top: 10px; }

/* modal / toast */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 20px; }
.modal-card { background: #fff; border-radius: 32px; padding: 28px 24px; width: 100%; max-width: 420px; text-align: center; }
.modal-ic { width: 44px; height: 44px; fill: var(--primary); margin: 0 auto 8px; }
.modal-card h3 { font-family: var(--heading); font-size: 26px; margin-bottom: 8px; }
.modal-card p { color: var(--text-secondary); line-height: 1.5; margin-bottom: 18px; }
.modal-card input { width: 100%; height: 56px; padding: 0 18px; border: 1px solid var(--border); border-radius: 18px; font: inherit; font-size: 17px; margin-bottom: 14px; outline: 0; }
.modal-card input:focus { border-color: var(--primary); }
.modal-card .cancel { display: block; margin: 16px auto 0; font-size: 16px; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: #333; color: #fff; padding: 12px 20px; border-radius: 14px; z-index: 60; }

@media (min-width: 900px) {
  .p-body { max-width: 860px; }
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 560px; bottom: 16px; border: 1px solid var(--border); border-radius: 28px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
  #pane-map { margin: 0; border-radius: 24px; overflow: hidden; }
}
@media (max-width: 480px) {
  .collect-row { grid-template-columns: repeat(5, 1fr); }
  .collect-row .ic { width: 44px; height: 44px; } .collect-row p { font-size: 11px; }
  .hero-card h2 { font-size: 26px; }
}

.pin-row { width: 100%; display: flex; justify-content: space-between; padding: 14px 16px; font-size: 15px; }
.pin-row b { color: var(--primary); }
.pick-map-wrap { position: relative; margin-top: 12px; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); }
#pick-map { height: 280px; z-index: 1; }
.pick-seg { position: absolute; top: 10px; right: 10px; z-index: 500; background: rgba(255,255,255,.95); }

/* .modal-card p (grey) outranks .error, so the pincode message needs its own rule */
.modal-card .error { color: var(--error); font-size: 14px; line-height: 1.5; margin: -4px 0 14px; }
