:root {
  --bg-1: #15110a;
  --bg-2: #3a2a12;
  --gold: #e9c21c;
  --accent: #b45132;
  --accent-2: #e9c21c;
  --card-bg: #ffffff;
  --text-dark: #201436;
  --text-mute: #6b6480;
  --radius: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  color: white;
  overscroll-behavior: none;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(233,194,28,0.5);
}
.brand .accent { color: var(--gold); }

/* ---------- Splash (Tinder-style landing screen) ---------- */
.splash {
  position: relative;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  padding: 20px;
}
.splash::before {
  /* Vignette so the card stack fades into the background instead of hard-cutting at
     the screen edges. */
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 55% at 50% 42%, transparent 40%, var(--bg-1) 92%);
  pointer-events: none;
}
.splash-cards {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.splash-card {
  position: absolute;
  width: 220px;
  height: 320px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.splash-card.c1 {
  background: linear-gradient(150deg, var(--gold), var(--accent) 75%);
  opacity: 0.26;
  transform: rotate(-16deg) translate(-96px, -6px) scale(0.96);
}
.splash-card.c2 {
  background: linear-gradient(20deg, var(--accent), var(--gold) 80%);
  opacity: 0.26;
  transform: rotate(13deg) translate(96px, 4px) scale(0.96);
}
.splash-card.c3 {
  background: linear-gradient(180deg, var(--gold), var(--accent-2) 60%, var(--accent) 100%);
  opacity: 0.4;
  transform: rotate(-2deg) translate(0, -22px);
}
.splash-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.splash-logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: white;
  margin-bottom: 16px;
}
.splash-logo .accent { color: var(--gold); }
.splash-tagline {
  font-size: 50px;
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.splash-tagline .accent { color: var(--gold); }
.splash-sub {
  color: rgba(255,255,255,0.8);
  font-size: 15.5px;
  line-height: 1.5;
  max-width: 300px;
  margin: 0 0 22px;
}
.splash-cta {
  width: 100%;
  max-width: 280px;
  font-size: 17px;
  padding: 18px 20px;
  box-shadow: 0 12px 32px rgba(180,81,50,0.45);
}

/* ---------- Onboarding ---------- */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.onboarding {
  justify-content: center;
  gap: 18px;
}
.onboarding h1 {
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 4px;
}
.onboarding p.sub {
  color: rgba(255,255,255,0.75);
  margin: 0 0 10px;
  font-size: 15px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: rgba(255,255,255,0.8); font-weight: 600; }
.field input, .field select {
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  background: rgba(255,255,255,0.12);
  color: white;
  outline: none;
}
.field input::placeholder { color: rgba(255,255,255,0.5); }
.field select { appearance: none; background-color: rgba(255,255,255,0.12); }
.field select option { color: #111; }

.btn {
  border: none;
  border-radius: 999px;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: rgba(255,255,255,0.14); color: white; }

/* ---------- Swipe deck ---------- */
.deck-wrap {
  flex: 1;
  position: relative;
  padding: 10px 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deck {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 68vh;
  max-height: 560px;
}
.card {
  position: absolute;
  inset: 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  color: var(--text-dark);
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  touch-action: none;
  user-select: none;
  will-change: transform;
}
.card-photo {
  height: 55%;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  position: relative;
  overflow: hidden;
}
.card-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-photo .badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0,0,0,0.35);
  color: white;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.card-photo .play-video-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: white;
  border: 2px solid rgba(255,255,255,0.8);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 0 0 3px;
}
.card-body {
  flex: 1;
  padding: 16px 18px;
  overflow-y: auto;
}
.card-body h2 { margin: 0 0 2px; font-size: 22px; }
.card-body .brokerage { color: var(--text-mute); font-size: 14px; margin-bottom: 8px; }
.card-body .bio { font-size: 14.5px; line-height: 1.45; margin: 8px 0 12px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag {
  background: #fbf0d0;
  color: #8a6519;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
}
.tag.area { background: #e8f9f0; color: #148a52; }
.stat-row {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--text-mute);
  margin-top: 4px;
}
.stat-row b { color: var(--text-dark); }

.stamp {
  position: absolute;
  top: 28px;
  border: 5px solid;
  border-radius: 10px;
  padding: 4px 12px;
  font-size: 26px;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}
.stamp.like { left: 20px; color: var(--accent-2); border-color: var(--accent-2); transform: rotate(-18deg); }
.stamp.nope { right: 20px; color: var(--accent); border-color: var(--accent); transform: rotate(18deg); }

.deck-empty {
  text-align: center;
  padding: 40px 20px;
}
.deck-empty .emoji { font-size: 56px; margin-bottom: 10px; }

.swipe-actions {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 18px 0 8px;
}
.icon-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: white;
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn.pass { color: var(--accent); }
.icon-btn.like { color: var(--accent-2); }
.icon-btn:active { transform: scale(0.92); }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  display: flex;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.15);
}
.bottom-nav button {
  flex: 1;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bottom-nav button .ic { font-size: 20px; }
.bottom-nav button.active { color: white; }

/* ---------- Matches list ---------- */
.match-item {
  display: flex;
  gap: 14px;
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  align-items: center;
}
.match-item .avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  overflow: hidden;
}
.match-item .avatar img,
.dash-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dash-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 8px;
}
.match-item .info { flex: 1; min-width: 0; }
.match-item .info h3 { margin: 0; font-size: 16px; }
.match-item .info p { margin: 2px 0 0; font-size: 13px; color: rgba(255,255,255,0.65); }
.match-actions { display: flex; gap: 8px; margin-top: 8px; }
.match-actions a {
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  color: white;
}
.empty-state {
  text-align: center;
  color: rgba(255,255,255,0.7);
  padding: 60px 20px;
}
.empty-state .emoji { font-size: 50px; margin-bottom: 12px; }

