/* ═══════════════════════════════════════════════════════════════
   Phase B1 — auth + saved searches CSS
   Spec: _research/Phase_B1_Auth_Saved_Searches_Alerts_Design_Spec_2026-05-18.md
   Decision L2 — new external stylesheet (lowers Convention #91 trap
   surface vs. adding to LISTING_PAGE_CSS / INDEX_PAGE_CSS).

   Surfaces this stylesheet powers:
     1. pages/account.html — dashboard chrome (sign-in wall +
        signed-in state + saved searches list + sign-out)
     2. js/saved-search.js — "Save this search" modal +
        in-page toast confirmations
     3. js/auth.js — top-right floating sign-in/account badge

   Design language: matches the existing dark theme used across
   listing-detail + /listings/discover/ + /listings/sold/.
   Royal LePage red #EA002A as primary accent.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Top-right floating auth badge ─────────────────────────── */
/* RETIRED 2026-05-24 — Mike-reported overlap with static-header
   phone pill + Free Evaluation CTA at all viewport widths. The
   static header already renders sign-in/account via the inline
   .nav-auth-link injected by saved-search.js renderNavAuthLink()
   into .nav-main-links — making this floating badge redundant.
   Hidden with `display: none !important` instead of removed so
   the js/auth.js DOM still mounts cleanly (Convention #74 fail-
   safe: keep the DOM hook in place, just suppress the visual). */
.tnr-auth-badge {
  display: none !important;
}
@media print { .tnr-auth-badge { display: none !important; } }

