@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --green-dark: #14291F;
  --green: #1F3D2F;
  --green-soft: #2C4E3B;
  --amber: #C97E2E;
  --amber-lt: #E8C08A;
  --amber-bg: #FBF0E1;
  --cream: #F2F0EA;
  --white: #FFFFFF;
  --ink: #2B2B2B;
  --gray: #6B6B6B;
  --line: #E4E0D6;
  --success: #3C7A52;
  --error: #B3452C;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow: 0 8px 24px rgba(20, 41, 31, 0.10);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--green-dark);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.phone-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- Top status/app bar ---------- */
.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 20px 14px;
  background: var(--green-dark);
  color: var(--white);
  flex-shrink: 0;
}
.appbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--amber);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--green-dark);
  flex-shrink: 0;
}
.brand-text { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.25; }
.brand-text small { display: block; font-size: 10.5px; font-weight: 500; color: var(--amber-lt); letter-spacing: 0.08em; text-transform: uppercase; }
.appbar-action {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.appbar-action svg { width: 17px; height: 17px; }

/* ---------- Screen container ---------- */
.screen {
  flex: 1;
  display: none;
  flex-direction: column;
  animation: fadeSlide 320ms ease both;
}
.screen.active { display: flex; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px calc(24px + var(--safe-bottom));
}

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}
h1.page-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 27px;
  line-height: 1.18;
  color: var(--green-dark);
  margin-bottom: 10px;
}
p.page-sub {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 6px;
}

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--amber); color: var(--green-dark); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary:disabled:active { transform: none; }
.btn-dark { background: var(--green-dark); color: var(--white); }
.btn-ghost { background: transparent; color: var(--green-dark); border: 1.5px solid var(--line); }
.btn-text { background: none; border: none; color: var(--green); font-weight: 700; font-size: 13.5px; cursor: pointer; padding: 8px; }

/* ---------- Landing screen ---------- */
.landing-hero {
  flex: 1;
  background: linear-gradient(165deg, var(--green-dark) 0%, var(--green) 60%, var(--green-soft) 100%);
  display: flex;
  flex-direction: column;
  padding: 20px 24px calc(28px + var(--safe-bottom));
  position: relative;
  overflow: hidden;
  color: var(--white);
}
.landing-hero::before {
  content: '';
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,126,46,0.35), transparent 70%);
  top: -100px; right: -90px;
}
.landing-top {
  display: flex; justify-content: space-between; align-items: center;
  position: relative; z-index: 1;
}
.co-brand { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; color: var(--amber-lt); }
.qr-card {
  margin-top: 28px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative; z-index: 1;
  box-shadow: var(--shadow);
}
.qr-visual {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--cream);
  position: relative;
  display: grid;
  padding: 14px;
}
.qr-grid {
  display: grid;
  width: 100%; height: 100%;
  gap: 2px;
}
.qr-cell { background: transparent; border-radius: 1px; }
.qr-cell.on { background: var(--green-dark); }
.qr-finder {
  position: absolute;
  width: 22%; height: 22%;
  border: 4px solid var(--green-dark);
  border-radius: 4px;
  background: var(--cream);
}
.qr-finder::after {
  content: '';
  position: absolute; inset: 24%;
  background: var(--green-dark);
  border-radius: 1px;
}
.qr-finder.tl { top: 12px; left: 12px; }
.qr-finder.tr { top: 12px; right: 12px; }
.qr-finder.bl { bottom: 12px; left: 12px; }
.qr-visual .qr-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 22%; aspect-ratio: 1; background: var(--amber); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  border: 4px solid var(--cream);
  font-size: 20px;
}
.qr-caption { text-align: center; font-size: 12px; color: var(--gray); margin-top: 14px; font-weight: 600; }

.landing-copy { margin-top: 26px; position: relative; z-index: 1; }
.landing-copy h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 29px;
  line-height: 1.2;
  margin-bottom: 10px;
}
.landing-copy p { font-size: 14px; color: var(--amber-lt); line-height: 1.5; max-width: 34ch; }

