/* ============================================================
   فرم چندمرحله‌ای دزدگیر — استایل کامل
   رنگ‌ها از کانفیگ (form-config.php) به صورت CSS Variable تزریق می‌شوند:
   --mapf-primary  --mapf-surface  --mapf-bg
   --mapf-active-bg  --mapf-text  --mapf-disabled
   فونت از قالب سایت ارث‌بری می‌شود.
============================================================ */

.mapf-root,
.mapf-root * {
	box-sizing: border-box;
}

.mapf-root {
	direction: rtl;
	display: flex;
	flex-direction: row;
	gap: 24px;
	max-width: 1240px;
	margin: 0 auto;
	font-family: inherit;
	color: var(--mapf-text);
}

/* ============================================================
   سایدبار (بردکرامب مراحل)
============================================================ */

.mapf-sidebar {
	flex: 0 0 292px;
	min-height: 610px;
	background: var(--mapf-surface);
	border-radius: 16px;
	padding: 32px;
}

.mapf-stepper {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.mapf-step {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: default;
}

.mapf-step.is-reachable {
	cursor: pointer;
}

/* خط‌چین اتصال بین دایره‌ها */
.mapf-step:not(:last-child)::before {
	content: '';
	position: absolute;
	top: 36px;
	bottom: -18px;
	right: 15px;
	border-right: 1px dashed var(--mapf-disabled);
}

.mapf-step-num {
	width: 32px;
	height: 32px;
	flex: 0 0 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid var(--mapf-disabled);
	color: var(--mapf-disabled);
	font-size: 14px;
	position: relative;
	z-index: 1;
}

.mapf-step.is-active .mapf-step-num,
.mapf-step.is-done .mapf-step-num {
	background: var(--mapf-primary);
	border-color: var(--mapf-primary);
	color: #fff;
}

.mapf-step-body {
	min-width: 0;
}

.mapf-step-title {
	display: block;
	font-size: 16px;
	color: var(--mapf-disabled);
	transition: color 0.2s ease;
}

.mapf-step.is-active .mapf-step-title,
.mapf-step.is-done .mapf-step-title {
	color: var(--mapf-text);
	font-weight: 600;
}

.mapf-step-sub {
	display: block;
	font-size: 13px;
	margin-top: 4px;
	color: var(--mapf-disabled);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 180px;
}

.mapf-step.is-done .mapf-step-sub {
	color: var(--mapf-primary);
}

/* ============================================================
   ستون محتوا
============================================================ */

.mapf-content {
	flex: 1;
	min-width: 0;
	min-height: 610px;
	background: var(--mapf-bg);
	border-radius: 16px;
	padding: 32px;
}

/* ---------- پروگرس‌بار ---------- */

.mapf-progress {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 32px;
}

.mapf-progress-track {
	flex: 1;
	height: 5px;
	border-radius: 99px;
	background: var(--mapf-surface);
	overflow: hidden;
}

.mapf-progress-fill {
	height: 100%;
	width: 0;
	min-width: 8px;
	background: var(--mapf-primary);
	border-radius: 99px;
	transition: width 0.5s ease;
}

.mapf-progress-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	color: var(--mapf-text);
	white-space: nowrap;
	flex-direction: row-reverse;
}

.mapf-progress-check {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 1.5px solid #22c55e;
	color: #22c55e;
	font-size: 11px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ---------- تایتل سوال ---------- */

.mapf-prompt {
	font-size: 22px;
	font-weight: 700;
	color: var(--mapf-text);
	margin: 0 0 32px;
	line-height: 1.8;
}

/* ============================================================
   فیلدهای انتخابی (رادیو و چندانتخابی)
============================================================ */

/* راهنمای اختیاری زیر تایتل سوال (مراحل چندانتخابی) */
.mapf-hint {
	font-size: 13px;
	line-height: 1.8;
	color: #686e77;
	margin: -16px 0 20px;
}

.mapf-options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 418px));
	gap: 24px;
}

.mapf-option {
	height: 48px;
	border-radius: 6px;
	border: 1px solid transparent;
	background: var(--mapf-surface);
	color: var(--mapf-text);
	font-family: inherit;
	font-size: 15px;
	text-align: right;
	padding: 0 16px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
	.mapf-option:hover {
		border-color: var(--mapf-primary);
	}
}

.mapf-option:focus {
	outline: none;
}

