/* ============================================================
   وسيط برو - Tour UI shell
   Mobile-first (390px), RTL default, LTR via logical properties
   ============================================================ */

:root {
  --brand: #0e7490;
  --brand-dark: #155e75;
  --brand-soft: #e0f2f5;
  --accent: #d97706;
  --ink: #1f2937;
  --ink-soft: #6b7280;
  --line: #e5e7eb;
  --bg: #f4f6f8;
  --card: #ffffff;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(15, 40, 60, .07), 0 1px 3px rgba(15, 40, 60, .06);
  --font: "Segoe UI", "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
}

[dir="ltr"] body { letter-spacing: 0; }

/* ---------- Header ---------- */

.tour-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.tour-header__inner {
  max-width: 860px;
  margin-inline: auto;
  padding: 12px 16px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tour-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-dark);
}

.tour-brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
}

.tour-brand__name { font-size: 19px; font-weight: 700; }

.tour-brand__en {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}

.tour-lang {
  min-height: 48px;
  padding-inline: 18px;
  border: 1.5px solid var(--brand);
  border-radius: 12px;
  background: #fff;
  color: var(--brand-dark);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.tour-lang:active { background: var(--brand-soft); }

/* ---------- Progress dots ---------- */

.tour-progress-wrap {
  max-width: 860px;
  margin-inline: auto;
  padding: 6px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tour-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.t-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  font-style: normal;
}

.t-dot i { font-style: normal; }

/* connector line between dots */
.t-dot:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-start: 100%;
  top: 50%;
  width: 8px;
  height: 2px;
  background: var(--line);
  transform: translateY(-50%);
}

