/* ================================================================
   URBIX — Premium Layer v4.0 LEAN
   ✓ Zero backdrop-filter on map-adjacent elements (perf)
   ✓ Max 30 !important declarations
   ✓ No conflicts with style.css
   ================================================================ */

/* ── Anti-FOUC: stable dark background on root ─────────────── */
html { transition: none !important; }

/* ================================================================
   MOBILE LAYOUT — Position elements below full-width top-bar
   ================================================================ */
@media (max-width: 899px) {
  /* Collapsed search icon: hidden on mobile (top-bar has search button) */
  .map-search.collapsed {
    display: none !important;
  }
  /* Expanded search bar: appears below the top-bar */
  .map-search:not(.collapsed) {
    top: calc(env(safe-area-inset-top, 0px) + 88px) !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
  }
  /* Quick actions: below search bar area */
  .quick-actions {
    top: calc(env(safe-area-inset-top, 0px) + 152px) !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
  }
  .quick-actions.collapsed {
    top: calc(env(safe-area-inset-top, 0px) + 92px) !important;
  }
  /* Make top-bar search button full-width in the center column */
  .top-bar-search {
    font-size: 0.88rem;
  }
}

/* ================================================================
   DESKTOP LAYOUT — Hide top-bar, sidebar handles navigation (≥900px)
   ================================================================ */
@media (min-width: 900px) {
  /* CRITICAL: top-bar is hidden on desktop — sidebar replaces it */
  .top-bar-reference,
  .top-bar-reference.premium-header {
    display: none !important;
  }
  /* Ensure map is correctly shifted to the right of the sidebar */
  #map {
    left: 370px !important;
    width: calc(100vw - 370px) !important;
  }
}

/* ================================================================
   MOBILE TOP BAR (≤899px) — Show properly
   ================================================================ */
@media (max-width: 899px) {
  .top-bar-reference.premium-header {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 10px 12px;
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    transform: none !important;
    max-width: none !important;
    border-radius: 20px;
    background: rgba(255,255,255,0.96) !important;
    border: 1px solid rgba(15,23,42,0.08) !important;
    box-shadow: 0 8px 32px rgba(15,23,42,0.14);
  }
  body.theme-night .top-bar-reference.premium-header {
    background: rgba(8,12,24,0.95) !important;
    border-color: rgba(255,255,255,0.10) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.55);
  }
  /* Brand icon size */
  .brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    object-fit: cover;
    flex-shrink: 0;
  }
  .brand-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    color: #0f172a;
    line-height: 1;
  }
  body.theme-night .brand-name { color: #f1f5f9; }
  .brand-tag {
    font-size: 0.66rem;
    color: rgba(15,23,42,0.46);
    font-weight: 600;
    margin-top: 2px;
  }
  body.theme-night .brand-tag { color: rgba(241,245,249,0.42); }
  /* Search button in top-bar */
  .top-bar-search {
    background: rgba(15,23,42,0.05);
    border: 1px solid rgba(15,23,42,0.09);
    border-radius: 14px;
    min-height: 44px;
    color: rgba(15,23,42,0.62);
    transition: background 0.18s, border-color 0.18s;
  }
  body.theme-night .top-bar-search {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.10);
    color: rgba(241,245,249,0.65);
  }
  .search-label { color: rgba(15,23,42,0.58); }
  body.theme-night .search-label { color: rgba(241,245,249,0.55); }
  .search-icon {
    background: rgba(15,23,42,0.06);
    width: 34px; height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
  }
  /* Ref buttons */
  .ref-btn-round {
    width: 42px; height: 42px;
    border-radius: 14px;
    background: rgba(248,250,252,0.97);
    border: 1px solid rgba(15,23,42,0.07);
    color: #1e293b;
    transition: transform 0.18s, box-shadow 0.18s;
  }
  .ref-btn-round:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,23,42,0.12); }
  body.theme-night .ref-btn-round {
    background: rgba(22,34,62,0.90);
    border-color: rgba(255,255,255,0.09);
    color: #e2e8f0;
  }
  /* Auth CTA button */
  .ref-auth-btn {
    background: linear-gradient(135deg, #e11d48, #7c3aed);
    color: #fff;
    border: none;
    padding: 10px 16px;
    font-weight: 900;
    font-size: 0.86rem;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(225,29,72,0.28);
    transition: transform 0.18s, box-shadow 0.18s;
  }
  .ref-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(225,29,72,0.38);
  }
}