.mapf-option:focus-visible {
	outline: 2px solid var(--mapf-primary);
	outline-offset: 2px;
}

.mapf-option.is-selected {
	background: var(--mapf-active-bg);
	color: var(--mapf-primary);
	border-color: var(--mapf-primary);
}

/* ============================================================
   فیلدهای متنی / ناحیه متنی
============================================================ */

.mapf-input-wrap {
	position: relative;
	max-width: 418px;
}

.mapf-input {
	width: 100%;
	height: 48px;
	border-radius: 6px;
	border: 1px solid transparent;
	background: var(--mapf-surface);
	padding: 12px 16px;
	font-family: inherit;
	font-size: 15px;
	color: var(--mapf-text);
	outline: none;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.mapf-input:focus {
	border-color: var(--mapf-primary);
	background: #fff;
}

.mapf-input::placeholder {
	color: var(--mapf-disabled);
}

textarea.mapf-textarea {
	height: 104px;
	resize: none;
	display: block;
}

/* چیپ «ثبت» داخل ناحیه متنی — فقط دسکتاپ، بعد از تایپ ظاهر می‌شود */
.mapf-chip {
	position: absolute;
	left: 12px;
	top: 12px;
	width: 47px;
	height: 32px;
	border: none;
	border-radius: 6px;
	background: var(--mapf-active-bg);
	color: var(--mapf-primary);
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, background 0.2s ease, color 0.2s ease;
}

.mapf-input-wrap.has-text .mapf-chip {
	opacity: 1;
	pointer-events: auto;
}

.mapf-chip:hover {
	background: var(--mapf-primary);
	color: #fff;
}

/* دکمه ثبت موبایل (چسبان) — پیش‌فرض مخفی، فقط موبایل */
.mapf-mobile-submit {
	display: none;
}

/* ---------- خطاها ---------- */

.mapf-error {
	color: var(--mapf-primary);
	font-size: 13px;
	margin-top: 8px;
	min-height: 1em;
}

/* ============================================================
   گروه تکمیل اطلاعات (مرحله آخر)
============================================================ */

.mapf-contact-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 418px));
	gap: 24px;
}

.mapf-label {
	display: block;
	font-size: 14px;
	color: var(--mapf-text);
	margin-bottom: 8px;
}

.mapf-submit-btn {
	margin-top: 24px;
	min-width: 130px;
	height: 48px;
	padding: 0 24px;
	border: none;
	border-radius: 6px;
	background: var(--mapf-active-bg);
	color: var(--mapf-primary);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.mapf-submit-btn:hover:not(:disabled) {
	background: var(--mapf-primary);
	color: #fff;
}

.mapf-submit-btn:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* ============================================================
   هدر موبایل — پیش‌فرض مخفی
============================================================ */

.mapf-mobile-head {
	display: none;
}

.mapf-mobile-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 16px;
	color: var(--mapf-text);
}

/* ============================================================
   صفحه موفقیت
============================================================ */

.mapf-root.is-submitted .mapf-sidebar,
.mapf-root.is-submitted .mapf-content,
.mapf-root.is-submitted .mapf-mobile-head {
	display: none;
}

.mapf-success {
	width: 100%;
	min-height: 480px;
	background: var(--mapf-bg);
	border-radius: 16px;
	padding: 48px 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 24px;
}

.mapf-success-icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: #dcfce7;
	color: #16a34a;
	font-size: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mapf-success-msg {
	font-size: 17px;
	line-height: 2.2;
	max-width: 560px;
	margin: 0;
}

.mapf-code-box {
	background: var(--mapf-surface);
	border: 1px dashed var(--mapf-primary);
	color: var(--mapf-primary);
	font-size: 28px;
	font-weight: 800;
	letter-spacing: 8px;
	padding: 12px 32px 12px 24px;
	border-radius: 10px;
	direction: ltr;
}

.mapf-success-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
}

.mapf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 140px;
	height: 44px;
	padding: 0 20px;
	border: none;
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.mapf-btn:hover {
	opacity: 0.85;
}

.mapf-btn-light {
	background: var(--mapf-active-bg);
	color: var(--mapf-primary);
}

.mapf-btn-primary {
	background: var(--mapf-primary);
	color: #fff !important;
}

/* ============================================================
   نقشه تهران
============================================================ */

