/**
 * TSS Redesign — Login Modal (Variant B: split panel with trust signals)
 *
 * Scoped entirely under .tss-lm-* so it cannot collide with parent theme or
 * design-modernization.css rules. Replaces the ListingPro Sign In popup.
 *
 * Open/close + slide-in animation is driven by js/tss-login-modal.js toggling
 * the .is-open class on .tss-lm-overlay.
 */

.tss-lm-overlay {
  --lm-teal: #14B8A6;
  --lm-teal-deep: #0D9488;
  --lm-navy: #0E2A47;
  --lm-orange: #FF6B3D;
  --lm-orange-h: #F25A2C;
  --lm-ink: #0E2A47;
  --lm-mute: #6B7A8C;
  --lm-line: #E5EAF0;

  position: fixed;
  inset: 0;
  z-index: 100000; /* above sticky header + parent overlays */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 15, 30, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);

  /* hidden by default; JS flips .is-open */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
.tss-lm-overlay * { box-sizing: border-box; }

/* Base icon: stroke from currentColor so every inline SVG inherits the
   surrounding text color (close X, stat icons, field icons, arrows). Without
   this they render fill:none + no stroke = invisible. */
.tss-lm-ic {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  display: block;
}

.tss-lm-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.28s ease, visibility 0s linear 0s;
}

/* ─── Modal shell ─── */
.tss-lm-modal {
  width: 100%;
  max-width: 760px;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5);
  display: grid;
  grid-template-columns: 280px 1fr;
  position: relative;
  max-height: calc(100vh - 48px);

  /* slide-in: start lower + slightly scaled, JS adds .is-open on overlay */
  transform: translateY(32px) scale(0.97);
  opacity: 0;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.04s,
              opacity 0.32s ease 0.04s;
  will-change: transform, opacity;
}
.tss-lm-overlay.is-open .tss-lm-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ─── Close button ─── */
.tss-lm-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lm-ink);
  z-index: 5;
  padding: 0;
  transition: transform 0.18s ease, background 0.18s ease;
}
.tss-lm-close:hover { transform: rotate(90deg); background: #fff; }
.tss-lm-close .tss-lm-ic { width: 18px; height: 18px; }

/* ─── Left: trust panel ─── */
.tss-lm-left {
  position: relative;
  background: linear-gradient(160deg, #0E2A47 0%, #185A6B 60%, #0D9488 100%);
  color: #fff;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.tss-lm-left::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.4;
  pointer-events: none;
}
.tss-lm-left::after {
  content: "";
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--lm-orange);
  opacity: 0.5;
  filter: blur(60px);
  pointer-events: none;
}
.tss-lm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}
.tss-lm-brand-dot {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Specific stroke wins over the base `.tss-lm-ic { stroke: currentColor }`
   rule, which otherwise overrides the inline stroke attribute. */
.tss-lm-brand-dot .tss-lm-ic { width: 16px; height: 16px; stroke-width: 2; stroke: #5EEAD4; }
.tss-lm-brand-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: #fff;
  opacity: 1;
  max-width: 150px;
}
.tss-lm-left-body { position: relative; z-index: 2; }
.tss-lm-left-h {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 12px;
  color: #fff;
}
.tss-lm-left-p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.55;
  margin: 0;
}
.tss-lm-stats {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
.tss-lm-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.tss-lm-stat-ic {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5EEAD4;
  flex-shrink: 0;
}
.tss-lm-stat-ic .tss-lm-ic { width: 16px; height: 16px; }
.tss-lm-stat-text { font-size: 12px; line-height: 1.4; }
.tss-lm-stat-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1px;
}
.tss-lm-stat-text span { color: rgba(255, 255, 255, 0.7); }

/* ─── Right: form area ─── */
.tss-lm-right {
  padding: 40px;
  overflow-y: auto;
}
.tss-lm-h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--lm-navy);
}
.tss-lm-sub {
  color: var(--lm-mute);
  font-size: 14px;
  margin: 6px 0 24px;
}

/* Panes — only one visible at a time (signin / forgot) */
.tss-lm-pane { display: none; }
.tss-lm-pane.is-active { display: block; }

.tss-lm-form { margin: 0; }

/* Status / alert banner — full-width, well-spaced, sits at the top of the
   form. Native handler emits <span class="alert alert-(danger|success|info)">
   with a FontAwesome icon; we override Bootstrap's chip look into a clean
   banner and color by variant. */
