/* ============================================================
   HailCart — shared design tokens
   ============================================================ */

:root {
  --fairway: #0e3b2c;
  --fairway-deep: #06180f;
  --fairway-mid: #0d2a20;
  --green: #1c8a5e;
  --green-bright: #3fd897;
  --green-glow: rgba(63, 216, 151, 0.22);
  --sand: #f3eee2;
  --cream: #fffdf7;
  --ink: #12211b;
  --ink-soft: #62736b;
  --line: rgba(14, 59, 44, 0.11);
  --gold: #e8a93a;
  --alert: #e2604a;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(6, 24, 15, 0.06);
  --shadow-md: 0 10px 30px rgba(6, 24, 15, 0.10);
  --shadow-lg: 0 24px 60px rgba(6, 24, 15, 0.18);

  --font: "Avenir Next", ui-sans-serif, -apple-system, BlinkMacSystemFont,
          "Segoe UI", Inter, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { letter-spacing: -0.035em; font-weight: 800; }

button { font-family: inherit; }

.hidden { display: none !important; }

/* ---------- top bar (both pages) ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  height: 62px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  position: sticky;
  top: 0;
  z-index: 500;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: inherit;
  margin-right: auto;
}

.brand .mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--fairway);
  color: var(--green-bright);
  font-size: 1.05rem;
  box-shadow: var(--shadow-sm);
}

.link {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
  white-space: nowrap;
}
.link:hover { background: var(--fairway); color: var(--cream); border-color: transparent; }

/* ============================================================
   Golfer page
   ============================================================ */

body.golfer {
  background:
    radial-gradient(900px 420px at 50% -8%, var(--green-glow), transparent 68%),
    linear-gradient(172deg, #f7f3e9 0%, #e9e2d1 100%);
  min-height: 100%;
}

.hail-wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 44px 22px 70px;
}

.hero { text-align: center; margin-bottom: 30px; }
.hero h1 { font-size: clamp(2.1rem, 8vw, 2.85rem); line-height: 1.02; margin: 0 0 12px; }
.hero p {
  color: var(--ink-soft);
  margin: 0 auto;
  max-width: 30ch;
  line-height: 1.55;
  font-size: 1.02rem;
}

.panel {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 22px;
}

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 800;
  color: var(--ink-soft);
}
.field label .opt { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: 0.75; }

input {
  font: inherit;
  font-size: 1rem;
  padding: 14px 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: #fbf8f1;
  color: var(--ink);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
input::placeholder { color: #a9b3ae; }
input:focus {
  border-color: var(--green);
  background: var(--cream);
  box-shadow: 0 0 0 4px rgba(28, 138, 94, 0.13);
}

.row { display: flex; gap: 12px; }
/* min-width: 0 lets the inputs shrink below their intrinsic width so the
   row never spills past the panel edge on narrow screens. */
.row .field { flex: 1 1 0; min-width: 0; margin-bottom: 14px; }
.row .field.narrow { flex: 0 1 92px; }
.row input { width: 100%; }

.hail-btn {
  width: 100%;
  margin-top: 8px;
  padding: 26px 20px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--cream);
  background: linear-gradient(158deg, #24a26e, var(--fairway) 92%);
  border: none;
  border-radius: var(--r-lg);
  box-shadow: 0 14px 34px rgba(14, 59, 44, 0.3);
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.25s var(--ease), opacity 0.2s;
}
.hail-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 20px 46px rgba(14, 59, 44, 0.36); }
.hail-btn:active:not(:disabled) { transform: translateY(1px) scale(0.995); }
.hail-btn:disabled { opacity: 0.65; cursor: default; }
.hail-btn small {
  display: block;
  margin-top: 7px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 0.78;
}

/* status card after hailing */

.beacon {
  width: 66px;
  height: 66px;
  margin: 2px auto 16px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--green-bright), var(--green));
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(63, 216, 151, 0.5); }
  70%  { box-shadow: 0 0 0 22px rgba(63, 216, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 216, 151, 0); }
}

