/* Roadside Rescue — dark, road-ready UI. Big tap targets, high contrast. */
:root {
  --bg: #0a0c10;
  --panel: #151a22;
  --panel2: #1d242f;
  --line: #2a3342;
  --text: #f2f5f9;
  --muted: #9aa7b4;
  --amber: #ffb020;
  --amber-dk: #cc8a00;
  --green: #2ebd85;
  --red: #ff5252;
  --blue: #4da3ff;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  padding-bottom: 92px;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ---------- top bar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  background: #0d1016; border-bottom: 2px solid var(--amber);
  padding: 10px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 30px; }
.brand-text b { display: block; font-size: 19px; letter-spacing: .2px; }
.brand-text small { color: var(--muted); font-size: 12px; }
.badge { font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 999px; letter-spacing: .6px; }
.badge-demo { background: var(--amber); color: #1a1200; }
.badge-live { background: var(--green); color: #03170d; }

/* ---------- layout ---------- */
main { padding: 14px; max-width: 640px; margin: 0 auto; }
.screen-title { font-size: 24px; font-weight: 800; margin: 4px 0 4px; }
.screen-sub { color: var(--muted); margin: 0 0 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  display: block; width: 100%; border: none; border-radius: var(--radius);
  padding: 18px 16px; font-size: 19px; font-weight: 800; text-align: center;
  background: var(--panel2); color: var(--text); min-height: 60px;
}
.btn:active { transform: scale(.99); }
.btn-amber { background: var(--amber); color: #1a1200; }
.btn-green { background: var(--green); color: #03170d; }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; border: 2px solid var(--line); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn + .btn { margin-top: 10px; }
.btn-inline { display: inline-block; width: auto; padding: 12px 18px; min-height: 48px; font-size: 16px; }

/* ---------- role cards ---------- */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-card {
  background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 20px 12px; text-align: center; color: var(--text); min-height: 132px;
}
.role-card .ico { font-size: 42px; display: block; margin-bottom: 8px; }
.role-card b { font-size: 18px; display: block; }
.role-card small { color: var(--muted); font-size: 13px; }
.role-card.selected { border-color: var(--amber); background: #221b08; }

/* ---------- category grid ---------- */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat {
  background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px 10px; text-align: center; color: var(--text); min-height: 96px; font-size: 16px; font-weight: 700;
}
.cat .ico { font-size: 32px; display: block; margin-bottom: 6px; }
.cat.selected { border-color: var(--amber); background: #221b08; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 700; margin-bottom: 6px; }
textarea, input[type="text"], input[type="url"], input[type="tel"] {
  width: 100%; background: var(--panel2); border: 2px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 14px; font-size: 17px; min-height: 54px;
}
textarea { min-height: 96px; resize: vertical; }
textarea:focus, input:focus { outline: none; border-color: var(--amber); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--panel2); border: 2px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 12px 16px; font-size: 16px; font-weight: 700; min-height: 48px;
}
.chip.selected { border-color: var(--amber); background: #221b08; color: var(--amber); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button {
  width: 56px; height: 56px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--panel2); color: var(--text); font-size: 26px; font-weight: 800;
}
.stepper .val { font-size: 24px; font-weight: 800; min-width: 110px; text-align: center; }

/* ---------- status / steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 12px; padding: 10px 0; align-items: flex-start; }
.steps .dot {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px;
  border: 3px solid var(--line); background: var(--panel2); margin-top: 1px;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800;
}
.steps li.done .dot { background: var(--green); border-color: var(--green); color: #03170d; }
.steps li.now .dot { background: var(--amber); border-color: var(--amber); color: #1a1200; }
.steps li.now b { color: var(--amber); }
.steps li.todo { color: var(--muted); }

.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: .4px; }
.pill-amber { background: #3a2c05; color: var(--amber); }
.pill-green { background: #07331f; color: var(--green); }
.pill-red { background: #3d0d0d; color: var(--red); }
.pill-blue { background: #0d2b4d; color: var(--blue); }
.pill-grey { background: var(--panel2); color: var(--muted); }

.alert-red {
  background: #2a0d0d; border: 2px solid var(--red); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px; font-weight: 700;
}
.alert-amber {
  background: #2a2005; border: 2px solid var(--amber); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px;
}

/* ---------- bids ---------- */
.bid-card { border: 2px solid var(--line); }
.bid-card.best { border-color: var(--green); }
.bid-amount { font-size: 30px; font-weight: 900; }
.stars { color: var(--amber); letter-spacing: 1px; }
.countdown { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- map ---------- */
.mapbox { background: #0d1520; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin-bottom: 14px; }
.mapbox svg { width: 100%; height: auto; display: block; }
.gmap { width: 100%; height: 300px; border-radius: 6px; }
.gmap-legend { margin: 8px 2px 0; }
.gmap-info { margin-top: 8px; padding: 8px 10px; background: #12202f; border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.eta-big { font-size: 44px; font-weight: 900; line-height: 1; }
.eta-big small { font-size: 18px; color: var(--muted); font-weight: 700; }

/* ---------- rating ---------- */
.rate-row { display: flex; justify-content: center; gap: 8px; padding: 8px 0 4px; }
.rate-star {
  font-size: 46px; background: none; border: none; color: #3a4353; padding: 4px; min-width: 56px; min-height: 56px;
}
.rate-star.on { color: var(--amber); }

/* ---------- toggle ---------- */
.switch { position: relative; width: 74px; height: 42px; flex: 0 0 74px; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--panel2); border: 2px solid var(--line);
  border-radius: 999px; pointer-events: none; transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 30px; height: 30px;
  border-radius: 50%; background: var(--muted); transition: left .15s, background .15s;
}
.switch input:checked + .track { background: #07331f; border-color: var(--green); }
.switch input:checked + .track::after { left: 36px; background: var(--green); }

/* ---------- tab bar ---------- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: #0d1016; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; background: none; border: none; color: var(--muted);
  font-size: 13px; font-weight: 700; padding: 8px 0 10px; min-height: 62px;
}
.tab .tab-ico { display: block; font-size: 24px; margin-bottom: 2px; }
.tab.active { color: var(--amber); }

/* ---------- misc ---------- */
.kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: none; }
.kv b { text-align: right; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 104px; z-index: 50;
  background: var(--amber); color: #1a1200; font-weight: 800; font-size: 16px;
  border-radius: 12px; padding: 14px 16px; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.hidden { display: none !important; }
.spinner {
  width: 54px; height: 54px; border-radius: 50%; margin: 10px auto;
  border: 6px solid var(--line); border-top-color: var(--amber);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }
.mt { margin-top: 12px; }

/* Port 8 onboarding (Settings → Live account) */
.checkrow { display: flex; gap: 10px; align-items: center; margin: 8px 0; font-size: 15px; }
.checkrow input[type="checkbox"] { width: 20px; height: 20px; flex: none; }
