:root {
  --bg: #eef3f7;
  --card: rgba(255, 255, 255, 0.92);
  --card-border: rgba(3, 105, 161, 0.35);
  --text: #1c2733;
  --muted: #5b6b78;
  --accent: #0369a1;
  --confirm: #059669;
  --error: #dc2626;
}

* { 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(206, 222, 233, 0.45) 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(255, 255, 255, 0.78);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 28px 26px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 18px 60px rgba(28, 55, 78, 0.22);
  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(255, 255, 255, 0.7);
}

.hero { top: 10vh; }

/* The offer wizard is long (house type + scope + frequency + day picker) —
   anchor to top and scroll internally so everything stays reachable. */
.offer {
  top: 3vh;
  bottom: auto;
  max-height: calc(100dvh - 6vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  /* native (auto-hiding) scrollbar is hidden; the always-visible custom
     indicator below takes its place */
  scrollbar-width: none;
}

.offer::-webkit-scrollbar { display: none; }

/* Custom scroll indicator on the card edge (macOS overlay scrollbars
   auto-hide and cannot be forced visible with CSS alone). Shown while the
   cursor hovers the card, or briefly while scrolling on touch devices. */
.fake-scrollbar {
  position: fixed;
  width: 6px;
  border-radius: 6px;
  background: rgba(28, 55, 78, 0.12);
  z-index: 45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

#offer:hover + .fake-scrollbar,
.fake-scrollbar.visible { opacity: 1; }

.fake-scrollbar-thumb {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 6px;
  background: var(--accent);
}

/* Sticky footer inside the scrollable offer card: the CTA stays visible while
   the options scroll behind it; the transparent top edge fades the content out
   so it's obvious there is more to scroll. */
#offer { padding-bottom: 0; }

.offer-footer {
  position: sticky;
  bottom: 0;
  margin: 0 -26px;
  padding: 30px 26px 16px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.96) 28px);
  border-radius: 0 0 18px 18px;
}

.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(28, 55, 78, 0.22);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus { border-color: var(--accent); }
input::placeholder { color: #8a97a3; }

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  z-index: 30;
  box-shadow: 0 12px 32px rgba(28, 55, 78, 0.18);
}

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

.suggestions li:last-child { border-bottom: none; }
.suggestions li:hover { background: rgba(3, 105, 161, 0.08); }

.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: 34px; 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); }

.field-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 12px 0 6px;
}

/* Choice pickers (house type, scope, frequency) */
.choice-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
}

.house-picker { grid-template-columns: 1fr 1fr; }
.scope-picker { grid-template-columns: 1fr 1fr 1fr; }
.freq-picker { grid-template-columns: 1fr 1fr 1fr; }

.choice-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(28, 55, 78, 0.18);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
  text-align: left;
}

.choice-option:hover { border-color: rgba(3, 105, 161, 0.5); }

.choice-option.selected {
  border-color: var(--accent);
  background: rgba(3, 105, 161, 0.08);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.choice-name { font-size: 13.5px; font-weight: 700; }
.choice-sub { font-size: 11.5px; color: var(--muted); }
.choice-price { font-size: 12px; font-weight: 700; color: var(--accent); margin-top: 2px; }

/* Day picker (current week) */
.day-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.day-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 0 9px;
  border-radius: 12px;
  border: 1px solid rgba(28, 55, 78, 0.18);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}

.day-dot:hover:not(.past):not(.selected) {
  border-color: rgba(3, 105, 161, 0.55);
}

.day-dot .day-name {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.day-dot .day-num {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.day-dot.today .day-name { color: var(--text); }

.day-dot.selected {
  border-color: var(--accent);
  background: rgba(3, 105, 161, 0.1);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.day-dot.selected .day-name,
.day-dot.selected .day-num { color: var(--text); }

.day-dot.past {
  cursor: not-allowed;
  opacity: 0.45;
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.05);
}

.day-dot.past .day-name,
.day-dot.past .day-num {
  color: var(--error);
}

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

.btn-primary {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7, var(--accent));
  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(3, 105, 161, 0.35); }
.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); }

/* last scrollable element in the offer card (padding-bottom sits on the footer) */
#offer .btn-ghost { margin-bottom: 16px; }

.fine-print { color: #6d7c89; 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: #ffffff;
  border: 1px solid var(--card-border);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 50;
  box-shadow: 0 12px 32px rgba(28, 55, 78, 0.18);
}

/* Map attribution: legally required (OSM licenses), but kept discreet */
.maplibregl-ctrl-attrib {
  background: rgba(255, 255, 255, 0.6) !important;
  font-size: 10px;
  opacity: 0.6;
  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(255, 255, 255, 0.6) !important;
}

/* 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(5, 150, 105, 0.35);
  border-radius: 10px;
  background: rgba(5, 150, 105, 0.07);
}

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

.copy-btn:hover { background: rgba(5, 150, 105, 0.2); }

.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 #b8c5d0;
  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(5, 150, 105, 0.12); 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(28, 55, 78, 0.22);
  background: rgba(255, 255, 255, 0.9);
  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(28, 55, 78, 0.2);
  background: rgba(255, 255, 255, 0.85);
  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(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.5);
  color: var(--confirm);
  font-weight: 600;
}

.table-scroll { overflow-x: auto; border: 1px solid rgba(28, 55, 78, 0.12); border-radius: 12px; }

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: rgba(255, 255, 255, 0.9);
}

.orders-table th, .orders-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(28, 55, 78, 0.08);
  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(3, 105, 161, 0.12); color: var(--accent); }
.badge-done { background: rgba(5, 150, 105, 0.12); color: var(--confirm); }
.badge-error { background: rgba(220, 38, 38, 0.12); color: var(--error); }
.badge-muted { background: rgba(28, 55, 78, 0.08); color: var(--muted); }

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