.status-card { text-align: center; }
.status-card h2 { margin: 0 0 8px; font-size: 1.4rem; }
.status-card > p { margin: 0; color: var(--ink-soft); line-height: 1.55; font-size: 0.96rem; }

.mini-map {
  height: 168px;
  margin: 20px 0 0;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e6e0d2;
}

.steps {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 20px 0 4px;
}
.step { flex: 1; text-align: center; }
.step .bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(14, 59, 44, 0.12);
  transition: background 0.4s var(--ease);
}
.step.on .bar { background: var(--green); }
.step .label {
  display: block;
  margin-top: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.step.on .label { color: var(--fairway); }

.meta {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.ghost-btn {
  margin-top: 16px;
  width: 100%;
  padding: 13px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}
.ghost-btn:hover { background: rgba(14, 59, 44, 0.055); color: var(--ink); }

.error {
  margin-top: 18px;
  padding: 15px 16px;
  border-radius: var(--r-md);
  background: rgba(226, 96, 74, 0.09);
  border: 1px solid rgba(226, 96, 74, 0.28);
  color: #a13623;
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ============================================================
   Cart page
   ============================================================ */

body.cart {
  background: var(--fairway-deep);
  color: var(--sand);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

body.cart .topbar {
  background: rgba(6, 24, 15, 0.9);
  border-bottom-color: rgba(243, 238, 226, 0.1);
}
body.cart .brand { color: var(--cream); }
body.cart .brand .mark { background: var(--green-bright); color: var(--fairway-deep); }
body.cart .link { border-color: rgba(243, 238, 226, 0.18); color: rgba(243, 238, 226, 0.66); }
body.cart .link:hover { background: var(--green-bright); color: var(--fairway-deep); }

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(243, 238, 226, 0.5);
}
.live .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 0 0 var(--green-glow);
  animation: blip 2.2s infinite;
}
@keyframes blip { 0% { box-shadow: 0 0 0 0 var(--green-glow); } 70% { box-shadow: 0 0 0 9px rgba(63,216,151,0); } }
.live.down .dot { background: var(--alert); animation: none; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: rgba(243, 238, 226, 0.55);
  cursor: pointer;
  user-select: none;
}
.toggle input { accent-color: var(--green-bright); }

/* layout: map beside queue */

.cart-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
}

#map {
  height: 100%;
  background: #0a1f16;
  position: relative;
}

/* map pins */

.pin {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--fairway-deep);
  border: 2px solid rgba(6, 24, 15, 0.5);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.22s var(--ease);
}
.pin span { transform: rotate(45deg); }
.pin.pending { background: var(--gold); }
.pin.enroute { background: var(--green-bright); }
.pin.active { transform: rotate(-45deg) scale(1.3); z-index: 900; }

