:root {
  --bg: #f4f7f9;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe4ea;
  --accent: #ef7d00;
  --accent-2: #ffd166;
  --brand: #0f766e;
  --brand-dark: #134e4a;
  --shadow: 0 8px 32px rgba(9, 30, 66, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #e0f2fe 0, transparent 35%), radial-gradient(circle at top right, #fef3c7 0, transparent 35%), var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.site-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(7px);
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.brand-text {
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--brand-dark);
}

.nav-link {
  color: var(--ink);
  font-weight: 500;
}

.nav-link:hover {
  color: var(--brand);
}

.btn-accent {
  background: linear-gradient(130deg, var(--accent), #e85d04);
  color: #fff;
  border: 0;
  font-weight: 700;
}

.btn-accent:hover {
  color: #fff;
  filter: brightness(0.95);
}

.btn-soft {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-soft:hover {
  border-color: #c8d4dc;
}

.ts-wrapper,
.ts-dropdown {
  direction: rtl;
  text-align: right;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.hero-panel,
.stats-panel,
.panel,
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 1.5rem;
  background: linear-gradient(120deg, var(--brand-dark), var(--brand));
  color: #fff;
}

.pill {
  display: inline-flex;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
}

.hero-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 900;
  margin-bottom: 0.6rem;
}

.hero-subtitle {
  color: #def7f3;
  margin-bottom: 1rem;
}

.stats-panel {
  padding: 1rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.1rem;
  border-bottom: 1px dashed var(--line);
}

.stat-item:last-child {
  border-bottom: 0;
}

.stat-item span {
  color: var(--muted);
}

.stat-item strong {
  color: var(--brand-dark);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-weight: 800;
}

.panel {
  padding: 1rem;
}

.listing-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.listing-card img {
  height: 190px;
  object-fit: cover;
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.14);
}

.listing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.5rem 0 0.6rem;
}

.listing-chip {
  font-size: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
  color: #334155;
  background: #f8fafc;
}

.listing-actions {
  display: flex;
  gap: 0.4rem;
}

.result-caption {
  font-weight: 700;
  color: #0f172a;
}

.listing-card .badge-featured {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(120deg, #ffb703, #fb8500);
  color: #111;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.listing-card .badge-sponsored {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(120deg, #16a34a, #22c55e);
  color: #fff;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.listing-card.is-sponsored {
  border-color: #22c55e;
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.2);
}

.auth-wrap {
  min-height: 60vh;
  display: grid;
  place-items: center;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  padding: 1.25rem;
}

.chat-panel {
  min-height: 68vh;
  display: flex;
  flex-direction: column;
}

.chat-header {
  font-weight: 700;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 0.75rem 0;
  max-height: 52vh;
}

.conversation-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  width: 100%;
}

.conversation-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
  cursor: pointer;
}

.conversation-item.active {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.msg-row.mine {
  justify-content: flex-start;
}

.msg-row.other {
  justify-content: flex-end;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: pointer;
}

.msg-avatar.mine {
  order: 2;
}

.msg-avatar.other {
  order: 1;
}

.msg-bubble {
  max-width: 80%;
  border-radius: 14px;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
}

.msg-row.mine .msg-bubble {
  order: 1;
  background: #d1fae5;
}

.msg-row.other .msg-bubble {
  order: 2;
  background: #e2e8f0;
}

.footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.95));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  align-items: center;
}

.footer-title {
  font-weight: 900;
  letter-spacing: 0.3px;
  color: #0f172a;
}

.footer-copy {
  margin-top: 2px;
  line-height: 1.6;
}

.footer-contact-block {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.footer-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-label {
  font-weight: 700;
  color: #334155;
}

.footer-whatsapp {
  color: #0f766e;
  font-weight: 700;
  border: 1px solid #cce8e5;
  background: #f0fdfa;
  border-radius: 999px;
  padding: 4px 10px;
}

.footer-whatsapp:hover {
  color: #0b5f5a;
  border-color: #9ad9d3;
  background: #dcfce7;
}

.mobile-short {
  display: none;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-contact-block {
    justify-items: center;
  }

  #authNavActions {
    width: 100%;
    flex-wrap: wrap;
  }

  #authNavActions .btn {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    font-size: 0.82rem;
    padding: 0.45rem 0.55rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head .d-flex.gap-2,
  .panel .d-flex.gap-1,
  .panel .d-flex.gap-2 {
    width: 100%;
    flex-wrap: wrap;
  }

  .section-head .d-flex.gap-2 > .btn:not(.icon-btn),
  .panel .d-flex.gap-1 > .btn:not(.icon-btn),
  .panel .d-flex.gap-2 > .btn:not(.icon-btn) {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    font-size: 0.78rem;
    padding: 0.4rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-full {
    display: none !important;
  }

  .mobile-short {
    display: inline !important;
  }
}

.notif-bell {
  position: relative;
}

.notif-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notif-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.notif-menu {
  width: 320px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.5rem;
}

.notif-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem;
  margin-bottom: 0.45rem;
  cursor: pointer;
}

.notif-item.unread {
  border-color: #60a5fa;
  background: #eff6ff;
}

.chat-peer-profile {
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.6rem;
}

.peer-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.profile-clickable {
  cursor: pointer;
}

.profile-modal-avatar {
  width: 90px;
  height: 90px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--line);
}

.online-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  margin-left: 6px;
}

.online-dot.on {
  background: #22c55e;
}

.online-dot.off {
  background: #94a3b8;
}

