/* riwariwi — indigo batik, kunyit, anyaman besek, daun pisang */
:root {
  --indigo: #1F2A5C;
  --indigo-2: #2E3C7E;
  --indigo-soft: #E6E9F5;
  --kunyit: #E3A21A;
  --kunyit-soft: #FBEFD2;
  --besek: #E8D3A2;
  --besek-dark: #B8925A;
  --besek-light: #F7ECD0;
  --daun: #3E7B4F;
  --daun-soft: #E2EFE5;
  --danger: #B3261E;
  --danger-soft: #FBE9E7;
  --bg: #F3F4F8;
  --surface: #FFFFFF;
  --ink: #1A1D29;
  --muted: #5F6478;
  --line: #DDE0EA;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --tabbar: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--kunyit); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.boot { min-height: 100vh; background: var(--indigo); }

.shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px);
}

.page { padding: 16px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.page.has-bottom-bar { padding-bottom: 96px; }
.page-head { display: flex; align-items: flex-start; gap: 8px; padding-top: 4px; }
.page-title { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.page-sub { color: var(--muted); font-size: 0.875rem; margin-top: 2px; }
.icon-btn {
  border: 0; background: var(--surface); width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; flex: none; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line);
}

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 0.8125rem; }
.error { color: var(--danger); font-size: 0.875rem; }
.notice { background: var(--kunyit-soft); border-radius: var(--radius); padding: 12px 14px; font-size: 0.9rem; }
.loading { color: var(--muted); padding: 24px 0; text-align: center; }
.empty { text-align: center; padding: 32px 8px; display: grid; gap: 10px; justify-items: center; }

.card { background: var(--surface); border-radius: var(--radius-lg); padding: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.error-box { display: grid; gap: 10px; background: var(--danger-soft); box-shadow: none; }

/* Tombol */
.btn {
  border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--kunyit); color: var(--ink); }