.mapf-map {
	max-width: 820px;
	margin: 0 auto;
}

.mapf-map-stage {
	position: relative;
	width: 100%;
	aspect-ratio: 1.75;
}

.mapf-map .region {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.mapf-map .inline-map {
	width: 100%;
	height: auto;
	display: block;
	overflow: visible;
}

/* هیت‌باکس واقعی = خود path */
.mapf-map .region path {
	pointer-events: auto;
	cursor: pointer;
}

.mapf-map .map-path {
	fill: var(--mapf-surface);
	stroke: #374151;
	stroke-width: 1;
	transition: fill 0.25s ease, stroke 0.25s ease, filter 0.3s ease, transform 0.35s ease;
	transform-origin: center;
}

@media (hover: hover) and (pointer: fine) {
	.mapf-map .region:hover {
		z-index: 99;
	}

	.mapf-map .region:hover .map-path {
		fill: #ececef;
		transform: scale(1.04);
		filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.12));
	}
}

.mapf-map .region.active .map-path {
	fill: var(--mapf-active-bg);
	stroke: var(--mapf-primary);
	filter: drop-shadow(0 14px 24px rgba(224, 45, 67, 0.15));
}

/* لیبل ناحیه‌ها */
.mapf-map .region span {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-size: clamp(8px, 1vw, 13px);
	line-height: 1.3;
	font-weight: 700;
	color: #4b5563;
	pointer-events: none;
	transition: color 0.25s ease;
}

.mapf-map .region.active span {
	color: var(--mapf-primary);
}

/* =====================================================================
   چیدمان پازل نقشه
   ─────────────────────────────────────────────────────────────────────
   برای جابه‌جایی هر قطعه فقط همین بلوک را ویرایش کنید:
     width   → اندازه قطعه (درصد نسبت به عرض نقشه)
     top     → فاصله از بالا (درصد نسبت به ارتفاع نقشه)
     right   → فاصله از راست (درصد نسبت به عرض نقشه)
     z-index → کدام قطعه روی کدام بیفتد (عدد بزرگ‌تر = رو)
   در صورت نیاز می‌توانید transform: rotate(2deg) هم اضافه کنید.
===================================================================== */

.mapf-map .reg-kordan   { width: 22.9%; top: -1%;     right: 76%; z-index: 4; }
.mapf-map .reg-karaj    { width: 23%;   top: 15%;    right: 78.3%;   z-index: 5; }
.mapf-map .reg-shahriar { width: 19.5%;   top: 40.5%;    right: 74.1%;   z-index: 3; }
.mapf-map .reg-robat    { width: 22.4%; top: 57.5%;  right: 64.4%;   z-index: 2; }
.mapf-map .reg-gharb    { width: 25%;   top: 8.75%; right: 59.4%;   z-index: 6; }
.mapf-map .reg-shomal   { width: 31%; top: 0.5%;   right: 31%;   z-index: 7; }
.mapf-map .reg-jonoob   { width: 35%;   top: 43.25%; right: 30.4%; z-index: 5; }
.mapf-map .reg-shargh   { width: 26%;   top: 3.7%;   right: 6.7%;    z-index: 4; }
.mapf-map .reg-lavasan  { width: 22.5%;   top: 8%;  right: 1%;  z-index: 8; transform: rotate(3deg); }
.mapf-map .reg-damavand { width: 18%; top: 37.5%;    right: 2.5%;  z-index: 9; }

@media (max-width:768px){
	.mapf-map .reg-robat span {
	font-size: clamp(8px, 1vw, 13px);
	right: 4px;
	top: 3px;
}
.mapf-map .reg-gharb span {
	font-size: clamp(8px, 1vw, 13px);
	right: -3px;
	top: -23px;
}
.mapf-map .reg-lavasan span {
	font-size: clamp(8px, 1vw, 13px);
	right: -19px;
	top: -4px;
}
.mapf-map .reg-damavand span {
	font-size: clamp(8px, 1vw, 13px);
	right: -14px;
	top: 0px;
}
}

/* تنظیم دستی جای لیبل هر ناحیه (در صورت نیاز):
   مثال:
   .mapf-map .reg-shargh span { top: -20px; left: 10px; }
*/

/* ---------- راهنمای پایین نقشه ---------- */

.mapf-map-footer {
	margin-top: 16px;
}

