/* ============================================================================
 * Dibze GLOBAL site stylesheet — loaded on EVERY page by layouts/shell.php (and
 * the legacy layouts/base.php). Owns the ONE unified site header
 * (partials/header.php). Self-contained: literal colors + its own `site-hd`
 * namespace, so it never depends on or collides with a page's own stylesheet.
 * Behaviour lives in the global /assets/js/app.js.
 * ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* Lock the page frame from browser zoom (Revisions 6/10 v9): "the outside frame
   shouldn't zoom in… even the landing page… by double tapping." touch-action on
   the root disables double-tap-to-zoom on EVERY page, cross-browser incl. iOS
   Safari. The Leaflet map sets its own touch-action:none on .leaflet-container,
   so pinch/zoom INSIDE the map still works; only the page frame is locked.
   (iOS pinch-zoom of the frame is additionally blocked in app.js via gesturestart.) */
html { touch-action: manipulation; }

/* App-like text behaviour (Revisions 6/13): the UI chrome isn't selectable, so
   clicking words doesn't highlight them or flip the cursor to the I-beam ("type")
   — including the amenity-filter labels. The iOS long-press callout is off too.
   Form fields stay fully selectable + editable. */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, select, [contenteditable], [contenteditable] * {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

/* ── Unified site header ──────────────────────────────────────────────────── */
.site-hd {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid #E7E7EE;
  font-family: Inter, system-ui, -apple-system, sans-serif;
}
.site-hd-row {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-hd-left { display: flex; align-items: center; gap: 16px; min-width: 0; }

/* Logo */
.site-hd-logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.site-hd-bullseye {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid #6B4FE6; display: grid; place-items: center; flex: none;
}
.site-hd-dot { width: 10px; height: 10px; background: #6B4FE6; border-radius: 50%; }
.site-hd-word { font-weight: 700; font-size: 23px; letter-spacing: -0.04em; color: #1A1A1F; }

/* Context label */
.site-hd-divider { width: 1px; height: 24px; background: #E7E7EE; flex: none; }
.site-hd-context { font-size: 14.5px; font-weight: 600; color: #3A3A42; white-space: nowrap; }

/* For Rent / For Sale toggle */
.site-hd-seg { display: inline-flex; background: #F2F2F5; border-radius: 999px; padding: 4px; gap: 2px; flex: none; }
.site-hd-seg button {
  border: 0; background: transparent; cursor: pointer; font: inherit;
  padding: 7px 18px; font-size: 14px; font-weight: 600; color: #6B6B76;
  border-radius: 999px; white-space: nowrap; transition: background 0.12s, color 0.12s;
}
.site-hd-seg button:hover:not(.is-on) { color: #1A1A1F; }
.site-hd-seg button.is-on { background: #1A1A1F; color: #fff; box-shadow: 0 1px 2px rgba(15, 15, 20, 0.18); }
.site-hd-seg button:focus-visible { outline: 2px solid #A99BF1; outline-offset: 2px; }

/* Right-side nav */
.site-hd-nav { display: flex; align-items: center; gap: 6px; }
.site-hd-nav a:not(.site-hd-btn) {
  padding: 8px 12px; font-weight: 500; font-size: 14.5px; color: #3A3A42; border-radius: 8px; text-decoration: none;
}
.site-hd-nav a:not(.site-hd-btn):hover { color: #1A1A1F; background: #F8F8FB; }
.site-hd-nav a.is-current { color: #6B4FE6; }

/* Buttons */
.site-hd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; font-size: 14px; font-weight: 600; border-radius: 999px;
  border: 0; cursor: pointer; text-decoration: none; font-family: inherit;
}
.site-hd-btn-dark { background: #1A1A1F; color: #fff; }
.site-hd-btn-dark:hover { background: #000; box-shadow: 0 2px 6px rgba(15, 15, 20, 0.07), 0 18px 44px rgba(15, 15, 20, 0.14); }

/* Sign In / Sign Up (logged out) */
.site-hd-signin {
  background: #fff; border: 1px solid #E5E5EB; border-radius: 999px;
  padding: 9px 18px; font-size: 14px; font-weight: 500; color: #1A1A1F; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}
.site-hd-signin:hover { border-color: #A99BF1; color: #4B30C0; box-shadow: 0 1px 2px rgba(15, 15, 20, 0.05), 0 8px 24px rgba(15, 15, 20, 0.07); }

/* Auth slot — keeps the signed-in cluster (Saved + user chip) on ONE line.
   Without this the slot is a plain inline span and the block user-wrap drops
   below the Saved button (the logged-in-only "jumble"). */
.site-hd-auth { display: inline-flex; align-items: center; gap: 6px; }

/* Saved (logged in) */
.site-hd-link {
  display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0;
  font-family: inherit; font-size: 14px; font-weight: 500; color: #2D2D35; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  text-decoration: none;
}
.site-hd-link:hover { background: #F8F8FB; color: #0F0F14; }
.site-hd-saved-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 6px;
  background: #6B4FE6; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 600;
}

/* User chip + dropdown (logged in) */
.site-hd-user-wrap { position: relative; }
.site-hd-user {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px;
  border: 1px solid #E5E5EB; border-radius: 999px; background: #fff; cursor: pointer;
  font-size: 14px; font-weight: 500; color: #1A1A1F; font-family: inherit;
}
.site-hd-user:hover { box-shadow: 0 1px 2px rgba(15, 15, 20, 0.05), 0 8px 24px rgba(15, 15, 20, 0.07); }
.site-hd-user.is-open { border-color: #A99BF1; background: #F2EEFE; }
.site-hd-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #6B4FE6, #4B30C0); color: #fff;
  font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none;
}
/* Cap a long display name / email so the chip can't overrun the header. */
.site-hd-user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-hd-user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 100; width: 260px;
  background: #fff; border: 1px solid #F2F2F5; border-radius: 14px;
  box-shadow: 0 4px 12px rgba(15, 15, 20, 0.08), 0 16px 40px rgba(15, 15, 20, 0.18); padding: 8px;
}
.site-hd-user-item {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px;
  background: transparent; border: 0; border-radius: 10px; cursor: pointer; text-align: left;
  font-size: 15px; font-weight: 500; color: #0F0F14; text-decoration: none; font-family: inherit;
}
.site-hd-user-item:hover { background: #F8F8FB; }
.site-hd-user-item svg { color: #2D2D35; flex-shrink: 0; }
.site-hd-user-item:last-child:hover { color: #4B30C0; }
.site-hd-user-item:last-child:hover svg { color: #4B30C0; }
.site-hd-user-divider { height: 1px; background: #F2F2F5; margin: 6px 8px; }

/* Mobile burger + dropdown */
.site-hd-burger { display: none; background: none; border: 0; cursor: pointer; color: #1A1A1F; padding: 6px; }

/* ── Site-wide sign-in (OTP) modal ────────────────────────────────────────── */
/* Ported verbatim from the map package's dbz-auth-* (styles.css) — the
   "Welcome to Dibze" AuthModal (Revisions 6/11) — renamed to the global
   site-auth-* namespace with tokens inlined, so it never collides with
   mapset.css's dbz-auth-* (tour modal etc.) on map-package pages. */
.site-auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 15, 20, 0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  animation: site-auth-fade 0.15s ease;
}
@keyframes site-auth-fade { from { opacity: 0; } to { opacity: 1; } }
/* The display:flex above would otherwise defeat the [hidden] attribute (author
   rule beats the UA [hidden]{display:none}), so the modal could never close. */
.site-auth-overlay[hidden] { display: none; }
.site-auth-modal {
  position: relative; width: 460px; max-width: 100%;
  max-height: calc(100vh - 48px); overflow-y: auto;
  background: #fff; border-radius: 18px; padding: 36px 36px 28px;
  box-shadow: 0 20px 80px rgba(15, 15, 20, 0.35);
  animation: site-auth-in 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes site-auth-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.site-auth-x {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: #F2F2F5; color: #2D2D35;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.site-auth-x:hover { background: #E5E5EB; color: #0F0F14; }
.site-auth-logo { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 18px; }
.site-auth-logo svg { width: 36px; height: 36px; }
.site-auth-logo span { font-weight: 700; font-size: 28px; letter-spacing: -0.02em; color: #1a1a1f; }
.site-auth-title { margin: 0 0 6px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: #0F0F14; text-align: center; }
.site-auth-sub { margin: 0 0 28px; font-size: 14px; color: #6B6B75; text-align: center; line-height: 1.5; }
.site-auth-field { display: block; margin-bottom: 14px; }
.site-auth-label { display: block; font-size: 13.5px; font-weight: 600; color: #1A1A1F; margin-bottom: 8px; }
.site-auth-phone {
  display: flex; align-items: center; height: 56px;
  border: 1.5px solid #E5E5EB; border-radius: 12px; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s; overflow: hidden;
}
.site-auth-phone:focus-within { border-color: #6B4FE6; box-shadow: 0 0 0 3px rgba(107, 79, 230, 0.12); }
.site-auth-country {
  display: flex; align-items: center; gap: 5px; height: 100%; padding: 0 12px;
  border: 0; border-right: 1px solid #F2F2F5; background: transparent;
  color: #0F0F14; font-family: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer; flex-shrink: 0;
}
.site-auth-country:hover { background: #F8F8FB; }
.site-auth-flag { width: 20px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 0.5px rgba(0,0,0,0.08); flex-shrink: 0; }
.site-auth-phone input {
  flex: 1; border: 0; background: transparent; outline: 0; height: 100%;
  padding: 0 16px; font: inherit; font-size: 16px; font-weight: 500;
  color: #0F0F14; font-variant-numeric: tabular-nums; min-width: 0;
}
.site-auth-phone input::placeholder { color: #9B9BA5; }
.site-auth-input {
  width: 100%; height: 56px; padding: 0 16px;
  border: 1.5px solid #E5E5EB; border-radius: 12px; background: #fff;
  font: inherit; font-size: 16px; font-weight: 500; color: #0F0F14;
  outline: 0; transition: border-color 0.15s, box-shadow 0.15s;
}
.site-auth-input:focus { border-color: #6B4FE6; box-shadow: 0 0 0 3px rgba(107, 79, 230, 0.12); }
.site-auth-input::placeholder { color: #9B9BA5; }
.site-auth-input-code { font-size: 24px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.site-auth-consent {
  display: flex; align-items: flex-start; gap: 12px; margin: 12px 0 24px;
  font-size: 12.5px; color: #6B6B75; line-height: 1.55; cursor: pointer;
}
.site-auth-check { position: relative; flex-shrink: 0; padding-top: 1px; }
.site-auth-check input { position: absolute; opacity: 0; pointer-events: none; }
.site-auth-check-box {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border: 1.5px solid #C9C9D1; border-radius: 5px;
  background: #fff; color: #fff; transition: background 0.12s, border-color 0.12s;
}
.site-auth-check-box svg { opacity: 0; }
.site-auth-check-box.is-on { background: #6B4FE6; border-color: #6B4FE6; }
.site-auth-check-box.is-on svg { opacity: 1; }
.site-auth-consent-text { flex: 1; min-width: 0; }
.site-auth-consent-text a { color: #1A1A1F; text-decoration: underline; text-underline-offset: 2px; }
.site-auth-consent-text a:hover { color: #4B30C0; }
.site-auth-cta {
  display: block; width: 100%; height: 56px; border: 0; border-radius: 999px;
  background: #6B4FE6; color: #fff; font-family: inherit; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background 0.15s, opacity 0.15s, transform 0.1s;
}
.site-auth-cta:hover { background: #5B3FD6; }
.site-auth-cta:active { transform: scale(0.99); }
.site-auth-cta.is-disabled { background: #A99BF1; cursor: not-allowed; }
.site-auth-cta.is-disabled:hover { background: #A99BF1; }
.site-auth-cta.is-busy { opacity: 0.6; pointer-events: none; }
.site-auth-divider { display: flex; align-items: center; gap: 14px; margin: 20px 0; color: #9B9BA5; font-size: 13px; }
.site-auth-divider::before, .site-auth-divider::after { content: ''; flex: 1; height: 1px; background: #F2F2F5; }
.site-auth-divider span { padding: 0 4px; }
.site-auth-alt {
  display: block; width: 100%; height: 56px;
  border: 1.5px solid #E5E5EB; border-radius: 999px; background: #fff;
  color: #0F0F14; font-family: inherit; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.site-auth-alt:hover { border-color: #9B9BA5; background: #F8F8FB; }
.site-auth-foot { margin: 22px 0 0; font-size: 12px; color: #6B6B75; text-align: center; line-height: 1.55; }
.site-auth-foot a { color: #2D2D35; text-decoration: underline; text-underline-offset: 2px; }
.site-auth-foot a:hover { color: #4B30C0; }
.site-auth-codepara { margin: 0 0 18px; font-size: 14px; color: #4B4B55; line-height: 1.5; text-align: center; }
.site-auth-codepara strong { color: #0F0F14; font-weight: 600; }
.site-auth-back {
  display: block; margin: 16px auto 0; background: transparent; border: 0;
  font-family: inherit; font-size: 14px; color: #4B4B55; cursor: pointer;
  padding: 8px 12px; border-radius: 8px;
}
.site-auth-back:hover { color: #0F0F14; background: #F8F8FB; }
.site-auth-err { margin: 0 0 12px; font-size: 13.5px; font-weight: 500; color: #DC2626; text-align: center; }
.site-auth-link { background: none; border: 0; padding: 0; font: inherit; color: #6B4FE6; font-weight: 600; cursor: pointer; }
.site-auth-link:hover { color: #4B30C0; }
.site-auth-resend { display: block; margin: 10px auto 0; font-size: 13.5px; }
.site-auth-done-check { width: 56px; height: 56px; margin: 4px auto 14px; border-radius: 999px; background: #ECFDF5; color: #10B981; display: grid; place-items: center; }
.site-auth-done-title { margin: 0 0 6px; font-size: 23px; font-weight: 700; letter-spacing: -0.02em; color: #0F0F14; text-align: center; }
[data-auth-stage="done"] { text-align: center; }
@media (max-width: 480px) {
  .site-auth-overlay { padding: 14px; }
  .site-auth-modal { padding: 28px 22px 22px; }
}

@media (max-width: 767px) {
  .site-hd-burger { display: flex; }
  .site-hd-context { display: none; }
  .site-hd-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; border-bottom: 1px solid #E7E7EE; padding: 12px 20px 18px;
    box-shadow: 0 18px 44px rgba(15, 15, 20, 0.14);
  }
  .site-hd.is-open .site-hd-nav { display: flex; }
  .site-hd-nav a:not(.site-hd-btn) { padding: 12px 4px; font-weight: 600; border-bottom: 1px solid #E7E7EE; }
  .site-hd-btn, .site-hd-signin, .site-hd-user, .site-hd-link { width: 100%; margin-top: 8px; justify-content: center; }
  .site-hd-user-menu { width: 100%; }
}

/* Honeypot — an off-screen field every "reach out" form carries. Hidden from
   real users (and assistive tech) but auto-filled by bots; a filled value is
   rejected server-side. Global so any page's form can drop one in. */
.dbz-hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