.btn-primary:hover:not(:disabled) { background: #D4950F; }
.btn-ghost { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-small { min-height: 36px; padding: 6px 16px; background: var(--indigo-soft); color: var(--indigo); font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px #E9B7B2; }
.link { background: none; border: 0; padding: 0; color: var(--indigo-2); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Form */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span, .field-label { font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.field em { font-style: normal; font-weight: 500; }
input, select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: #FBFBFD; border-radius: var(--radius-sm);
  padding: 11px 12px; min-height: 46px; outline: none;
}
textarea { resize: vertical; min-height: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--indigo-2); background: #fff; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .row { grid-template-columns: 1fr; } }

/* Masuk */
.login { min-height: 100vh; padding: 24px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.login-hero { margin: 12px auto 4px; width: 180px; }
.woven { display: block; width: 100%; height: auto; }
.login-title { text-align: center; font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; color: var(--indigo); }
.login-lead { text-align: center; color: var(--muted); margin-bottom: 8px; }
.otp { font-size: 1.5rem; letter-spacing: 0.4em; text-align: center; font-weight: 700; }
.dev-note { background: var(--kunyit-soft); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 0.875rem; }

/* Beranda: pita anyaman di belakang sapaan adalah elemen khasnya */
.home { padding-top: 0; }
.home-head {
  margin: 0 -16px; padding: 28px 20px 52px; color: #fff; position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(60deg, rgba(232, 211, 162, 0.13) 0 10px, transparent 10px 22px),
    repeating-linear-gradient(-60deg, rgba(232, 211, 162, 0.09) 0 10px, transparent 10px 22px),
    var(--indigo);
  border-radius: 0 0 28px 28px;
}
.greet { color: var(--besek); font-weight: 600; }
.home-title { font-size: 1.75rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; max-width: 16ch; margin-top: 4px; }

.active-strip { display: grid; gap: 8px; margin-top: -36px; position: relative; }
.active-card {
  display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: 0 6px 18px rgba(31, 42, 92, 0.14);
}
.active-card strong { display: block; font-size: 0.95rem; }
.active-card small { color: var(--muted); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--daun); flex: none; box-shadow: 0 0 0 0 rgba(62, 123, 79, 0.5); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(62, 123, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 123, 79, 0); } }

.services { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.home-head + .services { margin-top: -32px; position: relative; }
.service {
  display: grid; gap: 4px; align-content: start; height: 100%; min-height: 132px; padding: 14px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line);
}
.service:hover { box-shadow: inset 0 0 0 2px var(--indigo-2); }
.service-icon { color: var(--indigo); background: var(--besek-light); border-radius: 12px; padding: 7px; width: 42px; height: 42px; margin-bottom: 6px; }
.service-name { font-weight: 800; line-height: 1.25; }
.service-blurb { color: var(--muted); font-size: 0.8125rem; line-height: 1.35; }
.services li.wide { grid-column: span 2; }
.service-fnb { min-height: 0; grid-template-columns: auto 1fr; column-gap: 12px; background: var(--kunyit-soft); box-shadow: none; }
.service-fnb .service-icon { grid-row: span 2; background: var(--kunyit); margin: 0; }
.service-fnb .service-name, .service-bagi_berkat .service-name { align-self: end; }
.service-bagi_berkat { min-height: 0; grid-template-columns: auto 1fr; column-gap: 12px; background: var(--besek-light); box-shadow: none; }
.service-bagi_berkat .service-icon { grid-row: span 2; background: var(--besek); margin: 0; }

/* Vendor & menu */
.vendor-list, .menu, .order-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.vendor { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
.vendor.is-closed { opacity: 0.6; }
.vendor-initial { width: 44px; height: 44px; border-radius: 12px; background: var(--indigo); color: var(--besek); display: grid; place-items: center; font-weight: 800; font-size: 1.25rem; flex: none; }
.vendor-body { flex: 1; min-width: 0; }
.vendor-body small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--line); color: var(--muted); }
.badge-open { background: var(--daun-soft); color: var(--daun); }
.menu-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
.menu-item strong { display: block; }
.price { display: block; margin-top: 2px; font-weight: 700; color: var(--indigo); }

.stepper { display: inline-flex; align-items: center; background: var(--indigo-soft); border-radius: 999px; flex: none; }
.stepper button { border: 0; background: none; width: 36px; height: 36px; font-size: 1.25rem; font-weight: 700; color: var(--indigo); cursor: pointer; }
.stepper button:disabled { opacity: 0.35; }
.stepper span { min-width: 24px; text-align: center; font-weight: 700; }

.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); box-shadow: 0 -1px 0 var(--line), 0 -8px 20px rgba(31, 42, 92, 0.06); z-index: 5;
}
.bottom-bar strong { display: block; font-size: 1.125rem; }
.bottom-bar small { color: var(--muted); }