.landing-cta { margin-top: 34px; position: relative; z-index: 1; }
.landing-cta .btn-primary { box-shadow: 0 10px 24px rgba(201,126,46,0.35); }
.landing-fine { text-align: center; font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 12px; }

/* ---------- Form elements ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--green-dark);
  margin-bottom: 8px; letter-spacing: 0.01em;
}
.phone-input-row {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 4px 4px 4px 14px;
  transition: border-color 150ms ease;
}
.phone-input-row:focus-within { border-color: var(--amber); }
.phone-prefix { font-size: 15px; font-weight: 700; color: var(--green-dark); border-right: 1.5px solid var(--line); padding-right: 10px; }
.phone-input-row input {
  border: none; outline: none; flex: 1; font-size: 16px; padding: 12px 8px;
  font-family: 'Inter', sans-serif; background: transparent; color: var(--ink);
}
.hint { font-size: 12px; color: var(--gray); margin-top: 8px; line-height: 1.45; }

.otp-boxes { display: flex; gap: 10px; margin-bottom: 8px; }
.otp-boxes input {
  width: 100%;
  aspect-ratio: 1;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--green-dark);
  outline: none;
  transition: border-color 150ms ease, transform 150ms ease;
  font-family: 'Inter', sans-serif;
}
.otp-boxes input:focus { border-color: var(--amber); transform: translateY(-2px); }
.otp-boxes input.filled { border-color: var(--green); }

.resend-row { display: flex; justify-content: center; margin-top: 18px; font-size: 13px; color: var(--gray); }
.resend-row button { color: var(--amber); background: none; border: none; font-weight: 700; cursor: pointer; font-size: 13px; }
.resend-row button:disabled { color: var(--gray); cursor: default; }

.otp-demo-note {
  margin-top: 22px;
  background: var(--amber-bg);
  border: 1px dashed var(--amber);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: #7A4E1A;
  line-height: 1.5;
}

/* ---------- Menu screen ---------- */
.menu-header {
  padding: 18px 20px 14px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.cutoff-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--amber-bg); color: #7A4E1A;
  font-size: 11.5px; font-weight: 700;
  padding: 6px 12px; border-radius: 100px;
  margin-bottom: 12px;
}
.cutoff-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.greet { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600; color: var(--green-dark); margin-bottom: 2px; }
.greet-sub { font-size: 13px; color: var(--gray); }