/* ================================================================
   CATEGORY BUTTONS — Subtle premium (works on both desktop+mobile)
   ================================================================ */
.cat-btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  will-change: transform;
}
.cat-btn:hover {
  transform: translateY(-3px) scale(1.04);
}
.cat-btn.active {
  background: linear-gradient(135deg, #e11d48, #7c3aed) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 10px 28px rgba(225,29,72,0.30);
  transform: translateY(-4px) scale(1.05);
}
.cat-btn.active .cat-ic {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.18));
}

/* ================================================================
   POPUP / INFO WINDOW
   ================================================================ */
.urbix-iw {
  background: rgba(255,255,255,0.99);
  border: 1px solid rgba(15,23,42,0.09);
  border-radius: 20px;
  box-shadow: 0 16px 56px rgba(15,23,42,0.18), 0 4px 14px rgba(15,23,42,0.08);
  padding: 13px;
}
body.theme-night .urbix-iw {
  background: rgba(10,14,28,0.98);
  border-color: rgba(255,255,255,0.10);
  box-shadow: 0 18px 64px rgba(0,0,0,0.65), 0 5px 18px rgba(0,0,0,0.38);
}
.urbix-iw__btn {
  border-radius: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.urbix-iw__btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,23,42,0.12); }
.urbix-iw__btn.primary {
  background: linear-gradient(135deg, #e11d48, #7c3aed);
  color: #fff;
  border: none;
  box-shadow: 0 8px 22px rgba(225,29,72,0.28);
}
.urbix-iw__btn.primary:hover { box-shadow: 0 14px 36px rgba(225,29,72,0.38); }

/* ================================================================
   COMPANY POPUP BUTTONS
   ================================================================ */
.company-preview-btn {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
.company-preview-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15,23,42,0.12); }
.company-preview-btn.primary {
  background: linear-gradient(135deg, #e11d48, #7c3aed) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 10px 28px rgba(225,29,72,0.28);
}
.company-preview-btn.primary:hover { box-shadow: 0 18px 44px rgba(225,29,72,0.38) !important; }
.company-preview-btn.whatsapp:hover {
  background: linear-gradient(135deg, #22c55e, #15803d) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* ================================================================
   MODALS (bottom sheets) — Solid backgrounds for performance
   ================================================================ */
.modal {
  background: rgba(255,255,255,0.99);
  border-top: 1px solid rgba(15,23,42,0.07);
  border-left: 1px solid rgba(15,23,42,0.07);
  border-right: 1px solid rgba(15,23,42,0.07);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -16px 56px rgba(15,23,42,0.14);
}
body.theme-night .modal {
  background: rgba(9,13,26,0.99);
  border-top-color: rgba(255,255,255,0.09);
  border-left-color: rgba(255,255,255,0.09);
  border-right-color: rgba(255,255,255,0.09);
  box-shadow: 0 -18px 64px rgba(0,0,0,0.60);
}
.modal-handle {
  width: 40px; height: 4px;
  border-radius: 999px;
  margin: 12px auto 8px;
  background: rgba(15,23,42,0.13);
}
body.theme-night .modal-handle { background: rgba(255,255,255,0.18); }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: rgba(15,23,42,0.06);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.15s;
}
.modal-close:hover { background: rgba(225,29,72,0.09); color: #e11d48; transform: scale(1.08); }

/* ================================================================
   AUTH MODAL — Premium Header
   ================================================================ */
.auth-header-premium {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(15,23,42,0.06);
}
body.theme-night .auth-header-premium { border-bottom-color: rgba(255,255,255,0.07); }
.auth-header-brand { display: flex; align-items: center; gap: 10px; }
.auth-header-icon {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e11d48, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(225,29,72,0.26);
  flex-shrink: 0;
}
.auth-header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 1rem;
  color: #0f172a; line-height: 1;
}
body.theme-night .auth-header-title { color: #f1f5f9; }
.auth-header-sub {
  font-size: 0.70rem; color: rgba(15,23,42,0.44);
  font-weight: 600; margin-top: 3px; font-style: italic;
}
body.theme-night .auth-header-sub { color: rgba(241,245,249,0.38); }
.auth-close-btn {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: rgba(15,23,42,0.06);
  border: 1px solid rgba(15,23,42,0.07);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #64748b; transition: background 0.15s, transform 0.15s;
}
.auth-close-btn:hover { background: rgba(225,29,72,0.09); color: #e11d48; transform: scale(1.06); }
body.theme-night .auth-close-btn { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.10); color: #94a3b8; }

/* ================================================================
   AUTH TABS & FORMS
   ================================================================ */
.tab-pills {
  display: flex; gap: 5px;
  background: rgba(15,23,42,0.05);
  border-radius: 14px; padding: 4px;
  margin-bottom: 16px;
}
body.theme-night .tab-pills { background: rgba(255,255,255,0.06); }
.tab-pill {
  flex: 1; padding: 9px 12px;
  border-radius: 10px; border: none;
  font-weight: 900; font-size: 0.85rem;
  cursor: pointer; transition: background 0.18s, color 0.18s;
  background: transparent; color: rgba(15,23,42,0.52);
}
body.theme-night .tab-pill { color: rgba(241,245,249,0.50); }
.tab-pill.active {
  background: rgba(255,255,255,0.97);
  color: #0f172a;
  box-shadow: 0 2px 10px rgba(15,23,42,0.10);
}
body.theme-night .tab-pill.active { background: rgba(25,38,68,0.92); color: #f1f5f9; }
.tab-pill:hover:not(.active) { background: rgba(15,23,42,0.06); color: rgba(15,23,42,0.75); }
body.theme-night .tab-pill:hover:not(.active) { background: rgba(255,255,255,0.08); color: rgba(241,245,249,0.75); }

/* Primary CTA button */
.btn-primary-full {
  width: 100%; padding: 14px;
  border-radius: 14px; border: none;
  background: linear-gradient(135deg, #e11d48, #7c3aed);
  color: #fff; font-weight: 900; font-size: 0.97rem;
  cursor: pointer; margin-top: 14px;
  box-shadow: 0 10px 28px rgba(225,29,72,0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative; overflow: hidden;
}
.btn-primary-full::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 100%);
  pointer-events: none;
}
.btn-primary-full:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(225,29,72,0.36); }
.btn-primary-full:active { transform: translateY(0); }

/* Form elements */
.form-input, .form-control {
  border-radius: 12px;
  border: 1.5px solid rgba(15,23,42,0.10);
  background: rgba(248,250,252,0.96);
  font-weight: 700;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.form-input:focus, .form-control:focus {
  border-color: rgba(225,29,72,0.36);
  box-shadow: 0 0 0 3px rgba(225,29,72,0.10);
  outline: none; background: #fff;
}
body.theme-night .form-input, body.theme-night .form-control {
  background: rgba(18,28,52,0.84);
  border-color: rgba(255,255,255,0.10);
  color: #f1f5f9;
}
.form-label {
  font-weight: 800; font-size: 0.80rem;
  color: rgba(15,23,42,0.52);
  display: block; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.form-select {
  width: 100%; padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid rgba(15,23,42,0.10);
  background: rgba(248,250,252,0.96);
  font-family: 'Nunito', sans-serif;
  font-weight: 700; cursor: pointer;
  transition: border-color 0.18s;
}
.form-select:focus { border-color: rgba(225,29,72,0.36); outline: none; }
body.theme-night .form-select { background: rgba(18,28,52,0.84); border-color: rgba(255,255,255,0.10); color: #f1f5f9; }
.form-textarea {
  width: 100%; padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid rgba(15,23,42,0.10);
  background: rgba(248,250,252,0.96);
  font-family: 'Nunito', sans-serif;
  font-weight: 700; resize: vertical; min-height: 70px;
  transition: border-color 0.18s;
}
.form-textarea:focus { border-color: rgba(225,29,72,0.36); outline: none; }
body.theme-night .form-textarea { background: rgba(18,28,52,0.84); border-color: rgba(255,255,255,0.10); color: #f1f5f9; }

/* Auth bonus banner */
.auth-bonus-banner {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.22);
  border-radius: 12px; padding: 10px 13px;
  font-size: 0.82rem; font-weight: 700;
  color: #059669; margin-bottom: 12px;
}
body.theme-night .auth-bonus-banner { color: #34d399; background: rgba(16,185,129,0.10); }

/* Auth file button */
.auth-file-btn {
  display: inline-flex; align-items: center;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(15,23,42,0.05);
  border: 1.5px dashed rgba(15,23,42,0.16);
  font-size: 0.82rem; font-weight: 800;
  color: rgba(15,23,42,0.52); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.auth-file-btn:hover { background: rgba(225,29,72,0.06); border-color: rgba(225,29,72,0.26); color: #e11d48; }
body.theme-night .auth-file-btn { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.16); color: rgba(241,245,249,0.48); }

/* Avatar preview */
.auth-avatar-preview {
  width: 54px; height: 54px;
  border-radius: 16px;
  background: rgba(225,29,72,0.07);
  border: 2px solid rgba(225,29,72,0.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0; overflow: hidden;
}

/* Password meter */
.pw-meter {
  height: 4px; background: rgba(15,23,42,0.08);
  border-radius: 999px; margin-top: 5px; overflow: hidden;
}
.pw-meter-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #e11d48, #7c3aed);
  transition: width 0.3s ease;
}

/* Divider */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15,23,42,0.08), transparent);
  margin: 14px 0;
}
body.theme-night .divider { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent); }

/* ================================================================
   VOICE SEARCH BUTTON
   ================================================================ */
.urbix-voice-btn {
  width: 33px; height: 33px;
  border-radius: 11px;
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(248,250,252,0.96);
  color: #64748b; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s, background 0.18s;
  box-shadow: 0 2px 8px rgba(15,23,42,0.07);
}
.urbix-voice-btn:hover { transform: scale(1.10); background: linear-gradient(135deg, #e11d48, #7c3aed); border-color: transparent; color: #fff; }
.urbix-voice-btn.listening {
  background: linear-gradient(135deg, #e11d48, #7c3aed); border-color: transparent; color: #fff;
  animation: v-pulse 1.4s infinite;
}
@keyframes v-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225,29,72,0.45); }
  50%       { box-shadow: 0 0 0 8px rgba(225,29,72,0); }
}
body.theme-night .urbix-voice-btn { background: rgba(22,34,62,0.80); border-color: rgba(255,255,255,0.09); color: #94a3b8; }

/* ================================================================
   SWITCH TOGGLE
   ================================================================ */
input:checked + .slider {
  background: linear-gradient(135deg, #e11d48, #7c3aed);
  box-shadow: 0 2px 10px rgba(225,29,72,0.24);
}

/* ================================================================
   POPUP ACTION BUTTONS (used in map popups)
   ================================================================ */
.popup-action-btn.primary {
  background: linear-gradient(135deg, #e11d48, #7c3aed);
  color: #fff; border: none; font-weight: 900;
  border-radius: 14px; cursor: pointer;
  box-shadow: 0 8px 22px rgba(225,29,72,0.26);
  transition: transform 0.18s, box-shadow 0.18s;
}
.popup-action-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(225,29,72,0.36); }
.popup-action-btn, .popup-btn { cursor: pointer; border-radius: 14px; font-weight: 900; transition: transform 0.18s; }
.popup-btn { background: rgba(248,250,252,0.97); border: 1px solid rgba(15,23,42,0.08); color: #111827; }
.popup-btn:hover { transform: translateY(-1px); }
body.theme-night .popup-btn { background: rgba(22,34,62,0.88); border-color: rgba(255,255,255,0.09); color: #e2e8f0; }

/* ================================================================
   ALERT PICKER
   ================================================================ */
.alert-picker-sheet {
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -14px 48px rgba(15,23,42,0.16);
}
.alert-picker-item {
  border-radius: 16px; font-weight: 900;
  transition: transform 0.18s, box-shadow 0.18s;
}
.alert-picker-item:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 26px rgba(15,23,42,0.10); }

/* ================================================================
   SCAN DOT
   ================================================================ */
.scan-dot {
  background: radial-gradient(circle, #10b981, #059669);
  animation: s-pulse 1.8s infinite;
}
@keyframes s-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.50); }
  60%  { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ================================================================
   SCANNER PANEL — Modern redesign
   ================================================================ */
.scanning-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(5,150,105,.06));
  border-bottom: 1px solid rgba(16,185,129,.14);
}
body.theme-night .scanning-status {
  background: linear-gradient(135deg, rgba(16,185,129,.10), rgba(5,150,105,.08));
  border-bottom-color: rgba(16,185,129,.18);
}
/* Pulse icon wrapper with rings */
.scanner-pulse-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scanner-pulse-wrap .scan-dot {
  position: relative;
  z-index: 2;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.scanner-ring-1, .scanner-ring-2 {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(16,185,129,.35);
  animation: scanner-ring 2.2s ease-out infinite;
}
.scanner-ring-1 { width: 24px; height: 24px; animation-delay: 0s; }
.scanner-ring-2 { width: 32px; height: 32px; animation-delay: 0.7s; }
@keyframes scanner-ring {
  0%   { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}
.scanner-text-col {
  flex: 1;
  min-width: 0;
}
.scanner-label {
  font-weight: 900;
  font-size: 0.88rem;
  color: #065f46;
  letter-spacing: .01em;
  line-height: 1.2;
}
body.theme-night .scanner-label {
  color: #6ee7b7;
}
.scan-status-text {
  font-size: 0.76rem;
  color: rgba(6,95,70,.72);
  margin-top: 2px;
  line-height: 1.3;
}
body.theme-night .scan-status-text {
  color: rgba(110,231,183,.65);
}
.proximity-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.proximity-tool-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(16,185,129,.22);
  background: rgba(255,255,255,.92);
  color: #065f46;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.proximity-tool-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(16,185,129,.20);
}
body.theme-night .proximity-tool-btn {
  background: rgba(15,23,42,.72);
  border-color: rgba(16,185,129,.22);
  color: #6ee7b7;
}
.proximity-header {
  padding: 10px 14px 4px;
  font-weight: 900;
  font-size: 0.84rem;
  color: #111827;
  letter-spacing: .02em;
  text-transform: none;
}
body.theme-night .proximity-header {
  color: #f1f5f9;
}

/* ================================================================
   DIRECTIONS PANEL — Waze-style redesign
   ================================================================ */
.directions-panel-ref {
  border-radius: 24px;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 20px 60px rgba(15,23,42,.18), 0 6px 18px rgba(15,23,42,.10);
}
body.theme-night .directions-panel-ref {
  background: rgba(15,23,42,0.98);
  border-color: rgba(255,255,255,.08);
}
.ref-header {
  padding: 10px 10px 8px;
  background: linear-gradient(135deg, rgba(124,58,237,.06), rgba(225,29,72,.04));
  border-bottom: 1px solid rgba(15,23,42,.06);
}
body.theme-night .ref-header {
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(225,29,72,.08));
  border-bottom-color: rgba(255,255,255,.06);
}
.ref-title {
  font-weight: 900;
  font-size: 0.94rem;
  color: #111827;
  flex: 1;
  text-align: center;
}
body.theme-night .ref-title {
  color: #f1f5f9;
}
/* Mode buttons redesign */
.ref-mode-row {
  display: flex;
  gap: 4px;
  background: rgba(15,23,42,.06);
  border-radius: 14px;
  padding: 3px;
}
body.theme-night .ref-mode-row {
  background: rgba(255,255,255,.07);
}
.ref-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  border-radius: 11px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.ref-mode-btn.active {
  background: linear-gradient(135deg, #7c3aed, #e11d48);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124,58,237,.30);
}
body.theme-night .ref-mode-btn {
  color: #64748b;
}
body.theme-night .ref-mode-btn.active {
  color: #fff;
}
/* Input containers redesign */
.ref-inputs {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.ref-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(248,250,255,.96);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 16px;
  padding: 10px 12px;
  transition: border-color .16s, box-shadow .16s;
}
.ref-input-container:focus-within {
  border-color: rgba(124,58,237,.40);
  box-shadow: 0 0 0 3px rgba(124,58,237,.08);
}
body.theme-night .ref-input-container {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.10);
}
.ref-input-container input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.94rem;
  color: #111827;
  font-family: inherit;
  font-weight: 600;
}
.ref-input-container input:focus { outline: none; }
.ref-input-container input::placeholder { color: rgba(107,114,128,.65); font-weight: 500; }
body.theme-night .ref-input-container input { color: #f1f5f9; }
body.theme-night .ref-input-container input::placeholder { color: rgba(148,163,184,.55); }
.ref-icon-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ref-icon-dot.origin {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.20);
}
.ref-icon-dot.destination {
  background: linear-gradient(135deg, #e11d48, #7c3aed);
  box-shadow: 0 0 0 3px rgba(225,29,72,.18);
}
.ref-search-icon {
  color: rgba(107,114,128,.55);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
body.theme-night .ref-search-icon { color: rgba(148,163,184,.45); }
.ref-fav-btn {
  background: none;
  border: none;
  color: rgba(107,114,128,.55);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color .15s;
}
.ref-fav-btn:hover { color: #e11d48; }
.ref-swap-btn {
  align-self: center;
  margin: -4px 0;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.92);
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: transform .15s, box-shadow .15s;
  align-self: flex-end;
  margin-left: auto;
  margin-right: 8px;
  margin-bottom: -2px;
}
.ref-swap-btn:hover { transform: rotate(180deg); box-shadow: 0 4px 12px rgba(15,23,42,.10); }
body.theme-night .ref-swap-btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); color: #94a3b8; }
/* Route options as pills */
.ref-route-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 8px;
}
.route-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(248,250,255,.96);
  color: #374151;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.route-pill.active {
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(225,29,72,.08));
  border-color: rgba(124,58,237,.30);
  color: #7c3aed;
}
body.theme-night .route-pill { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); color: #94a3b8; }
body.theme-night .route-pill.active { background: rgba(124,58,237,.20); border-color: rgba(124,58,237,.35); color: #a78bfa; }
/* Footer actions */
.ref-footer {
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(15,23,42,.06);
  background: transparent;
}
body.theme-night .ref-footer { border-top-color: rgba(255,255,255,.06); }
.ref-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ref-time-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(248,250,255,.96);
  color: #374151;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.ref-time-select:hover { background: rgba(255,255,255,.99); }
body.theme-night .ref-time-select { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); color: #94a3b8; }
/* Actions row */
.ref-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ref-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(248,250,255,.96);
  color: #374151;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s, box-shadow .16s, background .16s;
  white-space: nowrap;
}
.ref-action-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15,23,42,.10); }
.ref-action-btn.primary {
  flex: 1;
  background: linear-gradient(135deg, #7c3aed, #e11d48);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(124,58,237,.28);
  font-size: 0.92rem;
}
.ref-action-btn.primary:hover {
  box-shadow: 0 14px 36px rgba(124,58,237,.36);
  transform: translateY(-2px);
}
body.theme-night .ref-action-btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); color: #94a3b8; }
/* Close and min buttons */
.ref-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(248,250,255,.96);
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .15s;
}
.ref-close-btn:hover { transform: scale(1.06); }
body.theme-night .ref-close-btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); color: #94a3b8; }
.ref-min-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(248,250,255,.96);
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-weight: 900;
  transition: transform .15s;
}
.ref-min-btn:hover { transform: scale(1.06); }
body.theme-night .ref-min-btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); color: #94a3b8; }
/* Directions results */
.directions-results {
  padding: 0 12px 10px;
  font-size: 0.84rem;
  color: #374151;
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
}
body.theme-night .directions-results { color: #94a3b8; }
/* Route summary */
.ref-route-summary {
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,58,237,.08), rgba(225,29,72,.05));
  border: 1px solid rgba(124,58,237,.14);
  font-size: 0.88rem;
  color: #374151;
  font-weight: 700;
}
body.theme-night .ref-route-summary { background: rgba(124,58,237,.12); border-color: rgba(124,58,237,.20); color: #c4b5fd; }

/* ================================================================
   NAV HUD — Enhanced navigation overlay
   ================================================================ */
.nav-hud-maneuver {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed, #e11d48);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(124,58,237,.36);
}
.nav-hud-instruction {
  font-weight: 900;
  font-size: 1.02rem;
  color: #111827;
  line-height: 1.3;
}
body.theme-night .nav-hud-instruction { color: #f1f5f9; }
.nav-hud-sub {
  font-size: 0.82rem;
  color: rgba(107,114,128,.78);
  margin-top: 2px;
}
body.theme-night .nav-hud-sub { color: rgba(148,163,184,.65); }
.nav-hud-speed {
  font-weight: 900;
  font-size: 1.1rem;
  color: #111827;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(248,250,255,.96);
  border: 1px solid rgba(15,23,42,.10);
  min-width: 64px;
  text-align: center;
}
body.theme-night .nav-hud-speed { background: rgba(255,255,255,.07); color: #f1f5f9; border-color: rgba(255,255,255,.10); }
.nav-hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.94);
  color: #374151;
  font-size: 0.80rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.nav-hud-pill:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15,23,42,.10); }
