/* PARALLAX web: the same visual language as the in-cart display (UITheme.gd) --
   near-black surfaces, glass panels, 30px corners, Montserrat, one violet accent. */
@font-face {
  font-family: "Montserrat";
  src: url("/shared/Montserrat.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0a0a0c;
  --surface: #161616;          /* GREY_900 */
  --raised: #202022;
  --hover: #2a2a2d;
  --grey-700: #353535;
  --grey-600: #3f3f3f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --text-2: #afafaf;           /* TEXT_ARTIST */
  --text-3: #7d7d82;
  --violet: #4635e0;
  --violet-light: #9d68f9;
  --violet-soft: rgba(70, 53, 224, 0.18);
  --green: #2be36c;
  --amber: #fab840;
  --red: #ef5350;
  --radius: 30px;
  --radius-row: 18px;
  --glass: rgba(22, 22, 24, 0.72);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
a { color: var(--violet-light); text-decoration: none; }
.dim { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.between { justify-content: space-between; }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- surfaces --- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.rowcard { background: var(--raised); border-radius: var(--radius-row); padding: 14px 16px; }

/* --- buttons --- */
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 24px; border-radius: 999px;
  font-weight: 700; font-size: 17px; white-space: nowrap;
  background: var(--raised); color: var(--text);
  transition: transform 0.25s var(--ease), background 0.2s, opacity 0.2s;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.primary { background: var(--violet); }
.btn.primary:hover { background: #5443ea; }
.btn.light { background: #fff; color: #000; }
.btn.ghost { background: transparent; color: var(--text-2); font-weight: 600; }
.btn.outline { background: transparent; border: 1px solid var(--border-strong); }
.btn.danger { background: rgba(239, 83, 80, 0.16); color: #ff8a87; }
.btn.good { background: rgba(43, 227, 108, 0.16); color: var(--green); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn.block { width: 100%; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn.small svg { width: 18px; height: 18px; }
.iconbtn {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none;
  transition: transform 0.25s var(--ease), background 0.2s;
}
.iconbtn:active { transform: scale(0.92); }
.iconbtn svg { width: 22px; height: 22px; }

/* --- inputs --- */
.input {
  width: 100%; min-height: 56px; padding: 0 20px; border-radius: var(--radius-row);
  background: var(--raised); border: 1px solid transparent; color: var(--text);
  font: inherit; font-weight: 600; outline: none; transition: border-color 0.2s, background 0.2s;
}
.input::placeholder { color: var(--text-3); font-weight: 500; }
.input:focus { border-color: var(--violet-light); background: #1b1b1e; }
textarea.input { padding: 14px 20px; min-height: 96px; resize: vertical; }
select.input { appearance: none; -webkit-appearance: none; }

/* --- little things --- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em; background: var(--raised); color: var(--text-2);
  white-space: nowrap;
}
.pill.violet { background: var(--violet-soft); color: #b9adff; }
.pill.green { background: rgba(43, 227, 108, 0.14); color: var(--green); }
.pill.amber { background: rgba(250, 184, 64, 0.14); color: var(--amber); }
.pill.red { background: rgba(239, 83, 80, 0.16); color: #ff8a87; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.dot.live { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--violet); display: grid; place-items: center;
  font-weight: 700; font-size: 15px; flex: none;
}
.spinner {
  width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff; animation: spin 0.8s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.divider { height: 1px; background: var(--border); margin: 4px 0; }

/* --- toast --- */
#toasts {
  position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 14px); z-index: 90;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px;
}
.toast {
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14px; max-width: 100%;
  background: rgba(32, 32, 36, 0.92); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  animation: toast-in 0.5s var(--ease);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.warn { color: var(--amber); }
.toast.bad { color: #ff8a87; }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(0.96); } }

/* --- sign-in --- */
.auth {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 80% at 50% 0%, rgba(70, 53, 224, 0.28), transparent 60%), var(--bg);
}
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.auth-card img.wordmark { width: 190px; margin: 0 auto 18px; display: block; }
.auth-card .step { display: flex; flex-direction: column; gap: 14px; animation: rise 0.5s var(--ease); }
.code-input { text-align: center; font-size: 30px; letter-spacing: 0.4em; padding-left: 0.4em; font-weight: 700; min-height: 68px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* --- call overlay (rider) / call bar (support) --- */
.callsheet {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px; background: rgba(8, 8, 10, 0.86);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); animation: fade 0.3s;
}
@keyframes fade { from { opacity: 0; } }
.call-avatar {
  width: 132px; height: 132px; border-radius: 50%; background: var(--violet); display: grid; place-items: center; position: relative;
}
.call-avatar svg { width: 60px; height: 60px; }
.call-avatar.ringing::before, .call-avatar.ringing::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--violet-light);
  animation: ripple 2s ease-out infinite;
}
.call-avatar.ringing::after { animation-delay: 1s; }
@keyframes ripple { from { transform: scale(1); opacity: 0.6; } to { transform: scale(1.8); opacity: 0; } }

/* --- map bits --- */
.mapboxgl-ctrl-logo { opacity: 0.5; }
.mapboxgl-ctrl-attrib { background: transparent !important; font-size: 10px; opacity: 0.55; }
.mapboxgl-ctrl-attrib a { color: #999 !important; }
.marker-cart {
  width: 46px; height: 46px; border-radius: 50%; background: var(--violet); border: 3px solid #fff; display: grid; place-items: center;
  box-shadow: 0 0 0 8px rgba(70, 53, 224, 0.25), 0 6px 18px rgba(0, 0, 0, 0.5);
}
.marker-cart.offline { background: var(--grey-600); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
.marker-cart svg { width: 22px; height: 22px; }
.marker-me { width: 20px; height: 20px; border-radius: 50%; background: #3b9bff; border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(59, 155, 255, 0.22); }
.marker-pin { width: 34px; height: 44px; }
.marker-pin svg { width: 34px; height: 44px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5)); }

.marker-stop { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--violet); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }

.satbtn { position: absolute; top: 14px; right: 14px; z-index: 5; }
.satbtn svg { width: 22px; height: 22px; }

/* --- light theme (rider app: Settings > Preferences > Appearance) --- */
:root[data-theme="light"] {
  --bg: #f3f3f6;
  --surface: #ffffff;
  --raised: #ececf1;
  --hover: #e2e2e9;
  --grey-700: #d6d6dd;
  --grey-600: #cfcfd7;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text: #0c0c10;
  --text-2: #4f4f57;
  --text-3: #85858e;
  --violet-light: #5b47f0;
  --violet-soft: rgba(70, 53, 224, 0.12);
  --glass: rgba(255, 255, 255, 0.82);
  --amber: #b97700;
  --green: #12924a;
}
:root[data-theme="light"] body { color-scheme: light; }
:root[data-theme="light"] .toast { background: rgba(255, 255, 255, 0.94); color: var(--text); }
:root[data-theme="light"] .pill.violet { color: #3b2bd0; }
:root[data-theme="light"] .pill.green { color: var(--green); }
:root[data-theme="light"] .btn.primary, :root[data-theme="light"] .avatar { color: #fff; }
:root[data-theme="light"] .auth { background: radial-gradient(120% 80% at 50% 0%, rgba(70, 53, 224, 0.16), transparent 60%), var(--bg); }
:root[data-theme="light"] .callsheet { background: rgba(243, 243, 246, 0.9); }
:root[data-theme="light"] .input:focus { background: #fff; }

/* --- accessibility (rider app; the same settings travel to the cart) --- */
:root.a11y-large { font-size: 18px; }
:root.a11y-large body { font-size: 18px; }
:root.a11y-large #sheet, :root.a11y-large #account .inner, :root.a11y-large .callsheet { zoom: 1.14; }
:root.a11y-contrast { --glass: var(--surface); --text-2: #d6d6da; --text-3: #b0b0b6; --border: rgba(255, 255, 255, 0.28); }
:root.a11y-contrast[data-theme="light"] { --text-2: #2a2a30; --text-3: #4a4a52; --border: rgba(0, 0, 0, 0.3); }
:root.a11y-contrast .glass { -webkit-backdrop-filter: none; backdrop-filter: none; }
:root.a11y-still *, :root.a11y-still *::before, :root.a11y-still *::after {
  animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important;
}
:root[data-theme="light"] .wordmark { filter: invert(1) brightness(0.15); }