.category-tabs {
  display: flex; gap: 8px; padding: 14px 20px 0; overflow-x: auto; flex-shrink: 0; background: var(--white);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  padding: 9px 16px 12px; font-size: 13.5px; font-weight: 700; color: var(--gray);
  border: none; background: none; white-space: nowrap; cursor: pointer;
  border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.cat-tab.active { color: var(--green-dark); border-color: var(--amber); }

.menu-list { padding: 18px 20px calc(110px + var(--safe-bottom)); }
.menu-item {
  display: flex; gap: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}
.menu-item-thumb {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 26px;
}
.menu-item-body { flex: 1; min-width: 0; }
.menu-item-top { display: flex; justify-content: space-between; gap: 8px; }
.menu-item-name { font-size: 14.5px; font-weight: 700; color: var(--green-dark); }
.menu-item-tag { font-size: 10.5px; font-weight: 700; color: var(--success); background: #E4F0E7; padding: 2px 7px; border-radius: 6px; margin-left: 6px; white-space: nowrap; }
.menu-item-desc { font-size: 12px; color: var(--gray); margin-top: 3px; line-height: 1.4; }
.menu-item-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.menu-item-price { font-size: 14.5px; font-weight: 800; color: var(--green-dark); }

.qty-stepper { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--green); background: var(--white); color: var(--green);
  font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1;
}
.qty-btn.add { background: var(--green); color: var(--white); border-color: var(--green); }
.qty-btn.qty-btn-label {
  width: auto;
  min-width: 52px;
  padding: 0 14px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 700;
}
.qty-val { min-width: 16px; text-align: center; font-weight: 700; font-size: 14px; }

/* ---------- Cart bar ---------- */
.cart-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 20px calc(16px + var(--safe-bottom));
  background: linear-gradient(0deg, var(--cream) 60%, rgba(242,240,234,0));
  pointer-events: none;
}
.cart-bar-inner {
  pointer-events: all;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--green-dark); color: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: 0 10px 28px rgba(20,41,31,0.35);
  cursor: pointer;
  border: none;
  width: 100%;
}
.cart-bar-left { display: flex; align-items: center; gap: 10px; }
.cart-count {
  background: var(--amber); color: var(--green-dark); font-weight: 800; font-size: 12px;
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.cart-bar-label { font-size: 14px; font-weight: 700; }
.cart-bar-total { font-size: 15px; font-weight: 800; }

/* ---------- Cart / Review screen ---------- */
.cart-list { padding: 4px 0 18px; }
.cart-line {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.cart-line-thumb { width: 42px; height: 42px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.cart-line-info { flex: 1; min-width: 0; }
.cart-line-name { font-size: 13.5px; font-weight: 700; color: var(--green-dark); }
.cart-line-price { font-size: 12px; color: var(--gray); margin-top: 2px; }
.cart-line-total { font-size: 13.5px; font-weight: 800; color: var(--green-dark); min-width: 52px; text-align: right; }

.summary-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; margin-top: 6px; }
.summary-row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--gray); margin-bottom: 10px; }
.summary-row.total { font-size: 15px; font-weight: 800; color: var(--green-dark); border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 4px; margin-bottom: 0; }

.pickup-window {
  display: flex; align-items: center; gap: 12px;
  background: var(--amber-bg); border-radius: var(--radius-md);
  padding: 14px 16px; margin: 18px 0;
}
.pickup-window-icon { font-size: 20px; }
.pickup-window-text { font-size: 12.5px; color: #7A4E1A; line-height: 1.4; }
.pickup-window-text b { display: block; font-size: 13.5px; color: var(--green-dark); margin-bottom: 1px; }

.bottom-bar {
  padding: 14px 20px calc(16px + var(--safe-bottom));
  background: var(--white);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

/* ---------- Payment screen ---------- */
.pay-option {
  display: flex; align-items: center; gap: 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-md);
  padding: 15px 16px; margin-bottom: 12px; cursor: pointer;
  background: var(--white); transition: border-color 150ms ease, background 150ms ease;
}
.pay-option.selected { border-color: var(--green); background: #F3F8F4; }
.pay-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--cream);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.pay-option.selected .pay-icon { background: var(--green); color: var(--white); }
.pay-label { flex: 1; font-size: 14px; font-weight: 700; color: var(--green-dark); }
.pay-sub { font-size: 11.5px; color: var(--gray); margin-top: 2px; font-weight: 500; }
.radio-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; position: relative; }
.pay-option.selected .radio-dot { border-color: var(--green); }
.pay-option.selected .radio-dot::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--green); }

.pay-total-strip {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--green-dark); color: var(--white);
  border-radius: var(--radius-md); padding: 16px 18px; margin: 20px 0;
}
.pay-total-strip .label { font-size: 12.5px; color: var(--amber-lt); font-weight: 600; }
.pay-total-strip .value { font-size: 22px; font-weight: 800; font-family: 'Fraunces', serif; }