body.theme-night .nav-hud-pill { background: rgba(255,255,255,.08); color: #94a3b8; border-color: rgba(255,255,255,.10); }
/* NAV bottom bar */
.nav-bottom-bar {
  background: rgba(255,255,255,.98);
  border-top: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 -10px 36px rgba(15,23,42,.12);
}
body.theme-night .nav-bottom-bar { background: rgba(15,23,42,.98); border-top-color: rgba(255,255,255,.08); }
.nav-bottom-eta {
  font-weight: 900;
  font-size: 2rem;
  color: #111827;
  line-height: 1;
}
body.theme-night .nav-bottom-eta { color: #f1f5f9; }
.nav-bottom-eta-label {
  font-size: 0.78rem;
  color: rgba(107,114,128,.72);
  font-weight: 700;
}
body.theme-night .nav-bottom-eta-label { color: rgba(148,163,184,.65); }
.nav-bottom-dist, .nav-bottom-arrive {
  font-size: 0.9rem;
  font-weight: 800;
  color: #374151;
}
body.theme-night .nav-bottom-dist, body.theme-night .nav-bottom-arrive { color: #94a3b8; }
.nav-bottom-stop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.24);
  color: #ef4444;
  font-weight: 900;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background .16s, transform .16s;
}
.nav-bottom-stop:hover { background: rgba(239,68,68,.16); transform: scale(1.02); }
body.theme-night .nav-bottom-stop { background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.28); color: #f87171; }

/* ─── AERIAL VIEW — Hero video integration ─── */
.company-hero {
  cursor: pointer;
  transition: filter .2s ease;
}
.company-hero:hover { filter: brightness(1.06); }
.company-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: none;
  opacity: 0;
  transition: opacity .6s ease;
  z-index: 1;
}
.company-hero-video.loaded {
  display: block;
  opacity: 1;
}
/* Overlay gradient so text above hero is readable */
.company-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(0,0,0,.10) 0%, rgba(0,0,0,.35) 100%);
  z-index: 2;
  pointer-events: none;
}
/* Live badge */
.aerial-live-pill {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.20);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  z-index: 3;
  pointer-events: none;
  letter-spacing: .02em;
}
.aerial-live-pill.show { display: flex; }
.aerial-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.5);
  animation: aerialDotPulse 1.8s infinite ease-in-out;
}
@keyframes aerialDotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  50%       { box-shadow: 0 0 0 6px rgba(34,197,94,.0); }
}
/* Aerial view button style */
.company-btn.aerial {
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(225,29,72,.08)) !important;
  border-color: rgba(124,58,237,.30) !important;
  color: #7c3aed !important;
}
.company-btn.aerial:hover {
  background: linear-gradient(135deg, rgba(124,58,237,.20), rgba(225,29,72,.14)) !important;
  transform: translateY(-2px) !important;
}
body.theme-night .company-btn.aerial {
  color: #c4b5fd !important;
}

