:root {
  --bg: #0c0d12;
  --card: rgba(18, 20, 28, 0.88);
  --card-border: rgba(139, 124, 246, 0.25);
  --text: #eceef4;
  --muted: #9aa0ad;
  --accent: #8b7cf6;
  --confirm: #34d399;
  --error: #f87171;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
}

#map { position: fixed; inset: 0; }

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(8, 9, 14, 0.38) 100%);
}

.card {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 32px));
  /* translucent so the animated map stays visible through the card */
  background: rgba(14, 16, 24, 0.42);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 28px 26px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* keep the text crisp against the map shining through */
.card h1, .card .sub, .card .usp, .card .offer-price, .card .offer-note {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.hero { top: 10vh; }
.offer { bottom: 4vh; }

.hidden { display: none !important; }
.fading { opacity: 0; transform: translateX(-50%) translateY(-12px); }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--accent);
  margin-bottom: 18px;
  text-transform: uppercase;
  font-size: 13px;
}

.brand-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: glow 2.4s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

h1 { font-size: 28px; line-height: 1.2; margin-bottom: 12px; }
h1 em { color: var(--accent); font-style: normal; }

.sub { color: var(--muted); font-size: 15px; line-height: 1.55; margin-bottom: 20px; }
.sub strong { color: var(--text); }

.address-box { position: relative; }

input[type="text"], input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus { border-color: var(--accent); }
input::placeholder { color: #6b7180; }

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  list-style: none;
  background: #15171f;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  z-index: 30;
}

.suggestions li {
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.suggestions li:last-child { border-bottom: none; }
.suggestions li:hover { background: rgba(139, 124, 246, 0.15); }

.usp {
  list-style: none;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 13.5px;
}

/* Offer card */
.offer-address { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.offer-status { color: var(--confirm); font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.offer-price { font-size: 40px; font-weight: 800; margin-bottom: 10px; }
.offer-note { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin-bottom: 16px; }
.offer-note strong { color: var(--text); }

/* Shift picker */
.shift-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.shift-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
  text-align: left;
}

.shift-option:hover { border-color: rgba(139, 124, 246, 0.5); }

.shift-option.selected {
  border-color: var(--accent);
  background: rgba(139, 124, 246, 0.16);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.shift-icon { font-size: 18px; }
.shift-name { font-size: 14px; font-weight: 700; }
.shift-time { font-size: 12.5px; color: var(--muted); }
.shift-price { font-size: 13px; font-weight: 700; color: var(--accent); margin-top: 2px; }

#email-input { margin-bottom: 12px; }

.btn-primary {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #6d5ce8);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(139, 124, 246, 0.4); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; transform: none; }

.btn-ghost {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.btn-ghost:hover { color: var(--text); }

.fine-print { color: #6b7180; font-size: 11.5px; line-height: 1.5; margin-top: 12px; }
.fine-print-confirm { color: var(--confirm); }
.error { color: var(--error); font-size: 13px; margin-top: 10px; }

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c1e28;
  border: 1px solid var(--card-border);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 50;
}

/* Map attribution: legally required (OSM/CARTO licenses), but kept discreet */
.maplibregl-ctrl-attrib {
  background: rgba(12, 13, 18, 0.55) !important;
  font-size: 10px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.maplibregl-ctrl-attrib:hover { opacity: 1; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }

.maplibregl-ctrl-attrib-button {
  background-color: rgba(12, 13, 18, 0.55) !important;
  filter: invert(0.7);
}

/* Pulsing address pin */
.pulse-pin { position: relative; width: 18px; height: 18px; }

.pulse-dot {
  position: absolute; inset: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.pulse-ring {
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Order status page */
.status-page { top: 3vh; max-height: 94vh; overflow-y: auto; padding: 22px 24px; }

.save-note {
  font-size: 12.5px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.08);
}

.copy-btn {
  display: inline-block;
  padding: 2px 8px;
  margin: 0 2px;
  border-radius: 7px;
  border: 1px solid rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.14);
  color: var(--confirm);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.copy-btn:hover { background: rgba(52, 211, 153, 0.25); }

.timeline { list-style: none; margin: 12px 0; }

.timeline li {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  color: var(--muted);
  font-size: 14px;
  align-items: flex-start;
}

.timeline .dot {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #3a3d4a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-top: 1px;
}

.timeline li.done { color: var(--text); }
.timeline li.done .dot { border-color: var(--confirm); background: rgba(52, 211, 153, 0.15); color: var(--confirm); }
.timeline li.active .dot { border-color: var(--accent); animation: glow 2s infinite; }

.status-map {
  width: 100%;
  height: 150px;
  border-radius: 12px;
  margin-top: 10px;
  overflow: hidden;
}

/* Admin dashboard */
.admin-body { background: var(--bg); }

.admin-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
}

.admin-panel {
  max-width: 420px;
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 26px;
}

.admin-panel h1 { font-size: 22px; margin-bottom: 8px; }
.admin-panel input { margin-top: 12px; }

input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

input[type="password"]:focus { border-color: var(--accent); }

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 14px;
}

.admin-stats { display: flex; gap: 18px; color: var(--muted); font-size: 14px; }
.admin-stats strong { color: var(--text); font-size: 16px; }

.btn-small {
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.btn-small:hover { border-color: var(--accent); }
.btn-small:disabled { opacity: 0.5; cursor: wait; }

.btn-charge {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.5);
  color: var(--confirm);
  font-weight: 600;
}

.table-scroll { overflow-x: auto; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; }

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: rgba(18, 20, 28, 0.7);
}

.orders-table th, .orders-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.orders-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.orders-table td.empty { color: var(--muted); text-align: center; padding: 28px; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-active { background: rgba(139, 124, 246, 0.18); color: var(--accent); }
.badge-done { background: rgba(52, 211, 153, 0.16); color: var(--confirm); }
.badge-error { background: rgba(248, 113, 113, 0.16); color: var(--error); }
.badge-muted { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

@media (max-width: 480px) {
  .hero { top: 4vh; }
  h1 { font-size: 24px; }
  .offer-price { font-size: 34px; }
}