/* Form pesanan */
.stop { border: 0; margin: 0; display: grid; gap: 12px; position: relative; min-width: 0; }
.stop legend { float: left; width: 100%; padding: 0; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.stop-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.stop-dot.pickup { background: var(--kunyit); }
.stop-dot.dropoff { background: var(--indigo); }
.remove { position: absolute; right: 16px; top: 16px; color: var(--danger); font-size: 0.875rem; }
.add-stop { border-style: dashed; }
.loc-btn {
  display: flex; align-items: center; gap: 8px; border: 1.5px dashed var(--besek-dark); background: var(--besek-light);
  color: var(--ink); border-radius: var(--radius-sm); padding: 11px 12px; font-weight: 600; cursor: pointer; text-align: left;
}
.loc-btn.is-set { border-style: solid; border-color: var(--daun); background: var(--daun-soft); color: var(--daun); }
.items { display: grid; gap: 8px; }
.item-row { display: grid; grid-template-columns: 1fr 96px auto; gap: 6px; align-items: center; }
.cart-lines { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; font-size: 0.9rem; }
.cart-lines li { display: flex; justify-content: space-between; gap: 12px; }
.pay-method { font-size: 0.875rem; color: var(--muted); margin-top: 10px; }
.summary dl { margin: 0; display: grid; grid-template-columns: 1fr auto; row-gap: 6px; }
.summary dd { padding-left: 12px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary .total { color: var(--ink); font-weight: 800; font-size: 1.125rem; padding-top: 8px; border-top: 1px solid var(--line); }

/* Peta */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(26, 29, 41, 0.5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; padding: 16px; display: grid; gap: 12px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { font-size: 1.125rem; font-weight: 800; }
.map-wrap { position: relative; height: min(60vh, 440px); border-radius: var(--radius); overflow: hidden; background: var(--indigo-soft); }
.map { position: absolute; inset: 0; }
.map-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); z-index: 500; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3)); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Daftar pesanan */
.order-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
.order-row .service-icon { margin: 0; width: 38px; height: 38px; }
.order-row-body { flex: 1; min-width: 0; }
.order-row-body small, .order-row-end small { display: block; color: var(--muted); font-size: 0.8125rem; }
.order-row-end { text-align: right; flex: none; }
.order-row-body .status-chip { display: inline-block; margin-top: 4px; }
.status-chip { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo); white-space: nowrap; }
.status-completed .status-chip { background: var(--daun-soft); color: var(--daun); }
.status-cancelled .status-chip, .status-failed .status-chip { background: var(--line); color: var(--muted); }

/* Detail pesanan */
.status-hero { background: var(--indigo); color: #fff; border-radius: var(--radius-lg); padding: 18px; display: grid; gap: 6px; }
.status-hero.status-completed { background: var(--daun); }
.status-hero.status-cancelled, .status-hero.status-failed { background: #4A4F63; }
.status-now { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.01em; }
.status-sub { color: rgba(255, 255, 255, 0.75); font-size: 0.875rem; }
.tracker { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.tracker li { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, 0.55); font-size: 0.9375rem; }
.tracker li.done { color: #fff; font-weight: 600; }
.tracker-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.tracker li.done .tracker-dot { background: var(--kunyit); border-color: var(--kunyit); }

.route { list-style: none; padding: 0; margin: 0; display: grid; }
.route-stop { display: grid; grid-template-columns: 20px 1fr; gap: 10px; position: relative; padding-bottom: 16px; }
.route-stop:last-child { padding-bottom: 0; }
.route-stop:not(:last-child)::before { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; border-left: 2px dotted var(--line); }
.route-dot { width: 14px; height: 14px; border-radius: 50%; margin: 4px 0 0 3px; background: var(--indigo); }
.route-stop.pickup .route-dot { background: var(--kunyit); }
.route-stop.st-done .route-dot { box-shadow: 0 0 0 3px var(--daun-soft); background: var(--daun); }
.route-label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.stop-status { font-size: 0.8125rem; font-weight: 700; margin-top: 4px; color: var(--indigo-2); }
.stop-status.done { color: var(--daun); }
.stop-status.failed { color: var(--danger); }

.history summary { font-weight: 700; cursor: pointer; }
.history ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 0.9rem; }
.history time { display: inline-block; width: 52px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cancel-zone { display: grid; gap: 8px; }
.confirm { display: grid; gap: 12px; }
.confirm .row { grid-template-columns: 1fr 1fr; }

/* Akun */
.account { display: flex; align-items: center; gap: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 16px; background: var(--besek); color: var(--indigo); display: grid; place-items: center; font-weight: 800; font-size: 1.375rem; }

/* Bilah tab */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); box-shadow: 0 -1px 0 var(--line);
  display: grid; grid-template-columns: repeat(3, 1fr); max-width: 560px; margin: 0 auto;
}
.tab { display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.tab[aria-current="page"] { color: var(--indigo); }
.tab[aria-current="page"] svg { color: var(--kunyit); stroke-width: 2.2; }