/* ─── NAVIGATION PANEL REDESIGN — Waze-like bottom sheet ─── */

/* Drag handle */
.ref-drag-handle {
  width: 48px; height: 5px;
  border-radius: 999px;
  background: rgba(15,23,42,.16);
  margin: 14px auto 4px;
  flex-shrink: 0;
}
body.theme-night .ref-drag-handle { background: rgba(255,255,255,.20); }

/* Voice CTA banner */
.ref-voice-cta {
  padding: 0 16px 12px;
  flex-shrink: 0;
}
.ref-voice-cta-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(225,29,72,.08));
  border: 1.5px solid rgba(124,58,237,.28);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  text-align: left;
}
.ref-voice-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(124,58,237,.18);
  background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(225,29,72,.12));
}
.ref-voice-cta-btn.active {
  background: linear-gradient(135deg, rgba(124,58,237,.24), rgba(225,29,72,.16));
  border-color: #7c3aed;
  animation: voicePulse 1.4s infinite ease-in-out;
}
body.theme-night .ref-voice-cta-btn {
  background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(225,29,72,.12));
  border-color: rgba(124,58,237,.40);
}
.ref-voice-cta-icon {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed, #e11d48);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(124,58,237,.30);
}
.ref-voice-cta-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.ref-voice-cta-title {
  font-weight: 900; font-size: 0.95rem;
  color: #7c3aed; line-height: 1.2;
}
body.theme-night .ref-voice-cta-title { color: #c4b5fd; }
.ref-voice-cta-sub {
  font-size: 0.76rem; font-weight: 600;
  color: rgba(107,114,128,.80); line-height: 1.3;
}
body.theme-night .ref-voice-cta-sub { color: rgba(148,163,184,.70); }
.ref-voice-cta-arrow {
  font-size: 1.4rem; font-weight: 900;
  color: rgba(124,58,237,.60);
  flex-shrink: 0; line-height: 1;
}

/* Mic button inside destination input */
.ref-dest-voice {
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(124,58,237,.28) !important;
}
.ref-dest-voice:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 6px 18px rgba(124,58,237,.38) !important;
}
.ref-dest-voice.listening {
  animation: voicePulse 1s infinite ease-in-out;
  background: linear-gradient(135deg, #e11d48, #7c3aed) !important;
}

@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,.40); }
  50%       { box-shadow: 0 0 0 8px rgba(124,58,237,.0); }
}

