/* Realtor Portal — mobile-first, mirrors homeowner.css conventions */
:root {
  --rt-bg: #f1f5f9;
  --rt-surface: #ffffff;
  --rt-border: #e2e8f0;
  --rt-text: #1e293b;
  --rt-text-secondary: #475569;
  --rt-text-muted: #94a3b8;
  --rt-maroon: #7f1d1d;
  --rt-maroon-light: #fca5a5;
  --rt-green: #16a34a;
  --rt-blue: #2563eb;
  --rt-amber: #d97706;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--rt-bg);
  color: var(--rt-text);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

/* Login */
.rt-login-body {
  background: linear-gradient(160deg, #7f1d1d 0%, #0c1220 60%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.rt-login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 36px 28px 28px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
}
.rt-login-brand { text-align: center; margin-bottom: 28px; }
.rt-login-brand h1 { font-size: 22px; font-weight: 700; margin-top: 14px; color: #fff; }
.rt-login-brand p { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 4px; }

.rt-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  font-size: 16px;
  color: #fff;
  font-family: inherit;
  margin-bottom: 12px;
}
.rt-input::placeholder { color: rgba(255,255,255,0.5); }
.rt-input:focus { outline: 2px solid var(--rt-maroon-light); border-color: var(--rt-maroon-light); }

.rt-error { color: #fca5a5; font-size: 13px; min-height: 18px; margin-bottom: 8px; text-align: center; }

.rt-btn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter 120ms;
}
.rt-btn:hover { filter: brightness(1.05); }
.rt-btn:active { filter: brightness(0.95); }
.rt-btn-primary { background: var(--rt-maroon); color: #fff; }
.rt-btn-secondary { background: var(--rt-border); color: var(--rt-text); }

/* Dashboard shell */
.rt-shell { max-width: 720px; margin: 0 auto; padding: 0 16px 40px; }

.rt-topbar {
  position: sticky; top: 0;
  background: var(--rt-surface);
  border-bottom: 1px solid var(--rt-border);
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  z-index: 50;
}
.rt-topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.rt-topbar-back {
  background: none; border: 1px solid var(--rt-border); border-radius: 8px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--rt-text); cursor: pointer;
}
.rt-topbar-title {
  font-size: 15px; font-weight: 600; color: var(--rt-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rt-topbar-right {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--rt-text-muted);
}
.rt-topbar-right a { color: var(--rt-blue); text-decoration: none; }

/* Identify modal */
.rt-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.rt-modal {
  background: var(--rt-surface);
  border-radius: 16px;
  padding: 28px 24px 24px;
  max-width: 380px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}
.rt-modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.rt-modal p { font-size: 13px; color: var(--rt-text-muted); margin-bottom: 20px; }

.rt-realtor-btn {
  width: 100%;
  padding: 18px 16px;
  background: var(--rt-bg);
  border: 2px solid var(--rt-border);
  border-radius: 12px;
  font-size: 17px; font-weight: 600;
  color: var(--rt-text);
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 120ms, background 120ms;
  font-family: inherit;
}
.rt-realtor-btn:hover { border-color: var(--rt-maroon); background: rgba(127,29,29,0.05); }

/* Builds list */
.rt-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--rt-text-muted);
  margin: 18px 4px 10px;
}

.rt-build-card {
  background: var(--rt-surface);
  border: 1px solid var(--rt-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  cursor: pointer;
  transition: border-color 120ms, transform 80ms;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.rt-build-card:hover { border-color: var(--rt-maroon-light); }
.rt-build-card:active { transform: scale(0.99); }
.rt-build-card .rt-build-name {
  font-weight: 600; font-size: 15px; color: var(--rt-text);
}
.rt-build-card .rt-build-meta {
  font-size: 12px; color: var(--rt-text-muted); margin-top: 2px;
}
.rt-build-card .rt-build-count {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--rt-bg); color: var(--rt-text-muted);
  font-weight: 600;
}
.rt-build-card .rt-build-count.has-some {
  background: rgba(34,197,94,0.15); color: var(--rt-green);
}

/* Selections view */
.rt-cat-section {
  margin-top: 18px;
}
.rt-cat-header {
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--rt-maroon);
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--rt-border);
  margin-bottom: 8px;
}

.rt-sel-row {
  background: var(--rt-surface);
  border: 1px solid var(--rt-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.rt-sel-item-label {
  font-size: 13px; font-weight: 600; color: var(--rt-text);
  margin-bottom: 8px;
}
.rt-sel-controls { display: flex; gap: 6px; align-items: center; }
.rt-sel-select {
  flex: 1;
  padding: 10px 12px;
  background: var(--rt-bg);
  border: 1px solid var(--rt-border);
  border-radius: 8px;
  font-size: 14px; color: var(--rt-text);
  font-family: inherit;
  min-width: 0;
}
.rt-sel-row.is-set { border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.04); }
.rt-sel-current {
  display: inline-block;
  font-size: 11px;
  background: rgba(34,197,94,0.15);
  color: var(--rt-green);
  padding: 2px 8px; border-radius: 999px;
  margin-left: 8px; font-weight: 600;
}
.rt-saving-indicator {
  font-size: 11px; color: var(--rt-text-muted);
  margin-left: 8px;
}
.rt-saving-indicator.saved { color: var(--rt-green); }
.rt-saving-indicator.error { color: #dc2626; }

/* Tier pill — small badge next to the picker showing whether the current
   value is a Standard or Upgrade option from the catalog. Hidden when the
   value is freeform (no catalog match) or empty. */
.rt-tier-pill {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}
.rt-tier-pill[hidden] { display: none; }
.rt-tier-pill.is-standard { background: rgba(100,116,139,0.18); color: #475569; }
.rt-tier-pill.is-upgrade  { background: rgba(127,29,29,0.14);  color: #7f1d1d; }
.rt-edited-by {
  font-size: 10px; color: var(--rt-text-muted);
  margin-top: 4px; font-style: italic;
}

/* Empty + loading */
.rt-empty {
  text-align: center;
  color: var(--rt-text-muted);
  padding: 40px 20px;
  font-size: 14px;
}
.rt-loading { text-align: center; padding: 28px; color: var(--rt-text-muted); font-size: 14px; }

/* Search box */
.rt-search {
  width: 100%;
  padding: 11px 14px;
  background: var(--rt-surface);
  border: 1px solid var(--rt-border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--rt-text);
  font-family: inherit;
  margin: 8px 0 14px;
}
.rt-search:focus { outline: 2px solid var(--rt-maroon-light); border-color: var(--rt-maroon-light); }