.mapf-map-footer ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mapf-map-footer li {
	position: relative;
	padding-right: 18px;
	margin-bottom: 8px;
	font-size: 13px;
	color: #686e77;
	line-height: 1.8;
}

.mapf-map-footer li::before {
	content: '';
	position: absolute;
	right: 0;
	top: 9px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--mapf-primary);
}

.mapf-map-footer a {
	color: var(--mapf-primary);
	text-decoration: underline;
}

/* ============================================================
   موبایل
============================================================ */

@media (max-width: 768px) {

	.mapf-root {
		flex-direction: column;
		gap: 16px;
	}

	/* تایتل + پروگرس بالای فرم */
	.mapf-mobile-head {
		display: block;
	}

	.mapf-content > .mapf-progress {
		display: none;
	}

	/* بردکرامب افقی اسکرول‌شونده */
	.mapf-sidebar {
		flex: none;
		min-height: 0;
		padding: 12px;
		border-radius: 12px;
	}

	.mapf-stepper {
		flex-direction: row;
		gap: 12px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scroll-behavior: smooth;
		padding-bottom: 4px;
	}

	/* هر مرحله ~۵۵٪ عرض تا مرحله بعدی «سرک» بکشد */
	.mapf-step {
		flex: 0 0 55%;
	}

	.mapf-step:not(:last-child)::before {
		display: none;
	}

	.mapf-step-sub {
		max-width: 140px;
	}

	.mapf-content {
		min-height: 0;
		padding: 20px 16px;
	}

	.mapf-prompt {
		font-size: 16px;
		margin-bottom: 20px;
	}

	/* فیلدهای انتخابی: یک ستونه، زیر هم */
	.mapf-options {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.mapf-option {
		height: 40px;
	}

	/* فیلدهای متنی تمام‌عرض */
	.mapf-input-wrap {
		max-width: none;
	}

	textarea.mapf-textarea {
		height: 100px;
	}

	/* چیپ دسکتاپ مخفی، دکمه چسبان موبایل نمایان */
	.mapf-chip {
		display: none;
	}

	.mapf-mobile-submit {
		display: block;
		position: sticky;
		bottom: 12px;
		width: 100%;
		height: 40px;
		margin-top: 16px;
		border: none;
		border-radius: 6px;
		background: var(--mapf-primary);
		color: #fff;
		font-family: inherit;
		font-size: 15px;
		font-weight: 700;
		cursor: pointer;
	}

	.mapf-contact-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.mapf-submit-btn {
		position: sticky;
		bottom: 12px;
		width: 100%;
		height: 40px;
		margin-top: 16px;
		background: var(--mapf-primary);
		color: #fff;
	}

	.mapf-map .region span {
		font-size: clamp(6px, 2vw, 11px);
	}

	.mapf-map-footer li {
		font-size: 11px;
	}
}

/* کاهش انیمیشن برای کاربرانی که ترجیح داده‌اند */
@media (prefers-reduced-motion: reduce) {

	.mapf-root *,
	.mapf-progress-fill,
	.mapf-map .map-path {
		transition: none !important;
	}
}


/* ============================================================
حذف کامل هاور و فوکوس رادیو باتن‌ها در موبایل (غلبه بر استایل‌های قالب)
============================================================ */
@media (max-width: 768px) {
  
  /* 1. حذف هاور و حالت فشرده شدن (Active) هنگام لمس */
  .mapf-option:hover,
  .mapf-option:active {
    border-color: transparent !important;
    background: var(--mapf-surface) !important;
    color: var(--mapf-text) !important;
  }

  /* 2. حذف فوکوس (غلبه بر استایل button:focus و [type="button"]:focus قالب) */
  .mapf-option:focus,
  .mapf-option:focus:not(:focus-visible),
  .mapf-option:focus-visible,
  button.mapf-option:focus,
  [type="button"].mapf-option:focus {
    outline: none !important;
    background: var(--mapf-surface) !important; /* بازگرداندن پس‌زمینه به حالت عادی */
    color: var(--mapf-text) !important;
    border-color: transparent !important;
    box-shadow: none !important;
  }

  /* 3. اطمینان از اینکه حالت انتخاب شده (Selected) همچنان کار می‌کند */
  .mapf-option.is-selected {
    background: var(--mapf-active-bg) !important;
    color: var(--mapf-primary) !important;
    border-color: var(--mapf-primary) !important;
  }
}