/* Shake animation for empty destination input */
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.shake-error {
  animation: shakeError .5s ease !important;
  border-color: #e11d48 !important;
  box-shadow: 0 0 0 3px rgba(225,29,72,.20) !important;
}

/* ================================================================
   COMPANY REGISTRATION STEPPER
   4-step wizard: Cuenta → Negocio → Detalles → Plan
   ================================================================ */

/* Step progress bar */
.reg-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 4px 0 16px;
}
.reg-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.rs-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.80rem;
  font-weight: 800;
  background: rgba(15,23,42,.08);
  color: rgba(15,23,42,.40);
  transition: background .15s, color .15s;
}
.rs-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(15,23,42,.35);
  transition: color .15s;
  white-space: nowrap;
}
.reg-step-active .rs-num {
  background: linear-gradient(135deg, #e11d48, #7c3aed);
  color: #fff;
}
.reg-step-active .rs-lbl { color: #7c3aed; }
.reg-step-done .rs-num {
  background: rgba(124,58,237,.12);
  color: #7c3aed;
}
.reg-step-done .rs-num::after { content: '✓'; }
.reg-step-done .rs-lbl { color: #7c3aed; }
/* Connecting lines between steps */
.rs-line {
  flex: 1 1 auto;
  min-width: 24px;
  max-width: 40px;
  height: 2px;
  background: rgba(15,23,42,.10);
  margin-bottom: 22px;
  border-radius: 2px;
}
body.theme-night .rs-num { background: rgba(255,255,255,.10); color: rgba(255,255,255,.35); }
body.theme-night .rs-lbl { color: rgba(255,255,255,.30); }
body.theme-night .rs-line { background: rgba(255,255,255,.10); }
body.theme-night .reg-step-done .rs-num { background: rgba(124,58,237,.22); color: #c4b5fd; }
body.theme-night .reg-step-done .rs-lbl { color: #c4b5fd; }
body.theme-night .reg-step-active .rs-lbl { color: #c4b5fd; }

/* Step pane */
.reg-pane {
  animation: regPaneIn .18s ease forwards;
}
@keyframes regPaneIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Pane navigation row */
.reg-pane-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 4px;
  margin-top: 8px;
  border-top: 1px solid rgba(15,23,42,.07);
}
body.theme-night .reg-pane-nav { border-top-color: rgba(255,255,255,.07); }

.reg-pane-next,
.reg-pane-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .10s ease;
}
.reg-pane-next {
  background: linear-gradient(135deg, #e11d48, #7c3aed);
  color: #fff;
  border: none;
  box-shadow: none;
}
.reg-pane-next:hover { filter: brightness(1.06); }
.reg-pane-back {
  background: transparent;
  color: rgba(15,23,42,.55);
  border: 1px solid rgba(15,23,42,.10);
}
.reg-pane-back:hover { background: rgba(15,23,42,.05); }
body.theme-night .reg-pane-back {
  color: rgba(248,250,252,.50);
  border-color: rgba(255,255,255,.10);
}
body.theme-night .reg-pane-back:hover { background: rgba(255,255,255,.05); }
