/* Shared chrome: header, footer, buttons, pills, cards — copied verbatim
   from the approved mockups so every page looks identical. */

/* header */
.header { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 40; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 40px; max-width: 1520px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 8px; font-family: 'Domine', serif; font-size: 21px; font-weight: 600; color: var(--text); }
.logo svg { width: 26px; height: 26px; color: var(--accent); }
.nav { display: flex; align-items: center; gap: 22px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.iconbtn { width: 36px; height: 36px; border-radius: 999px; display: flex; align-items: center; justify-content: center; color: var(--muted); border: 1px solid var(--border); position: relative; flex-shrink: 0; }
.iconbtn svg { width: 17px; height: 17px; }
.iconbtn.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.iconbtn .dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 999px; background: var(--accent2); }
.langbtn { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 7px 12px; background: var(--surface); position: relative; cursor: pointer; }
.langbtn svg { width: 14px; height: 14px; }
/* Unlike .user-dropdown (always mounted, toggled via an .open class),
   js/app.js inserts/removes .lang-dropdown from the DOM directly on each
   click — so its presence in the DOM IS the open state, no class needed. */
.lang-dropdown { position: absolute; top: calc(100% + 8px); right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 45px -22px var(--shadow); min-width: 170px; padding: 8px; z-index: 50; max-height: 320px; overflow-y: auto; }
.lang-dropdown button { display: block; width: 100%; text-align: left; font-size: 13px; font-weight: 600; color: var(--text); padding: 9px 10px; border-radius: 8px; }
.lang-dropdown button:hover { background: var(--surface-2); }
.lang-dropdown button.active { color: var(--accent); }
/* Footer's lang switcher opens upward — the button sits at the bottom of
   the page, so a downward dropdown would render off-screen/under the fold. */
.lang-dropdown-up { top: auto; bottom: calc(100% + 8px); }
.auth-link { font-size: 13.5px; font-weight: 700; color: var(--text); padding: 8px 6px; }
.btn-accent { background: var(--accent); color: var(--accent-text); font-size: 13.5px; font-weight: 700; padding: 10px 18px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px; }
.user-menu { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px 6px 6px; position: relative; }
.user-avatar { width: 26px; height: 26px; border-radius: 999px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--accent); }
.user-dropdown { position: absolute; top: calc(100% + 8px); right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 45px -22px var(--shadow); min-width: 200px; padding: 8px; display: none; z-index: 50; }
.user-dropdown.open { display: block; }
.user-dropdown a, .user-dropdown button { display: block; width: 100%; text-align: left; font-size: 13px; font-weight: 600; color: var(--text); padding: 9px 10px; border-radius: 8px; }
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--surface-2); }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

/* footer */
.footer { background: var(--surface-2); border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 48px; }
.footer-top { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 36px; border-bottom: 1px solid var(--border); margin-bottom: 32px; flex-wrap: wrap; }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 24px; }
.footer-col-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 14px; }
.footer-link { display: block; font-size: 13.5px; color: var(--text); opacity: .82; padding: 5px 0; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.footer-note { font-size: 11.5px; color: var(--muted); margin-top: 10px; }
@media (max-width: 900px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }

/* generic buttons / pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; font-weight: 700; padding: 11px 20px; border-radius: 11px; border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-outline { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-outline:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 12.5px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.link-btn { font-size: 13.5px; font-weight: 700; color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 11px 22px; display: inline-flex; align-items: center; gap: 8px; }
.link-btn svg { width: 14px; height: 14px; }

.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 9px 14px; white-space: nowrap; background: var(--surface); }
.pill svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.pill.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.badge-tier-top1 { background: var(--accent2); color: #fff; }
.badge-tier-top { background: var(--accent); color: var(--accent-text); }
.badge-tier-homepage { background: oklch(0.4 0.03 255); color: #fff; }
.badge-verified { background: var(--good); color: #fff; }
.badge-status-pending { background: oklch(0.75 0.13 85); color: #26221C; }
.badge-status-approved { background: var(--good); color: #fff; }
.badge-status-rejected { background: var(--bad); color: #fff; }
.badge-status-draft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-status-sold { background: oklch(0.4 0.03 255); color: #fff; }

.toast-region { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600; padding: 12px 18px; border-radius: 10px; box-shadow: 0 12px 28px -10px var(--shadow); max-width: 320px; }
.toast.error { background: var(--bad); color: #fff; }

.empty-state { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty-state svg { width: 44px; height: 44px; opacity: .5; margin-bottom: 14px; }
.empty-state-title { font-family: 'Domine', serif; font-size: 18px; color: var(--text); margin-bottom: 6px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: 10px; }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea { font-family: inherit; font-size: 13.5px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); width: 100%; }
.field textarea { resize: vertical; min-height: 90px; }
.field-error { font-size: 12px; color: var(--bad); font-weight: 600; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* page transitions — see initPageTransitions() in app.js */
html.page-transitions body {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}
html.page-transitions body.page-ready { opacity: 1; transform: translateY(0); }
html.page-transitions body.page-leaving { opacity: 0; transform: translateY(-6px); transition-duration: .15s; }
a, button, .btn, .iconbtn, .pill, .pc-root, .row-root, .pc-iconbtn, .row-fav {
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, opacity .15s ease, transform .15s ease, box-shadow .15s ease;
}
.pc-root:hover, .row-root:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -18px var(--shadow); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a, button, .btn, .iconbtn, .pill, .pc-root, .row-root, .pc-iconbtn, .row-fav { transition: none; }
  .pc-root:hover, .row-root:hover { transform: none; }
}

/* compare — floating bar (app.js renderCompareBar()) + active icon state.
   (Favorite's own "is-fav" red-heart look is already styled in
   property-card.css's own .pc-iconbtn.is-fav/.row-fav.is-fav — not
   redefined here, so it isn't fought over between the two stylesheets.) */
.pc-iconbtn.is-comparing { background: var(--accent); color: var(--accent-text); }
.compare-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%);
  display: flex; align-items: center; gap: 14px;
  background: var(--text); color: var(--bg);
  border-radius: 999px; padding: 12px 14px 12px 20px; box-shadow: 0 20px 45px -18px var(--shadow);
  z-index: 60; transition: transform .25s ease;
}
.compare-bar.open { transform: translate(-50%, 0); }
.compare-bar-count { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.compare-bar-count svg { width: 16px; height: 16px; }
.compare-bar-spacer { width: 1px; }
.compare-bar .btn-outline { background: transparent; border-color: rgba(255,255,255,.3); color: inherit; }
.compare-bar .btn-primary { background: var(--accent); color: var(--accent-text); }
@media (max-width: 640px) { .compare-bar { left: 12px; right: 12px; transform: translateY(140%); width: auto; } .compare-bar.open { transform: translateY(0); } }