/* ─── Sign-in modal (used by auth badge + save-search prompt) ─ */
.tnr-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: tnr-fade-in .15s;
}
@keyframes tnr-fade-in { from { opacity: 0 } to { opacity: 1 } }
.tnr-modal {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  max-width: 460px;
  width: 100%;
  padding: 32px 28px;
  color: #f5f5f5;
  font-family: Raleway, sans-serif;
  position: relative;
}
.tnr-modal-close {
  position: absolute; top: 12px; right: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: #888;
  font-size: 20px;
  width: 32px; height: 32px;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
}
.tnr-modal-close:hover { color: #f5f5f5; border-color: #2a2a2a; }
.tnr-modal h2 {
  margin: 0 0 8px;
  font: 700 22px/1.2 Raleway, sans-serif;
  color: #fff;
}
.tnr-modal p {
  margin: 0 0 18px;
  font-size: 14px;
  color: #b8b8b8;
  line-height: 1.5;
}
.tnr-modal label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 6px;
}
.tnr-modal input[type="email"],
.tnr-modal input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
}
.tnr-modal input:focus { outline: 2px solid #EA002A; outline-offset: 1px; }
.tnr-modal-submit {
  margin-top: 18px;
  width: 100%;
  padding: 14px 20px;
  background: #EA002A;
  color: #fff;
  border: 0;
  border-radius: 4px;
  font: 700 15px/1 Raleway, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background .15s;
}
.tnr-modal-submit:hover:not(:disabled) { background: #c5001f; }
.tnr-modal-submit:disabled { background: #444; cursor: not-allowed; opacity: 0.7; }
.tnr-modal-error {
  margin-top: 10px;
  color: #ff6679;
  font-size: 13px;
  min-height: 1.2em;
}
.tnr-modal-fineprint {
  margin: 16px 0 0;
  font-size: 12px;
  color: #777;
  line-height: 1.5;
}
.tnr-modal-success {
  text-align: center;
  padding: 8px 0;
}
.tnr-modal-success-icon {
  font-size: 36px;
  color: #EA002A;
  margin-bottom: 10px;
}

/* ─── Toast (post-action confirmation) ────────────────────────── */
.tnr-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  border: 1px solid #EA002A;
  color: #fff;
  padding: 14px 22px;
  border-radius: 6px;
  font: 600 14px/1 Raleway, sans-serif;
  z-index: 1100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: tnr-toast-in .2s, tnr-toast-out .25s 3.5s forwards;
  max-width: 90vw;
}
@keyframes tnr-toast-in {
  from { transform: translate(-50%, 20px); opacity: 0 }
  to   { transform: translate(-50%, 0);    opacity: 1 }
}
@keyframes tnr-toast-out {
  from { opacity: 1; transform: translate(-50%, 0) }
  to   { opacity: 0; transform: translate(-50%, 20px) }
}

/* ─── /listings/discover/ + /listings/ "Save this search" button ─ */
.ldisc-save-search {
  appearance: none;
  background: #EA002A;
  color: #fff;
  border: 0;
  padding: 10px 16px;
  border-radius: 4px;
  font: 700 13px/1 Raleway, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.ldisc-save-search:hover:not(:disabled) { background: #c5001f; }
.ldisc-save-search:disabled {
  background: #2a2a2a;
  color: #777;
  cursor: not-allowed;
}
.ldisc-save-search-icon {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 6px;
}

/* ─── pages/account.html dashboard chrome ─────────────────────── */
.acc-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 80px 24px 120px;
  color: #f0f0f0;
  font-family: Raleway, sans-serif;
}
.acc-hero {
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid #2a2a2a;
}
.acc-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888;
  margin: 0 0 8px;
}
.acc-hero h1 {
  margin: 0 0 8px;
  font: 700 36px/1.15 Raleway, sans-serif;
  color: #fff;
}
.acc-hero-sub {
  color: #b8b8b8;
  font-size: 16px;
  margin: 0;
}
.acc-email {
  color: #fff;
  font-weight: 600;
}

/* Signed-out wall */
.acc-locked {
  text-align: center;
  padding: 48px 24px;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  max-width: 520px;
  margin: 48px auto;
}
.acc-locked h2 {
  margin: 0 0 12px;
  font: 700 24px/1.2 Raleway, sans-serif;
  color: #fff;
}
.acc-locked p {
  color: #b8b8b8;
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 24px;
}
.acc-locked-cta {
  display: inline-block;
  background: #EA002A;
  color: #fff;
  padding: 14px 28px;
  border: 0;
  border-radius: 4px;
  font: 700 14px/1 Raleway, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
}
.acc-locked-cta:hover { background: #c5001f; }

/* Section */
.acc-section {
  margin-bottom: 48px;
}
.acc-section h2 {
  font: 700 22px/1.2 Raleway, sans-serif;
  color: #fff;
  margin: 0 0 6px;
}
.acc-section-sub {
  color: #888;
  font-size: 13px;
  margin: 0 0 20px;
}
.acc-section-empty {
  padding: 32px 24px;
  background: #0d0d0d;
  border: 1px dashed #2a2a2a;
  border-radius: 6px;
  text-align: center;
  color: #888;
  font-size: 14px;
  line-height: 1.6;
}

/* Saved search list card */
.acc-ss-list {
  display: grid;
  gap: 12px;
}
.acc-ss-card {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 24px;
  align-items: start;
}
.acc-ss-card-name {
  font: 700 16px/1.3 Raleway, sans-serif;
  color: #fff;
  margin: 0 0 4px;
}
.acc-ss-card-criteria {
  font-size: 13px;
  color: #888;
  margin: 0;
  line-height: 1.5;
}
.acc-ss-card-meta {
  font-size: 11px;
  color: #555;
  margin: 4px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.acc-ss-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.acc-ss-action {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #f0f0f0;
  padding: 8px 14px;
  border-radius: 4px;
  font: 600 12px/1 Raleway, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.acc-ss-action:hover { background: #1a1a1a; border-color: #404040; }
.acc-ss-action--primary {
  background: #EA002A;
  border-color: #EA002A;
}
.acc-ss-action--primary:hover { background: #c5001f; border-color: #c5001f; }
.acc-ss-action--danger { color: #ff6679; border-color: #4a1a22; }
.acc-ss-action--danger:hover { background: #2a0d12; border-color: #ff6679; }
@media (max-width: 600px) {
  .acc-ss-card { grid-template-columns: 1fr; }
  .acc-ss-card-actions { flex-wrap: wrap; }
}

/* Footer actions: sign out + delete account */
.acc-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 32px;
  border-top: 1px solid #2a2a2a;
  flex-wrap: wrap;
}
.acc-signout {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #f0f0f0;
  padding: 10px 20px;
  border-radius: 4px;
  font: 600 13px/1 Raleway, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.acc-signout:hover { background: #1a1a1a; border-color: #404040; }
.acc-delete {
  background: transparent;
  border: 1px solid #4a1a22;
  color: #ff6679;
  padding: 10px 20px;
  border-radius: 4px;
  font: 600 12px/1 Raleway, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.acc-delete:hover { background: #2a0d12; }

/* ─────────────────────────────────────────────────────────────────────
   Tier 1.5 fix 2026-05-19 — top-nav Sign in / My Account link
   .nav-auth-link is injected by saved-search.js renderNavAuthLink()
   as the rightmost <li> on .nav-main-links.

   Overlap fix 2026-05-24 (Mike caught on Avalon — Account pill was
   covering the .nav-phone-pill button on mid-width viewports). The
   phone CTA + Free-Eval button live OUTSIDE .nav-main-links as
   .nav-cta-outline + .nav-phone-pill siblings to the UL. When the
   Account pill renders as a wide pill with text + avatar, it pushes
   against the phone-pill button and visually overlaps. Fix: pin the
   auth link to a compact rendering (avatar + minimal text) and add
   margin-right buffer so it can't touch the phone pill.
   ───────────────────────────────────────────────────────────────────── */
.nav-main-links > li.nav-auth-link {
  /* Margin-right buffer so the auth link can't visually touch the
     adjacent .nav-cta-outline / .nav-phone-pill buttons that sit
     OUTSIDE .nav-main-links in the nav-main-bar flex row. */
  margin-right: 12px;
}
.nav-main-links > li.nav-auth-link > a {
  color: rgba(255,255,255,0.85);
  border-left: 1px solid rgba(255,255,255,0.1);
  margin-left: 4px;
  /* Tighten padding so the pill doesn't grow wider than the typography
     of the surrounding nav items. */
  padding: 6px 10px;
  white-space: nowrap;
}
.nav-main-links > li.nav-auth-link > a:hover { color: #EA002A; }
.nav-main-links > li.nav-auth-link--signed-in > a {
  color: #EA002A;
}
.nav-main-links > li.nav-auth-link--signed-in > a:hover {
  color: #fff;
}
/* Constrain the pill's stacking so it can never appear visually
   above the phone-pill / Free-Eval buttons even if z-index races
   happen during scroll-into-view. Sits behind nav siblings. */
.nav-main-links > li.nav-auth-link,
.nav-main-links > li.nav-auth-link > a,
.nav-main-links > li.nav-auth-link > a > * {
  position: relative;
  z-index: 0;
}
.nav-cta-outline,
.nav-phone-pill {
  position: relative;
  z-index: 1;
}
@media (max-width:1280px) {
  /* Mid-width range where the Account pill is most likely to collide
     with the phone button. Hide the "Account" text label, keep just
     the M-avatar circle so the pill compresses to ~32px width. */
  .nav-main-links > li.nav-auth-link--signed-in > a > span:last-child {
    display: none;
  }
  .nav-main-links > li.nav-auth-link > a {
    padding: 4px 6px;
    margin-left: 8px;
  }
}
@media (max-width:1024px) {
  .nav-main-links > li.nav-auth-link > a {
    border-left: none;
    margin-left: 0;
  }
  .nav-main-links > li.nav-auth-link {
    margin-right: 0;
  }
}