.leaflet-container { background: #0a1f16; font-family: var(--font); }
.leaflet-control-attribution {
  background: rgba(6, 24, 15, 0.7) !important;
  color: rgba(243, 238, 226, 0.4) !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a { color: rgba(243, 238, 226, 0.6) !important; }
.leaflet-bar a {
  background: rgba(6, 24, 15, 0.86) !important;
  color: var(--sand) !important;
  border-color: rgba(243, 238, 226, 0.14) !important;
}
.leaflet-bar a:hover { background: var(--green-bright) !important; color: var(--fairway-deep) !important; }

/* queue column */

.queue-col {
  border-left: 1px solid rgba(243, 238, 226, 0.1);
  background: linear-gradient(180deg, #082016, #061a11);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.queue-head {
  padding: 20px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(243, 238, 226, 0.08);
}
.queue-head h1 { margin: 0; font-size: 1.5rem; color: var(--cream); }
.queue-head .course {
  display: block;
  margin-top: 2px;
  font-size: 0.76rem;
  color: rgba(243, 238, 226, 0.42);
}
.queue-head .count {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--green-bright);
}

.queue-scroll { overflow-y: auto; padding: 16px 18px 40px; flex: 1; }
.queue-scroll::-webkit-scrollbar { width: 9px; }
.queue-scroll::-webkit-scrollbar-thumb { background: rgba(243, 238, 226, 0.14); border-radius: 999px; }

.card {
  position: relative;
  background: rgba(255, 253, 247, 0.05);
  border: 1px solid rgba(243, 238, 226, 0.11);
  border-radius: var(--r-lg);
  padding: 16px 18px 16px 16px;
  margin-bottom: 12px;
  display: grid;
  gap: 13px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.18s var(--ease);
  animation: rise 0.4s var(--ease) both;
}
.card:hover { background: rgba(255, 253, 247, 0.08); border-color: rgba(243, 238, 226, 0.2); }
.card.active { border-color: var(--green-bright); background: rgba(63, 216, 151, 0.09); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.card.done { opacity: 0.4; }

.card-top { display: flex; align-items: flex-start; gap: 13px; }

.rank {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--fairway-deep);
  background: var(--gold);
}
.card.enroute .rank { background: var(--green-bright); }
.card.done .rank { background: rgba(243, 238, 226, 0.3); }

.who { flex: 1; min-width: 0; }
.card-name {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--cream);
  line-height: 1.25;
}
.card-note {
  font-size: 0.89rem;
  color: rgba(243, 238, 226, 0.66);
  margin-top: 3px;
  line-height: 1.4;
}

.waited { text-align: right; white-space: nowrap; }
.waited .big {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.waited .unit {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(243, 238, 226, 0.42);
  margin-top: 2px;
}
.waited.warm .big { color: var(--gold); }
.waited.hot .big { color: var(--alert); }

.tags { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

.pill {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pill.pending  { background: rgba(232, 169, 58, 0.16); color: var(--gold); }
.pill.enroute  { background: rgba(63, 216, 151, 0.16); color: var(--green-bright); }
.pill.delivered{ background: rgba(243, 238, 226, 0.12); color: rgba(243, 238, 226, 0.62); }
.pill.canceled { background: rgba(226, 96, 74, 0.16); color: #f19a86; }
.pill.hole     { background: rgba(243, 238, 226, 0.09); color: rgba(243, 238, 226, 0.78); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions button {
  font-size: 0.84rem;
  font-weight: 700;
  padding: 10px 15px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(243, 238, 226, 0.18);
  background: transparent;
  color: rgba(243, 238, 226, 0.8);
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}
.actions button:hover { background: rgba(243, 238, 226, 0.1); color: var(--cream); }
.actions button.primary {
  background: var(--green-bright);
  border-color: var(--green-bright);
  color: var(--fairway-deep);
}
.actions button.primary:hover { background: #57e6a9; }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(243, 238, 226, 0.42);
  border: 1px dashed rgba(243, 238, 226, 0.16);
  border-radius: var(--r-lg);
  line-height: 1.6;
}
.empty .big { font-size: 2.3rem; display: block; margin-bottom: 12px; }

.section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: rgba(243, 238, 226, 0.34);
  margin: 26px 0 12px;
}

@media (max-width: 900px) {
  body.cart { overflow: auto; height: auto; }
  .cart-layout { grid-template-columns: 1fr; }
  #map { height: 46vh; min-height: 260px; }
  .queue-col { border-left: none; border-top: 1px solid rgba(243, 238, 226, 0.1); }
  .queue-scroll { overflow: visible; }
}

/* ---------- cart passcode gate ---------- */

.lock {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(700px 400px at 50% 0%, rgba(63, 216, 151, 0.1), transparent 70%),
              var(--fairway-deep);
}
.lock.hidden { display: none !important; }

.lock-card {
  width: 100%;
  max-width: 340px;
  text-align: center;
  background: rgba(255, 253, 247, 0.05);
  border: 1px solid rgba(243, 238, 226, 0.13);
  border-radius: var(--r-xl);
  padding: 34px 26px 28px;
  box-shadow: var(--shadow-lg);
}
.lock-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: var(--green-bright);
}
.lock-card h1 { margin: 0 0 6px; font-size: 1.35rem; color: var(--cream); }
.lock-card p { margin: 0 0 22px; font-size: 0.9rem; color: rgba(243, 238, 226, 0.55); }
.lock-card input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.08em;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid rgba(243, 238, 226, 0.18);
  background: rgba(6, 24, 15, 0.6);
  color: var(--cream);
  outline: none;
}
.lock-card input:focus {
  border-color: var(--green-bright);
  box-shadow: 0 0 0 4px rgba(63, 216, 151, 0.16);
}
.lock-btn {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 800;
  border: none;
  border-radius: var(--r-md);
  background: var(--green-bright);
  color: var(--fairway-deep);
  cursor: pointer;
  transition: background 0.16s;
}
.lock-btn:hover:not(:disabled) { background: #57e6a9; }
.lock-btn:disabled { opacity: 0.6; cursor: default; }
.lock-error {
  margin-top: 14px;
  font-size: 0.85rem;
  color: #f19a86;
}

body.cart .topbar button.link { background: transparent; cursor: pointer; }

/* ---------- course picker ---------- */

body.picker { min-height: 100%; }

.picker-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 52px 24px 80px;
}

.picker-wrap .hero { margin-bottom: 34px; }

.course-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}

.course-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.28s var(--ease);
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.course-hero {
  position: relative;
  display: block;
  height: 172px;
  overflow: hidden;
  text-decoration: none;
}

/* Separate element so the image can scale without moving the label. */
.course-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s var(--ease);
}
.course-card:hover .course-photo { transform: scale(1.05); }

.course-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 24, 15, 0.88) 0%, rgba(6, 24, 15, 0.15) 52%, transparent 78%);
}