.t-dot.is-done {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.t-dot.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.tour-progress__label {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- Steps stack ---------- */

.tour-steps {
  max-width: 860px;
  margin-inline: auto;
  padding: 18px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.t-step {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  scroll-margin-top: 140px;
}

.t-step[hidden], .t-step.is-hidden { display: none; }

.t-step.is-active {
  border-color: var(--brand);
  box-shadow: 0 4px 18px rgba(14, 116, 144, .16);
}

.t-step.is-done {
  background: #fbfcfc;
}

.t-step__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.t-step__num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 16px;
  font-weight: 800;
}

.is-done .t-step__num { background: var(--ok-soft); color: var(--ok); }

.t-step__titles { flex: 1; min-width: 0; }

.t-step__title { font-size: 18px; font-weight: 800; line-height: 1.4; }

.t-step__title-en {
  font-size: 12px;
  color: var(--ink-soft);
  direction: ltr;
  text-align: start;
}

.t-step__check {
  display: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  flex: 0 0 auto;
}

.is-done .t-step__check { display: grid; }

.t-step__hint {
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.t-step__body { margin-top: 14px; }

/* ---------- Buttons ---------- */

.t-step__actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.t-btn {
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}

.t-btn:active { transform: scale(.98); }

.t-btn--primary {
  background: var(--brand);
  color: #fff;
  flex: 1;
}

.t-btn--primary:hover { background: var(--brand-dark); }

.t-btn--ghost {
  background: #fff;
  border-color: var(--brand);
  color: var(--brand-dark);
  flex: 1;
}

.t-btn--skip {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}

.t-btn--wide { flex: 1 1 100%; }

.t-btn--small {
  min-height: 48px;
  padding: 6px 18px;
  font-size: 14px;
  background: var(--brand);
  color: #fff;
}

/* ---------- Step 1: type chooser cards ---------- */

.t-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.t-option {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label en" "hint hint";
  align-items: baseline;
  gap: 2px 10px;
  text-align: start;
  padding: 14px 16px;
  min-height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-family: var(--font);
  cursor: pointer;
}

.t-option strong { grid-area: label; font-size: 16px; color: var(--ink); }

.t-option small { grid-area: en; font-size: 11px; color: var(--ink-soft); }

.t-option em {
  grid-area: hint;
  font-style: normal;
  font-size: 13px;
  color: var(--ink-soft);
}

.t-option.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.t-option.is-selected strong { color: var(--brand-dark); }

/* ---------- Step 2: team & roles ---------- */

.t-team { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.t-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.t-member__avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 800;
  flex: 0 0 auto;
}

.t-member__info { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }

.t-member__info small { color: var(--ink-soft); font-size: 12px; }

.t-chip {
  font-size: 12px;
  background: var(--ok-soft);
  color: var(--ok);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.t-roles {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.t-role {
  padding: 10px 12px;
  border-inline-start: 3px solid var(--brand);
  background: #f9fafb;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.t-role strong { font-size: 14px; }

.t-role__can { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Step 3: connect rows ---------- */

.t-connects { display: flex; flex-direction: column; gap: 10px; }

.t-connect {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  min-height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.t-connect__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  flex: 0 0 auto;
}

.t-connect__name {
  flex: 1;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.t-connect__name small { font-weight: 400; font-size: 11px; color: var(--ink-soft); }

.t-connect.is-connected { border-color: var(--ok); background: var(--ok-soft); }

.t-connect.is-connected .t-connect__icon { background: #fff; color: var(--ok); }

.t-connect__state { font-size: 13px; font-weight: 700; color: var(--ok); }

/* ---------- Step 4: unit cards ---------- */

.t-units { display: grid; grid-template-columns: 1fr; gap: 12px; }

.t-unit {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.t-unit__photo {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #cfe8ee, #e8f2f0);
}

.t-unit__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.t-unit__kind {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  border-radius: 999px;
  padding: 3px 12px;
}

.t-unit__kind--sale { background: var(--brand); }

.t-unit__kind--rent { background: var(--accent); }

.t-unit__info { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 2px; }

.t-unit__info strong { font-size: 15px; }

.t-unit__info small { color: var(--ink-soft); font-size: 12.5px; }

.t-unit__price { margin-top: 4px; font-size: 16px; font-weight: 800; color: var(--brand-dark); }

/* ---------- Step 5: publish checklist ---------- */

.t-publish { display: flex; flex-direction: column; gap: 8px; }

.t-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
}

.t-check input {
  width: 22px;
  height: 22px;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

/* ---------- Step 6: inquiries ---------- */

.t-inquiries { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.t-inquiry {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: 10px;
  background: #fffdf7;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.t-inquiry strong { font-size: 14.5px; }

.t-inquiry span { font-size: 14px; }

.t-inquiry small { font-size: 12px; color: var(--ink-soft); }

/* ---------- Toast ---------- */

.tour-toast {
  position: fixed;
  inset-inline: 16px;
  bottom: 18px;
  z-index: 60;
  max-width: 480px;
  margin-inline: auto;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.tour-toast.is-show { opacity: 1; transform: translateY(0); }

/* ---------- Footer ---------- */

.tour-footer {
  text-align: center;
  padding: 20px 16px 28px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ---------- Desktop (1200px) ---------- */

@media (min-width: 768px) {
  .tour-header__inner, .tour-progress-wrap, .tour-steps { padding-inline: 24px; }

  .t-step { padding: 24px; }

  .t-step__title { font-size: 20px; }

  .t-options--types { grid-template-columns: 1fr 1fr; }

  .t-units { grid-template-columns: 1fr 1fr; }

  .t-connects { display: grid; grid-template-columns: 1fr 1fr; }

  .t-btn { min-height: 52px; }

  .t-step__actions .t-btn--primary,
  .t-step__actions .t-btn--ghost { flex: 0 1 auto; min-width: 180px; }

  .t-step__actions .t-btn--wide { flex: 1 1 100%; }
}

/* engine classes */
.tour-steps{max-width:640px;margin:0 auto;padding:12px 14px 80px;display:flex;flex-direction:column;gap:14px}
.tour-step{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px;border:2px solid transparent}
.tour-step.done{border-color:var(--ok-soft);opacity:.92}
.tour-step-head{display:flex;align-items:center;gap:10px}
.tour-step-title{margin:0;font-size:1.25rem;flex:1}
.tour-check{display:inline-flex;color:#fff;background:var(--ok);border-radius:50%;width:26px;height:26px;align-items:center;justify-content:center;font-size:.9rem}
.tour-check.hidden{display:none!important}
.tour-hint{color:var(--ink-soft);margin:6px 0 12px;line-height:1.6}
.tour-step-body{display:flex;flex-direction:column;gap:10px}
.tour-card{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:start;width:100%;min-height:64px;padding:14px 16px;border:2px solid var(--line);border-radius:14px;background:#fff;font:inherit;color:var(--ink);cursor:pointer}
.tour-card:hover,.tour-card:focus-visible{border-color:var(--brand);background:var(--brand-soft)}
.tour-card-label{font-weight:700;font-size:1.1rem}
.tour-card-hint{color:var(--ink-soft);font-size:.92rem;line-height:1.5}
.tour-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:#fafbfc}
.tour-row-label{flex:1;min-width:140px;font-weight:600}
.tour-btn{min-height:48px;padding:10px 20px;border-radius:12px;border:2px solid var(--brand);background:#fff;color:var(--brand-dark);font:inherit;font-weight:700;cursor:pointer}
.tour-btn:disabled{opacity:.6}
.tour-primary{background:var(--brand);color:#fff;width:100%}
.tour-ghost{border-color:var(--line);color:var(--ink-soft)}
.tour-pub{color:var(--ok);font-weight:700}
.tour-link{color:var(--brand-dark);font-weight:700}
.tour-count{font-weight:800;font-size:1.2rem;color:var(--brand-dark)}
.tour-progress{display:flex;gap:8px;justify-content:center;padding:8px 0}
.tour-dot{width:30px;height:30px;border-radius:50%;background:var(--line);color:var(--ink-soft);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:.85rem}
.tour-dot.done{background:var(--ok);color:#fff}
.tour-toast.show{opacity:1;transform:none;visibility:visible}

.tour-unit{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff;display:flex;flex-direction:column;gap:6px;padding-bottom:12px}
.tour-unit-photo{position:relative;aspect-ratio:4/3;background:var(--brand-soft)}
.tour-unit-photo img{width:100%;height:100%;object-fit:cover;display:block}
.tour-unit-stamp{position:absolute;inset-block-end:8px;inset-inline-start:8px;background:rgba(0,0,0,.6);color:#fff;border-radius:8px;padding:3px 10px;font-size:.8rem;font-weight:700}
.tour-unit-title{font-weight:800;font-size:1.05rem;padding:0 12px}
.tour-unit-sub,.tour-unit-desc{color:var(--ink-soft);font-size:.92rem;line-height:1.5;padding:0 12px}
.tour-unit-price{color:var(--brand-dark);font-weight:800;padding:0 12px}
.tour-unit-tags{display:flex;gap:6px;flex-wrap:wrap;padding:0 12px}
.tour-tag{background:var(--brand-soft);color:var(--brand-dark);border-radius:999px;padding:3px 10px;font-size:.82rem}
.tour-unit .tour-pub{padding:0 12px}
.tour-dot.active{outline:3px solid var(--brand);outline-offset:2px;background:#fff;color:var(--brand-dark)}
html[dir=ltr] .tour-progress,html[dir=ltr] .tour-header__inner{direction:ltr}

.tour-chans{margin:6px 0 12px;padding:10px;border:1px solid var(--line,#e3e8ef);border-radius:12px;background:#fff}
.tour-chans-title{font-weight:700;margin-bottom:6px}
.tour-chan{display:flex;justify-content:space-between;gap:8px;padding:6px 0;border-top:1px solid #eef1f5;color:#8a94a6}
.tour-chan.ok{color:#127a3d}
.tour-result{margin:4px 0 10px;padding:10px 12px;border-radius:10px;background:#eef7f0;color:#1b5e3a;font-size:14px}
.tour-result-from{font-weight:700;margin-bottom:2px}
.tour-wa,.tour-wa-link{display:inline-block;text-align:center;text-decoration:none;margin-top:10px}
.tour-wa-link{color:#127a3d;font-weight:700}
.tour-header__inner{gap:8px}
.tour-group{margin:14px 0 4px;font-weight:700;color:#0f4c81;border-bottom:2px solid #dbe6f1;padding-bottom:4px}