.tss-lm-status:empty { display: none; }
.tss-lm-status {
  margin: 0 0 20px;
}
.tss-lm-status .alert {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: none;
  text-align: left;
}
.tss-lm-status .alert i,
.tss-lm-status .alert .fa { font-size: 14px; flex-shrink: 0; }
.tss-lm-status .alert .tss-lm-ic { width: 18px; height: 18px; flex-shrink: 0; }
.tss-lm-status .alert-danger {
  background: #FEF2F2;
  border-color: #FCD9D6;
  color: #C0392B;
}
.tss-lm-status .alert-success {
  background: #ECFDF5;
  border-color: #C7F0DE;
  color: #0D9488;
}
.tss-lm-status .alert-info {
  background: #F1F5F9;
  border-color: var(--lm-line);
  color: var(--lm-mute);
}

.tss-lm-field { margin-bottom: 16px; }
.tss-lm-field > label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--lm-ink);
  margin-bottom: 7px;
}
.tss-lm-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}
.tss-lm-label-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--lm-ink);
}
.tss-lm-forgot-link {
  font-size: 12px;
  color: var(--lm-teal-deep);
  font-weight: 600;
  text-decoration: none;
}
.tss-lm-forgot-link:hover { text-decoration: underline; }

.tss-lm-input { position: relative; }
.tss-lm-input input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  background: #F8FAFC;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--lm-ink);
  outline: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.tss-lm-input input::placeholder { color: #9AA7B5; }
.tss-lm-input input:focus {
  background: #fff;
  border-color: var(--lm-teal);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}
/* password field has a trailing toggle button — pad right */
.tss-lm-input input[type="password"],
.tss-lm-input input.tss-lm-has-toggle { padding-right: 44px; }
.tss-lm-ic-left {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lm-mute);
  pointer-events: none;
}
.tss-lm-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--lm-mute);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.tss-lm-toggle:hover { color: var(--lm-ink); }

/* Primary CTA — orange, matches Variant B */
.tss-lm-btn-primary {
  width: 100%;
  padding: 14px;
  margin-top: 22px;
  background: var(--lm-orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tss-lm-btn-primary,
.tss-lm-btn-primary:hover,
.tss-lm-btn-primary:focus,
.tss-lm-btn-primary:active,
.tss-lm-btn-primary:visited {
  color: #fff;
  text-decoration: none;
  text-shadow: none;
}
.tss-lm-btn-primary:hover {
  background: var(--lm-orange-h);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -10px rgba(255, 107, 61, 0.5);
}
.tss-lm-btn-primary:focus-visible {
  outline: 2px solid var(--lm-navy);
  outline-offset: 2px;
}
/* Keep label + icon stable on hover (no inherited underline/background from
   parent theme button rules). */
.tss-lm-btn-primary span { color: inherit; background: none; }
.tss-lm-btn-primary .tss-lm-ic { width: 16px; height: 16px; stroke: #fff; }

/* reCAPTCHA disclosure — injected after the form by the plugin's honeypot/
   disclosure footer JS. Scope it inside the modal so it reads as a small
   muted footnote under the button instead of overflowing. */
.tss-lm-pane .lpcr-recaptcha-disclosure {
  font-size: 11px;
  line-height: 1.5;
  color: var(--lm-mute);
  text-align: center;
  margin: 14px 0 0;
  padding: 0;
}
.tss-lm-pane .lpcr-recaptcha-disclosure a { color: var(--lm-teal-deep); }

/* Back-to-sign-in link on forgot pane */
.tss-lm-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--lm-teal-deep);
  cursor: pointer;
}
.tss-lm-back:hover { text-decoration: underline; }
.tss-lm-back .tss-lm-ic { width: 15px; height: 15px; }

/* ─── Responsive: collapse to single column, hide trust panel ─── */
@media (max-width: 640px) {
  .tss-lm-overlay { padding: 0; align-items: stretch; }
  .tss-lm-modal {
    grid-template-columns: 1fr;
    max-width: 100%;
    max-height: 100%;
    min-height: 100%;
    border-radius: 0;
    /* slide up from bottom on mobile */
    transform: translateY(100%);
  }
  .tss-lm-overlay.is-open .tss-lm-modal { transform: translateY(0); }
  .tss-lm-left { display: none; }
  .tss-lm-right { padding: 64px 24px 40px; display: flex; flex-direction: column; justify-content: center; }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .tss-lm-overlay,
  .tss-lm-modal {
    transition: opacity 0.15s ease, visibility 0s !important;
  }
  .tss-lm-modal { transform: none !important; }
}
