/* Same design as the app: neutral surfaces, color only for the order's state,
   one main action, words over icons, Arabic first (RTL). */

:root {
  --bg: #ffffff;
  --surface: #f4f4f5;
  --surface-2: #ebebed;
  --border: #e4e4e7;
  --text: #111113;
  --text-2: #6b6b70;
  --text-3: #a1a1a6;
  --primary: #111113;
  --on-primary: #ffffff;
  --success: #157a3d;
  --success-soft: #e3f5e9;
  --warning: #a85a00;
  --warning-soft: #fdf0dc;
  --failure: #c0262d;
  --failure-soft: #fce7e7;
  --radius-card: 18px;
  --radius-field: 14px;
  --page: 20px;
  --glass: rgba(255, 255, 255, 0.72);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --border: #38383a;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #6b6b70;
    --primary: #f5f5f7;
    --on-primary: #000000;
    --success: #4ade80;
    --success-soft: #0f2e1b;
    --warning: #fbbf24;
    --warning-soft: #33240a;
    --failure: #f87171;
    --failure-soft: #3a1414;
    --glass: rgba(28, 28, 30, 0.72);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --border: #38383a;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6b6b70;
  --primary: #f5f5f7;
  --on-primary: #000000;
  --success: #4ade80;
  --success-soft: #0f2e1b;
  --warning: #fbbf24;
  --warning-soft: #33240a;
  --failure: #f87171;
  --failure-soft: #3a1414;
  --glass: rgba(28, 28, 30, 0.72);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Arabic", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.title { font-size: 22px; font-weight: 600; margin: 0; }
.page-title { font-size: 28px; font-weight: 700; margin: 0; }
.section { font-size: 14px; color: var(--text-2); margin: 20px 4px 4px; }

/* Buttons: one main action (ink), quiet ones (soft), text actions */
.btn {
  border: 0; border-radius: 999px; min-height: 52px; padding: 0 22px;
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform .12s ease-out, opacity .12s ease-out;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn-primary { background: var(--primary); color: var(--on-primary); width: 100%; min-height: 56px; }
.btn-soft { background: var(--surface); color: var(--text); }
.btn-small { min-height: 42px; padding: 0 18px; }
.btn-text { background: none; border: 0; color: var(--text); font-weight: 600; min-height: 44px; padding: 0 8px; }
.btn-text.danger { color: var(--failure); }
.btn-text.quiet { color: var(--text-2); font-weight: 400; font-size: 14px; }
.icon-btn { background: none; border: 0; width: 44px; height: 44px; display: inline-grid; place-items: center; color: var(--text); padding: 0; }
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .mirror { transform: scaleX(-1); }

/* Status pill: the word carries the meaning, color only reinforces it */
.pill { display: inline-block; border-radius: 999px; padding: 5px 12px; font-size: 14px; font-weight: 600; }
.pill.large { font-size: 22px; padding: 10px 20px; }
.pill.preparing { background: var(--warning-soft); color: var(--warning); }
.pill.ready { background: var(--success-soft); color: var(--success); }
.pill.picked_up, .pill.expired { background: var(--surface); color: var(--text-2); }
.pill.cancelled { background: var(--failure-soft); color: var(--failure); }

.card { background: var(--surface); border-radius: var(--radius-card); padding: 16px; }
.note { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: var(--radius-card); padding: 16px; }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 9px; flex: none; }
.hairline { height: 1px; background: var(--border); }

.field {
  width: 100%; min-height: 52px; border: 0; border-radius: var(--radius-field);
  background: var(--surface); padding: 0 14px; outline: none;
}
.field:focus { box-shadow: 0 0 0 2px var(--text-3); }
.field.ltr { direction: ltr; text-align: start; }
[dir="rtl"] .field.ltr { text-align: right; }

.banner { background: var(--warning-soft); color: var(--warning); text-align: center; font-size: 12px; padding: 6px 12px; }

/* Slide to confirm (cancel), as in the app */
.slide { position: relative; height: 64px; border-radius: 999px; background: var(--failure-soft); overflow: hidden; user-select: none; touch-action: none; }
.slide-label { position: absolute; inset: 0; display: grid; place-items: center; color: var(--failure); font-weight: 600; pointer-events: none; padding: 0 70px; }
.slide-knob { position: absolute; top: 5px; inset-inline-start: 5px; width: 54px; height: 54px; border-radius: 50%; background: var(--failure); color: var(--bg); display: grid; place-items: center; cursor: grab; }

/* Modal sheet: bottom on phones, centered on wide screens */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet { background: var(--bg); width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; border-radius: 24px 24px 0 0; padding: 24px var(--page) calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 24px; }
}

.glass { background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); border: .5px solid var(--border); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--surface-2); border-top-color: var(--text-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; inset-inline: 16px; bottom: 96px; margin: 0 auto; max-width: 420px; background: var(--primary); color: var(--on-primary); border-radius: 16px; padding: 14px 16px; z-index: 60; text-align: center; }

/* Stars: filled vs. outlined carries the meaning, not color */
.star-g { display: block; fill: none; stroke: var(--text-3); stroke-width: 1.6; stroke-linejoin: round; }
.star-g.on { fill: var(--text); stroke: var(--text); }
.stars-row { display: inline-flex; gap: 2px; vertical-align: middle; }
.rate { background: var(--surface); border-radius: var(--radius-card); padding: 16px; display: grid; gap: 12px; text-align: center; }
.rate .pick { display: flex; justify-content: center; gap: 4px; direction: inherit; }
.rate .pick button { background: none; border: 0; padding: 4px; width: 52px; height: 52px; }
.rate textarea.field { background: var(--bg); min-height: 52px; padding: 14px; resize: none; }

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