.course-name {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 16px;
  z-index: 1;
  color: var(--cream);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(6, 24, 15, 0.6);
}

.course-actions {
  display: flex;
  gap: 10px;
  padding: 16px;
}

.course-btn {
  flex: 1;
  padding: 12px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  text-align: center;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}
.course-btn:hover { background: rgba(14, 59, 44, 0.06); color: var(--ink); }

.course-btn.primary {
  background: linear-gradient(158deg, #24a26e, var(--fairway) 92%);
  border-color: transparent;
  color: var(--cream);
}
.course-btn.primary:hover { filter: brightness(1.08); color: var(--cream); }

.empty-note { grid-column: 1 / -1; text-align: center; color: var(--ink-soft); }
.empty-note code {
  background: rgba(14, 59, 44, 0.07);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

/* ---------- post-delivery feedback (golfer) ---------- */

.feedback {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.feedback-q {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}
.feedback-actions { display: flex; gap: 10px; }

.feedback-btn {
  flex: 1;
  padding: 13px 10px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border-color 0.16s, transform 0.14s var(--ease);
}
.feedback-btn:hover:not(:disabled) { transform: translateY(-1px); }
.feedback-btn:disabled { opacity: 0.55; cursor: default; }
.feedback-btn.yes:hover:not(:disabled) {
  background: rgba(28, 138, 94, 0.1);
  border-color: var(--green);
  color: var(--fairway);
}
.feedback-btn.no:hover:not(:disabled) {
  background: rgba(226, 96, 74, 0.09);
  border-color: rgba(226, 96, 74, 0.5);
  color: #a13623;
}

.feedback-done {
  margin-top: 20px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: rgba(28, 138, 94, 0.1);
  border: 1px solid rgba(28, 138, 94, 0.26);
  color: var(--fairway);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}
.feedback-done.missed {
  background: rgba(226, 96, 74, 0.09);
  border-color: rgba(226, 96, 74, 0.3);
  color: #a13623;
}

/* ---------- feedback pills (cart) ---------- */

.pill.confirmed { background: rgba(63, 216, 151, 0.16); color: var(--green-bright); }
.pill.missed { background: rgba(226, 96, 74, 0.2); color: #f19a86; }

/* A golfer reporting a no-show is the most useful thing on this screen —
   it should not be the faintest. */
.card.done.flagged {
  opacity: 0.9;
  border-left: 4px solid var(--alert);
  background: rgba(226, 96, 74, 0.07);
}
