/* Tokens, reset and the shared pieces every screen uses (buttons, inputs, cards, chips). */
:root {
  --orange: #ff6b00;
  --orange-light: #fff0e6;
  --orange-line: #ffd1b0;
  --yellow: #ffbd30;
  --red: #ef4444;
  --green: #009528;
  --green-bg: #f0fff1;
  --green-badge: #34c759;

  --bg: #f6f6f3;
  --cta: #111214;
  --cta-text: #ffffff;
  --ring: rgba(17, 18, 20, 0.04);
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --surface-3: #f2f2f2;
  --field: #f6f6f6;
  --text: #171717;
  --text-2: #404040;
  --text-3: #262626;
  --muted: #737373;
  --muted-2: #a3a3a3;
  --sage: #647067;
  --line: rgba(23, 23, 23, 0.1);
  --line-soft: #f1f1f1;
  --shadow: 0 4px 20px -4px rgba(16, 24, 40, 0.1);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.1), 0 1px 2px -1px rgba(16, 24, 40, 0.1);
  --shadow-nav: 0 4px 10px rgba(16, 24, 40, 0.1);
  --sheet: #ffffff;
  --icon-filter: none;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: "Lufga", "DM Sans", system-ui, sans-serif;
  --font-head: "Lufga", "DM Sans", system-ui, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1012;
  --cta: #ffffff;
  --cta-text: #111214;
  --ring: rgba(255, 255, 255, 0.05);
  --surface: #17181b;
  --surface-2: #1e1f23;
  --surface-3: #26272b;
  --field: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-2: #e5e5e5;
  --text-3: #ffffff;
  --muted: rgba(255, 255, 255, 0.6);
  --muted-2: rgba(255, 255, 255, 0.4);
  --sage: rgba(255, 255, 255, 0.55);
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.08);
  --orange-light: rgba(255, 107, 0, 0.16);
  --green-bg: rgba(52, 199, 89, 0.14);
  --shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.5);
  --shadow-nav: 0 4px 14px rgba(0, 0, 0, 0.45);
  --sheet: #24252a;
  --icon-filter: invert(1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
/* Type weights follow one short scale: 400 body, 500 small UI text, 550 labels and
   emphasis, 650 titles. Nothing heavier. */
b, strong { font-weight: 500; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-weight: 300; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4 { margin: 0; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Monochrome UI icons flip to white in dark mode. Coloured art keeps its colours. */
.ico { width: 24px; height: 24px; flex: none; }
.ico--mono { filter: var(--icon-filter); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 56px; padding: 0 28px; border-radius: 21px;
  font-weight: 500; font-size: 16px; letter-spacing: -0.128px; white-space: nowrap;
  transition: transform 0.18s var(--ease), background-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--cta); color: var(--cta-text); }
.btn--primary:hover { opacity: 0.88; }
:root[data-theme="dark"] .btn--primary img { filter: invert(1); }
.btn--light { background: var(--surface); color: var(--text); }
.btn--soft { background: var(--surface-3); color: var(--text); }
.btn--outline { background: transparent; color: var(--orange); border: 1px solid var(--orange); }
.btn--sm { height: 48px; border-radius: 18px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.link { color: var(--orange); font-weight: 500; font-size: 14px; }

.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); flex: none;
  transition: transform 0.18s var(--ease), background-color 0.2s;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn img { width: 24px; height: 24px; filter: var(--icon-filter); }

/* ---------- Text ---------- */
.h1 { font-weight: 500; font-size: 40px; letter-spacing: -0.72px; line-height: 1.1; }
.h2 { font-weight: 500; font-size: 24px; letter-spacing: -0.432px; line-height: 1.2; }
.h3 { font-weight: 500; font-size: 18px; letter-spacing: -0.2px; }
.muted { color: var(--muted); }
.money { font-weight: 500; letter-spacing: -0.36px; }

/* ---------- Fields ---------- */
.field-label { font-weight: 500; font-size: 14px; letter-spacing: -0.084px; margin-bottom: 8px; display: block; }
.field {
  display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 16px;
  background: var(--surface); border: 1px solid transparent; border-radius: 21px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field:focus-within { border-color: rgba(255, 107, 0, 0.4); box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.1); }
.field input, .field textarea {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-weight: 500; font-size: 16px; letter-spacing: -0.128px;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field img { filter: var(--icon-filter); opacity: 0.55; }
.field--grey { background: var(--field); }

.search {
  display: flex; align-items: center; gap: 8px; height: 55px; padding: 0 16px;
  background: var(--field); border-radius: 24px; border: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within { border-color: rgba(255, 107, 0, 0.4); box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.1); }
.search img { filter: var(--icon-filter); opacity: 0.6; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; }
.search input::placeholder { color: var(--muted); }

/* ---------- Cards, chips, pills ---------- */
.card { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 12px; border-radius: 20px;
  background: var(--surface-2); font-weight: 500; font-size: 14px; letter-spacing: -0.25px; white-space: nowrap;
  transition: background-color 0.2s, transform 0.18s var(--ease);
}
.chip:active { transform: scale(0.96); }
.chip img { width: 20px; height: 20px; filter: var(--icon-filter); }
.chip .ico { width: 24px; height: 24px; }
.status {
  display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500;
  color: var(--green); background: var(--green-bg);
}
.plate {
  display: inline-flex; padding: 4px 10px; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--line); font-weight: 500; font-size: 12px; color: var(--muted);
}
.divider { height: 1px; background: var(--line); border: 0; margin: 0; width: 100%; }
.divider-label { display: flex; align-items: center; gap: 11px; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.divider-label span {
  padding: 8px 10px; border-radius: 20px; border: 1px solid var(--line-soft); background: var(--surface);
  font-weight: 500; font-size: 12px;
}

/* Avatars with the stacked soft shadow from the design */
.avatar {
  position: relative; flex: none; border-radius: 16px; overflow: hidden;
  border: 2px solid var(--surface);
  box-shadow: 0 19px 11px rgba(0, 0, 0, 0.05), 0 8px 8px rgba(0, 0, 0, 0.09), 0 2px 5px rgba(0, 0, 0, 0.1);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.rating {
  position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 1px; padding: 2px 4px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(20px);
  border: 0.7px solid rgba(255, 255, 255, 0.3);
  font: 500 9px/1 var(--font); color: #fff;
}
.rating img { width: 11px; height: 11px; }

.round-btn {
  display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%;
  background: #000; flex: none; position: relative; transition: transform 0.18s var(--ease);
}
:root[data-theme="dark"] .round-btn { background: #fff; }
:root[data-theme="dark"] .round-btn > img { filter: invert(1); }
.round-btn:active { transform: scale(0.9); }
.round-btn img { width: 30px; height: 30px; }
.round-btn .dot {
  position: absolute; top: -4px; right: -4px; width: 19px; height: 19px; border-radius: 6px;
  background: var(--red); border: 3px solid var(--surface); color: #fff;
  font: 500 10px/13px var(--font); text-align: center;
}

/* Toggle switch (Dark Mode) */
.switch {
  position: relative; width: 51px; height: 31px; border-radius: 99px; background: #e9e9ea; flex: none;
  transition: background-color 0.3s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.35s var(--spring);
}
.switch[aria-checked="true"] { background: var(--green-badge); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* Radio */
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted-2); flex: none; position: relative; transition: border-color 0.2s; }
.radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--orange); transform: scale(0); transition: transform 0.3s var(--spring); }
[aria-checked="true"] > .radio, .radio.is-on { border-color: var(--orange); }
[aria-checked="true"] > .radio::after, .radio.is-on::after { transform: scale(1); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; transform: translate(-50%, 20px); opacity: 0;
  padding: 14px 20px; border-radius: 18px; background: var(--text); color: var(--bg);
  font-weight: 500; font-size: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.4s var(--spring), opacity 0.3s; pointer-events: none; white-space: nowrap;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* Staggered entrance for anything marked .rise */
.rise { animation: rise 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pop { animation: pop 0.5s var(--spring) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