.toast-stack {
  position: fixed;
  top: 85px;
  left: 16px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast-mini {
  background: #111827;
  color: #fff;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  box-shadow: var(--shadow);
  max-width: 280px;
  font-size: 0.85rem;
}

.toast-form {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem;
  box-shadow: var(--shadow);
  width: min(360px, 92vw);
  position: relative;
  z-index: 1;
}

.toast-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(15, 23, 42, 0.28);
}

.toast-form-title {
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #0f172a;
}

.toast-form-body {
  display: grid;
  gap: 0.55rem;
}

.toast-field label {
  display: block;
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 0.2rem;
}

.toast-field input,
.toast-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
  background: #fff;
}

.toast-field input:focus,
.toast-field textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.toast-form-actions {
  margin-top: 0.65rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.chat-image-thumb {
  max-width: 220px;
  border-radius: 10px;
  cursor: zoom-in;
  border: 1px solid var(--line);
}

.preview-modal-image {
  max-width: 96vw;
  max-height: 88vh;
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.recording-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #dc2626;
  font-weight: 700;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 999px;
  padding: 4px 10px;
}

.record-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8);
  animation: pulse-record 1.2s infinite;
}

.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 16px;
  animation: guide-fade-in 0.28s ease;
}

.guide-spotlight {
  position: fixed;
  z-index: 0;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 9999px rgba(15, 23, 42, 0.46),
    0 0 0 3px rgba(14, 165, 233, 0.45),
    0 10px 30px rgba(2, 6, 23, 0.45);
  transition: all 0.28s ease;
  pointer-events: none;
}

.guide-card {
  width: min(880px, 96vw);
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
  overflow: hidden;
}

.guide-target-pulse {
  position: static;
  z-index: auto !important;
  animation: guide-target-pulse 1.5s ease-in-out infinite;
}

.guide-progress {
  height: 5px;
  background: #e2e8f0;
}

.guide-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0ea5e9, #22c55e);
  transition: width 0.28s ease;
}

.guide-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.guide-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
  padding: 14px;
}

.guide-visual {
  border-radius: 16px;
  min-height: 230px;
  color: #fff;
  padding: 16px;
  overflow: hidden;
  position: relative;
}

.guide-visual::before,
.guide-visual::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  animation: guide-float 4.6s ease-in-out infinite;
}

.guide-visual::before {
  width: 130px;
  height: 130px;
  top: -35px;
  left: -25px;
}

.guide-visual::after {
  width: 88px;
  height: 88px;
  bottom: -22px;
  right: -18px;
  animation-delay: 0.6s;
}

.guide-visual-bars {
  display: grid;
  gap: 10px;
  margin-top: 32px;
}

.guide-visual-bars span {
  display: block;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  transform-origin: right;
  animation: guide-bars 1.8s ease-in-out infinite;
}

.guide-visual-bars span:nth-child(2) {
  width: 82%;
  animation-delay: 0.16s;
}

.guide-visual-bars span:nth-child(3) {
  width: 64%;
  animation-delay: 0.28s;
}

.guide-visual-phone {
  width: 180px;
  margin: 18px auto 0;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  padding: 10px;
}

.guide-visual-phone div {
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  margin-bottom: 8px;
  animation: guide-bars 1.9s ease-in-out infinite;
}

.guide-visual-code {
  margin-top: 68px;
  text-align: center;
  font-weight: 900;
  font-size: 30px;
  letter-spacing: 2px;
  text-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
}

.guide-visual-bubbles {
  display: grid;
  gap: 10px;
  margin-top: 48px;
}

.guide-visual-bubbles span {
  display: inline-block;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  animation: guide-bob 2s ease-in-out infinite;
}

.guide-visual-bubbles span:nth-child(1) {
  width: 64%;
}

.guide-visual-bubbles span:nth-child(2) {
  width: 78%;
  animation-delay: 0.18s;
}

.guide-visual-bubbles span:nth-child(3) {
  width: 58%;
  animation-delay: 0.34s;
}

.guide-visual-shield {
  margin: 70px auto 0;
  width: 130px;
  height: 130px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  color: #166534;
  font-weight: 900;
  display: grid;
  place-items: center;
  transform: rotate(-8deg);
  animation: guide-bob 2.2s ease-in-out infinite;
}

.guide-content {
  padding: 6px 4px;
}

.guide-title {
  margin: 0 0 8px;
  font-size: 1.3rem;
  font-weight: 900;
}

.guide-subtitle {
  color: var(--muted);
  margin: 0 0 10px;
}

.guide-points {
  margin: 0;
  padding-right: 1rem;
  color: #0f172a;
  display: grid;
  gap: 8px;
}

.guide-footer {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.guide-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: all 0.2s ease;
}

.guide-dot.active {
  width: 22px;
  background: #0ea5e9;
}

@keyframes guide-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes guide-target-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.2);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(14, 165, 233, 0);
  }
}

@keyframes guide-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes guide-bars {
  0%, 100% {
    transform: scaleX(1);
    opacity: 1;
  }
  50% {
    transform: scaleX(0.78);
    opacity: 0.75;
  }
}

@keyframes guide-bob {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@media (max-width: 920px) {
  .guide-body {
    grid-template-columns: 1fr;
  }

  .guide-visual {
    min-height: 160px;
  }

  .guide-title {
    font-size: 1.12rem;
  }
}

@keyframes pulse-record {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@media (min-width: 992px) {
  .hero-grid {
    grid-template-columns: 2fr 1fr;
  }
}
