/* Kubiac – visual language borrowed from Israeli street parking:
   the blue "P" sign, asphalt grey, and the blue-white painted curb that means "paid parking here". */
:root {
  --sign: #1f4fa3;        /* parking-sign blue */
  --sign-deep: #173c7d;
  --asphalt: #2b313a;     /* text */
  --kerb: #ffffff;
  --street: #e9edf2;      /* page */
  --line: #cfd6df;
  --muted: #5b6573;
  --ok: #1e8a4c;
  --warn: #b97800;
  --bad: #c8322b;

  --display: "Secular One", "Assistant", system-ui, sans-serif;
  --text: "Assistant", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --r: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.5 var(--text);
  color: var(--asphalt);
  background: var(--street);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #f2b400; outline-offset: 2px; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--sign);
  color: var(--kerb);
}
.brand { display: flex; align-items: center; gap: 10px; }
.sign {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 2.5px solid var(--kerb); border-radius: 6px;
  font: 24px/1 var(--display);
}
.brand-name { font: 22px/1 var(--display); letter-spacing: .5px; }
.city { font-size: 15px; opacity: .85; }

main { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 14px 120px; flex: 1; }

/* ---------- search ---------- */
.search {
  margin-top: 18px;
  background: var(--kerb);
  border-radius: var(--r);
  padding: 20px 18px 22px;
  box-shadow: 0 1px 0 var(--line);
}
h1 { font: 34px/1.1 var(--display); margin: 0 0 14px; color: var(--sign-deep); }

.field { position: relative; }
.dest input {
  width: 100%;
  font: 600 19px/1.3 var(--text);
  padding: 15px 16px 15px 54px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--asphalt);
}
.dest input:focus { border-color: var(--sign); outline: none; box-shadow: 0 0 0 3px rgba(31,79,163,.18); }
.here {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 6px;
  background: transparent; color: var(--sign); cursor: pointer;
}
.here:hover { background: #eef3fb; }
.suggestions {
  position: absolute; z-index: 5; inset-inline: 0; top: calc(100% + 4px);
  list-style: none; margin: 0; padding: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23,40,70,.14);
}
.suggestions li { padding: 10px 12px; border-radius: 6px; cursor: pointer; }
.suggestions li small { display: block; color: var(--muted); font-size: 14px; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: #eef3fb; }

fieldset { border: 0; padding: 0; margin: 22px 0 0; }
legend { font-weight: 700; margin-bottom: 10px; padding: 0; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chips button {
  font: 600 17px/1 var(--text);
  padding: 14px 6px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff; color: var(--asphalt);
  cursor: pointer;
}
.chips button[aria-checked="true"] { background: var(--sign); border-color: var(--sign); color: #fff; }
.stepper {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-top: 10px; padding: 8px; border-radius: 8px; background: #eef3fb;
}
.stepper button {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--sign); background: #fff; color: var(--sign);
  font: 700 24px/1 var(--text); cursor: pointer;
}
.stepper output { font: 22px/1 var(--display); min-width: 100px; text-align: center; color: var(--sign-deep); }

.alerts { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.alerts summary { cursor: pointer; font-weight: 600; color: var(--sign); }
.alerts label { display: block; margin: 12px 0 6px; font-weight: 600; }
.alerts input { width: 100%; font: 17px var(--text); padding: 12px; border: 2px solid var(--line); border-radius: 8px; direction: ltr; text-align: right; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

.go {
  width: 100%; margin-top: 20px;
  padding: 16px; border: 0; border-radius: 8px;
  background: var(--sign); color: #fff;
  font: 22px/1 var(--display); cursor: pointer;
}
.go:hover { background: var(--sign-deep); }
.go[disabled] { opacity: .6; cursor: progress; }
.form-error { color: var(--bad); font-weight: 600; margin: 12px 0 0; }

/* ---------- results ---------- */
.results { margin-top: 22px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.results-head h2 { font: 24px/1.2 var(--display); margin: 0; }
.results-head p { margin: 0; color: var(--muted); font-size: 15px; }
.note { color: var(--muted); font-size: 15px; margin: 8px 2px 12px; }

.card {
  display: flex;
  background: #fff;
  border-radius: var(--r);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--line);
}
/* The one bold element: a painted blue-white kerb down the side of the recommended lot. */
.curb { width: 8px; flex: none; background: var(--line); }
.card.best .curb {
  width: 14px;
  background: repeating-linear-gradient(180deg, var(--sign) 0 22px, #fff 22px 44px);
  border-inline-end: 1px solid var(--line);
}
.card-body { flex: 1; padding: 14px 16px 16px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.name { font: 21px/1.2 var(--display); margin: 0; }
.addr { margin: 2px 0 10px; color: var(--muted); font-size: 15px; }
.badges { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badges:empty { display: none; }
.badge { font-size: 14px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #eef3fb; color: var(--sign-deep); }
.badge.top { background: var(--sign); color: #fff; }

.status { flex: none; font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 6px; white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-inline-end: 6px; vertical-align: 1px; }
.s-available { color: var(--ok); background: #e5f4ec; }
.s-few { color: var(--warn); background: #fdf3dc; }
.s-full, .s-closed { color: var(--bad); background: #fbe7e6; }
.s-active, .s-unknown { color: var(--muted); background: #eef0f3; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 14px; }
.facts div { background: var(--street); border-radius: 6px; padding: 8px 10px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; font-size: 17px; }
.facts dd small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }

.actions { display: flex; gap: 8px; }
.btn {
  flex: 1; text-align: center; text-decoration: none;
  padding: 13px 10px; border-radius: 8px; font-weight: 700;
  border: 2px solid var(--sign); color: var(--sign); background: #fff;
}
.btn.waze { background: var(--sign); color: #fff; }
.tariff { margin-top: 12px; font-size: 15px; }
.tariff summary { cursor: pointer; color: var(--muted); }
.tariff-text { white-space: pre-line; margin: 6px 0; }
.src { color: var(--sign); }

.empty { background: #fff; border-radius: var(--r); padding: 18px; }
.empty h2 { font: 22px var(--display); margin: 0 0 6px; }

/* ---------- live trip bar ---------- */
.trip {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 10;
  background: var(--asphalt); color: #fff;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(0,0,0,.18);
}
.trip-inner { max-width: 560px; margin: 0 auto; }
.trip-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.trip h2 { font: 19px/1.2 var(--display); margin: 0; }
.trip p { margin: 2px 0 0; font-size: 15px; opacity: .85; }
.trip .stop { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 6px; padding: 8px 12px; font: 600 15px var(--text); cursor: pointer; }
.pulse { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #4ad07f; margin-inline-end: 8px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
.trip.alert { background: var(--bad); }
.trip.alert .alts { margin-top: 10px; display: grid; gap: 8px; }
.alt { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: rgba(255,255,255,.12); border-radius: 8px; padding: 8px 10px; }
.alt a { color: var(--bad); background: #fff; text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: 6px; white-space: nowrap; }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 18px; }
.foot a { color: inherit; }
.credit {
  display: flex; width: fit-content; align-items: center; gap: 8px;
  margin: 14px auto 0; padding: 4px 12px 4px 6px;
  border-radius: 999px; background: #fff;
  color: var(--asphalt); font-weight: 600; font-size: 14px;
}
.credit img { border-radius: 6px; }

@media (min-width: 640px) {
  h1 { font-size: 40px; }
  .chips { grid-template-columns: repeat(6, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