/* ---------- Match modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 7, 3, 0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-card {
  background: white;
  color: var(--text-dark);
  border-radius: 24px;
  padding: 30px 24px;
  text-align: center;
  max-width: 340px;
}
.modal-card .emoji { font-size: 54px; }
.modal-card h2 { margin: 8px 0 4px; font-size: 24px; color: var(--accent); }
.modal-card p { color: var(--text-mute); margin: 0 0 18px; font-size: 14.5px; }

/* ---------- Realtor dashboard ---------- */
.dash-header {
  padding: 20px;
}
.dash-header h1 { margin: 0 0 4px; font-size: 24px; }
.dash-header p { margin: 0; color: rgba(255,255,255,0.7); font-size: 14px; }
.sub-banner {
  margin: 0 20px 16px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.sub-banner.sub-active {
  background: rgba(233,194,28,0.14);
  border: 1px solid rgba(233,194,28,0.4);
}
.sub-banner.sub-inactive {
  background: rgba(180,81,50,0.25);
  border: 1px solid rgba(180,81,50,0.6);
}
.link-btn {
  background: rgba(255,255,255,0.16);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.dash-video-section {
  background: rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0 20px 16px;
}
.dash-video-section h3 { margin: 0 0 4px; font-size: 15px; }
.dash-video-hint { margin: 0 0 12px; font-size: 12.5px; color: rgba(255,255,255,0.65); }
.dash-video-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dash-video-preview {
  width: 120px;
  height: 80px;
  border-radius: 10px;
  background: #000;
  object-fit: cover;
  flex-shrink: 0;
}
.dash-video-preview.dash-video-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06);
}
.dash-video-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.dash-video-upload-label { cursor: pointer; text-align: center; }
.dash-video-remove-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.lead-item {
  background: rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px;
  margin: 0 20px 12px;
}
.lead-item h3 { margin: 0 0 4px; font-size: 15px; }
.lead-item .meta { font-size: 12.5px; color: rgba(255,255,255,0.65); margin: 2px 0; }
.pill {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-top: 6px;
}

.hint {
  text-align: center;
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  padding: 6px 20px 14px;
}

/* ---------- Auth (sign up / log in / OAuth) ---------- */
.error-banner {
  background: rgba(180,81,50,0.25);
  border: 1px solid rgba(180,81,50,0.6);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.4);
  font-size: 12.5px;
  margin: 2px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.14);
}
.oauth-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.oauth-btn-slot {
  display: flex;
  justify-content: center;
  width: 100%;
}
.btn-apple {
  width: 100%;
  max-width: 260px;
  background: black;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-apple::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background: white;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'><path d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141 4 184.8 4 273.6c0 26.3 4.8 53.5 14.4 81.5C31.1 391.9 78.4 481 127.7 479.5c25.3-.6 43.2-18 76-18 31.8 0 48.3 18 76.4 18 49.7-.7 92.4-81.4 104.5-117.7-64.9-30.6-65.9-89.9-65.9-93.1zM264.5 88.1c26.9-32 24.5-61.2 23.7-71.7-23.8 1.4-51.4 16.4-67.2 34.9-17.4 19.8-27.6 44.4-25.4 71.5 25.7 2 48.4-11.1 68.9-34.7z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'><path d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141 4 184.8 4 273.6c0 26.3 4.8 53.5 14.4 81.5C31.1 391.9 78.4 481 127.7 479.5c25.3-.6 43.2-18 76-18 31.8 0 48.3 18 76.4 18 49.7-.7 92.4-81.4 104.5-117.7-64.9-30.6-65.9-89.9-65.9-93.1zM264.5 88.1c26.9-32 24.5-61.2 23.7-71.7-23.8 1.4-51.4 16.4-67.2 34.9-17.4 19.8-27.6 44.4-25.4 71.5 25.7 2 48.4-11.1 68.9-34.7z'/></svg>") center / contain no-repeat;
}