/* ---------- Confirmation / ticket ---------- */
.ticket {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 6px 0 20px;
}
.ticket-top {
  background: var(--green-dark);
  color: var(--white);
  padding: 22px 20px;
  text-align: center;
}
.ticket-top .check {
  width: 52px; height: 52px; border-radius: 50%; background: var(--amber);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.ticket-top h2 { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.ticket-top p { font-size: 12.5px; color: var(--amber-lt); }
.ticket-divider {
  position: relative; height: 0; border-top: 2px dashed var(--line); margin: 0 18px;
}
.ticket-divider::before, .ticket-divider::after {
  content: ''; position: absolute; top: -11px; width: 22px; height: 22px; border-radius: 50%; background: var(--green-dark);
}
.ticket-divider::before { left: -29px; }
.ticket-divider::after { right: -29px; }
.ticket-body { padding: 22px 20px; text-align: center; }
.ticket-code-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray); margin-bottom: 8px; }
.ticket-code {
  font-family: 'Fraunces', serif; font-size: 40px; font-weight: 700; letter-spacing: 0.06em; color: var(--green-dark);
  margin-bottom: 16px;
}
.ticket-barcode { display: flex; gap: 3px; justify-content: center; align-items: flex-end; height: 36px; margin-bottom: 18px; }
.ticket-barcode span { width: 3px; background: var(--green-dark); border-radius: 1px; }
.ticket-meta { display: flex; justify-content: center; gap: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.ticket-meta-item .k { font-size: 10.5px; color: var(--gray); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.ticket-meta-item .v { font-size: 13.5px; font-weight: 700; color: var(--green-dark); }

/* ---------- Status stepper ---------- */
.status-track { padding: 4px 6px; margin-bottom: 22px; }
.status-step { display: flex; gap: 14px; }
.status-step-line {
  display: flex; flex-direction: column; align-items: center;
}
.status-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--white); border: 2.5px solid var(--line);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--gray); font-size: 13px; font-weight: 800;
  transition: all 250ms ease;
}
.status-step.done .status-dot { background: var(--green); border-color: var(--green); color: var(--white); }
.status-step.current .status-dot { background: var(--amber); border-color: var(--amber); color: var(--green-dark); box-shadow: 0 0 0 5px var(--amber-bg); }
.status-connector { width: 2.5px; flex: 1; background: var(--line); min-height: 30px; }
.status-step.done .status-connector { background: var(--green); }
.status-step-content { padding-bottom: 26px; padding-top: 3px; }
.status-step-title { font-size: 14.5px; font-weight: 700; color: var(--gray); }
.status-step.done .status-step-title, .status-step.current .status-step-title { color: var(--green-dark); }
.status-step-time { font-size: 11.5px; color: var(--gray); margin-top: 2px; }

.collect-card {
  background: var(--amber-bg); border-radius: var(--radius-md);
  padding: 16px; display: flex; gap: 12px; align-items: center; margin-bottom: 6px;
}
.collect-card-icon { font-size: 24px; }
.collect-card-text { font-size: 12.5px; color: #7A4E1A; line-height: 1.45; }
.collect-card-text b { display: block; color: var(--green-dark); font-size: 13.5px; margin-bottom: 1px; }

/* ---------- Bottom nav (menu/status) ---------- */
.tabbar {
  display: flex; background: var(--white); border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + var(--safe-bottom)); flex-shrink: 0;
}
.tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; padding: 6px; cursor: pointer; color: var(--gray);
}
.tabbar-item.active { color: var(--green-dark); }
.tabbar-item svg { width: 20px; height: 20px; }
.tabbar-item span { font-size: 10.5px; font-weight: 700; }

/* ---------- Toast ---------- */
.toast {
  position: absolute; left: 20px; right: 20px; bottom: 90px;
  background: var(--green-dark); color: var(--white);
  padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; text-align: center;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: all 250ms ease; z-index: 40;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- Misc ---------- */
.icon-btn-row { display: flex; gap: 10px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray); }
.empty-state-emoji { font-size: 40px; margin-bottom: 12px; }
.back-row { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; }
.back-btn { background: none; border: none; color: var(--green-dark); font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 4px; cursor: pointer; padding: 6px 6px 6px 0; }

::-webkit-scrollbar { width: 0; height: 0; }
