/* فرم‌های Webisoft — استایل مشترک همه‌ی ویجت‌ها (دکمه‌ی باز کردن، مودال، مراحل، فیلدها، کارت‌های گزینه‌ای سبک مسترکلاس) */

/*
 * سپر جداسازی از قالب (Woodmart و مشابه): همه‌ی سلکتورهای این فایل زیر پیشوند
 * اختصاصی wsf- هستند تا با هیچ کلاس عمومی قالب برخورد نکنند؛ علاوه‌بر آن،
 * چون قالب‌هایی مثل Woodmart روی input/button/select استایل عمومی با اختصاصیت
 * بالا (گاهی !important) می‌گذارند، خواص ظاهریِ کلیدی (رادیوس، پدینگ، بوردر،
 * پس‌زمینه، ارتفاع، باکس‌ساینگ) در این فایل عمداً !important هستند.
 *
 * نکته‌ی حیاتی: هیچ متغیر --wsf-* اینجا روی .wsf-widget («پیش‌فرض») ست
 * نمی‌شود. چون .wsf-widget از نظر DOM به عناصر داخلش (دکمه/گزینه‌ها)
 * نزدیک‌تر از :root است، اگر همین‌جا هم یک بار مقدار می‌دادیم، رزولوشن
 * متغیر CSS همیشه همین مقدار «نزدیک‌تر» را انتخاب می‌کرد و :root ای که
 * پلاگین از تنظیمات ادمین می‌سازد (و override هر ویجت که آن هم دقیقاً
 * روی همین .wsf-widget می‌نشیند) هرگز اثر نمی‌کرد — این همان باگی بود که
 * باعث می‌شد هیچ تغییری از ادمین یا از تب Style المنتور اثر نکند. پیش‌فرض
 * هر متغیر فقط به‌صورت دومین آرگومان var(--x, پیش‌فرض) در محل مصرف است.
 */
.wsf-widget, .wsf-widget *, .wsf-modal, .wsf-modal * {
	box-sizing: border-box !important;
}

.wsf-widget {
	direction: rtl;
	display: block;
	width: 100%;
}

/*
 * دکمه‌ی اصلی که ویجت با آن نمایش داده می‌شود — عمداً یک ردیف تمام‌عرضِ
 * تیره (دقیقاً سبک هر ردیفِ لیست مسترکلاس)، نه یک دکمه‌ی کوچکِ وسط‌چین.
 * چون هر ویجت DOM جدا و مستقلی است، «لیست متصل» با چیدن چند ویجت
 * پشت‌سرهم و تنظیم گردیِ گوشه‌های هرکدام به‌صورت مجزا از تنظیمات ساخته
 * می‌شود (اولی فقط بالا گرد، وسطی‌ها صفر، آخری فقط پایین گرد).
 */
.wsf-trigger-btn {
	display: flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	gap: 12px !important;
	width: 100% !important;
	min-height: 54px !important;
	height: auto !important;
	padding: 15px 18px !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: var(--wsf-trigger-radius-tl, 10px) var(--wsf-trigger-radius-tr, 10px) var(--wsf-trigger-radius-br, 10px) var(--wsf-trigger-radius-bl, 10px) !important;
	background: var(--wsf-option-bg, #191c21) !important;
	color: var(--wsf-option-text, #ffffff) !important;
	font-size: var(--wsf-btn-size, 16px) !important;
	line-height: normal !important;
	font-weight: var(--wsf-btn-weight, 600) !important;
	font-family: var(--wsf-font, inherit) !important;
	text-align: right !important;
	cursor: pointer;
	transition: background .15s;
	text-decoration: none !important;
	text-transform: none !important;
	box-shadow: none !important;
}
.wsf-trigger-btn::before {
	content: '';
	flex-shrink: 0;
	width: 20px; height: 20px; border-radius: 5px;
	border: 2px solid rgba(255,255,255,.45);
	display: var(--wsf-option-check-display, flex);
	order: -1;
}
.wsf-trigger-btn:hover { background: var(--wsf-option-bg-hover, #42454c) !important; }
.wsf-trigger-btn:active { transform: scale(.99); }

/* مودال */
.wsf-modal { display: none; position: fixed; inset: 0; z-index: 999999; direction: rtl; }
.wsf-modal.wsf-active { display: flex; align-items: center; justify-content: center; }
.wsf-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.65); }

.wsf-modal-content {
	position: relative; z-index: 2; background: var(--wsf-modal-bg, #000000) !important; width: 92%; max-width: 520px;
	max-height: 90vh; overflow-y: auto; border-radius: var(--wsf-radius, 14px) !important; padding: 35px;
	box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: wsfFadeIn .25s ease;
	font-family: var(--wsf-font, inherit); text-align: right; line-height: normal;
}
.wsf-modal-content * { text-transform: none !important; }
.wsf-modal-content input, .wsf-modal-content select, .wsf-modal-content textarea, .wsf-modal-content button { font-family: inherit; }
@keyframes wsfFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.wsf-close {
	position: absolute !important; top: 10px !important; left: 15px !important; width: 35px !important; height: 35px !important;
	border: 0 !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important;
	background: transparent !important; font-size: 30px !important; cursor: pointer; line-height: 30px !important; color: var(--wsf-close-color, #9aa0a6) !important;
}
.wsf-close:hover { filter: brightness(0.7); }

.wsf-form-title { margin: 0 0 8px !important; padding: 0 !important; font-size: var(--wsf-heading-size, 22px) !important; font-weight: var(--wsf-heading-weight, 700) !important; color: var(--wsf-heading-color, #ffffff) !important; }
.wsf-form-desc { margin: 0 0 25px !important; padding: 0 !important; color: var(--wsf-desc-color, #9aa0a6) !important; font-size: var(--wsf-desc-size, 14.5px) !important; font-weight: var(--wsf-desc-weight, 400) !important; line-height: 1.7 !important; }

/* مراحل */
.wsf-step { display: none; animation: wsfFadeIn .3s ease; }
.wsf-step.wsf-step-active { display: block; }

/* کارت‌های گزینه‌ای سبک مسترکلاس: پس‌زمینه تیره، چک‌مارک رنگ برند.
   ردیف‌ها به هم چسبیده‌اند (لیست یکپارچه) — فقط ردیف اول از بالا و ردیف
   آخر از پایین گرد است، وسط لیست کاملاً صاف می‌ماند. */
.wsf-radio-group { display: flex !important; flex-direction: column !important; gap: 2px !important; margin: 0 0 22px !important; padding: 0 !important; list-style: none !important; }
.wsf-option-card {
	position: relative; display: flex !important; align-items: center !important; gap: 12px !important;
	width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; float: none !important;
	padding: 15px 18px !important; margin: 0 !important; border-radius: 0 !important; cursor: pointer;
	background: var(--wsf-option-bg, #191c21) !important; color: var(--wsf-option-text, #ffffff) !important;
	font-size: var(--wsf-option-size, 15.5px) !important; font-weight: var(--wsf-option-weight, 500) !important; line-height: normal !important;
	transition: background .15s;
	border: 1px solid transparent !important;
}
.wsf-radio-group .wsf-option-card:first-child { border-radius: var(--wsf-option-radius-tl, 10px) var(--wsf-option-radius-tr, 10px) 0 0 !important; }
.wsf-radio-group .wsf-option-card:last-child { border-radius: 0 0 var(--wsf-option-radius-br, 10px) var(--wsf-option-radius-bl, 10px) !important; }
.wsf-radio-group .wsf-option-card:only-child { border-radius: var(--wsf-option-radius-tl, 10px) var(--wsf-option-radius-tr, 10px) var(--wsf-option-radius-br, 10px) var(--wsf-option-radius-bl, 10px) !important; }
/* هاور و انتخاب فقط با روشن‌تر شدن خنثیِ پس‌زمینه مشخص می‌شوند (بدون رینگ رنگی) — دقیقاً سبک مسترکلاس */
.wsf-option-card:hover { background: var(--wsf-option-bg-hover, #42454c) !important; }
.wsf-option-card:has(input:checked) { background: var(--wsf-option-bg-hover, #42454c) !important; }
.wsf-option-card input[type="radio"], .wsf-option-card input[type="checkbox"] {
	position: absolute !important; opacity: 0 !important; width: 0 !important; height: 0 !important;
	margin: 0 !important; padding: 0 !important; appearance: none !important; -webkit-appearance: none !important;
}
.wsf-option-check {
	flex-shrink: 0; width: 20px; height: 20px; border-radius: 5px !important;
	border: 2px solid rgba(255,255,255,.45) !important;
	display: var(--wsf-option-check-display, flex); align-items: center; justify-content: center;
	transition: background .2s, border-color .2s; background: var(--wsf-checkbox-bg, #42454c) !important;
}
.wsf-option-check.wsf-check-round { border-radius: 50%; }
.wsf-option-check::after {
	content: ''; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0); transition: transform .15s;
}
.wsf-option-card input:checked ~ .wsf-option-check {
	background: var(--wsf-accent, #7f54b3) !important; border-color: var(--wsf-accent, #7f54b3) !important;
}
.wsf-option-card input:checked ~ .wsf-option-check::after { transform: rotate(45deg) scale(1); }
.wsf-option-label { flex: 1; }

/* توضیح متنی که با انتخاب یک گزینه ظاهر می‌شود (مثلاً توضیح طرح مشاوره) */
.wsf-reveal-box { margin-top: 20px; padding-top: 20px; border-top: 1px dashed #ddd; }
.wsf-reveal-box[hidden] { display: none; }
.wsf-reveal-text {
	background: #f4f6f8; padding: 15px; border-radius: 8px; font-size: 14px;
	line-height: 1.8; color: #444; border-right: 4px solid var(--wsf-accent, #7f54b3);
}

/* فیلدهای متنی/فایل/انتخابی */
.wsf-row { display: flex; gap: 15px; }
.wsf-row .wsf-field { flex: 1; }
.wsf-field { margin-bottom: 18px; }
.wsf-field label { display: block !important; margin: 0 0 7px !important; font-weight: 600 !important; font-size: 14px !important; color: var(--wsf-label-color, #ffffff) !important; }
.wsf-field label .wsf-req { color: #d00 !important; margin-right: 4px; }
.wsf-field input[type="text"], .wsf-field input[type="tel"], .wsf-field input[type="file"], .wsf-field select {
	display: block !important; width: 100% !important; height: auto !important; min-height: 48px !important;
	padding: 10px 15px !important; margin: 0 !important; border: 1px solid var(--wsf-field-border, #42454c) !important;
	border-radius: 8px !important; background: var(--wsf-field-bg, #222327) !important; color: var(--wsf-field-text, #ffffff) !important; font-size: 15px !important;
	line-height: normal !important; box-shadow: none !important; float: none !important;
}
.wsf-field input:focus, .wsf-field select:focus { outline: none !important; border-color: var(--wsf-accent, #7f54b3) !important; box-shadow: none !important; }
.wsf-field small { display: block; margin-top: 6px; color: #777; font-size: 12px; }

/* دکمه‌های پیمایش/ارسال داخل مودال */
.wsf-actions-row { display: flex !important; gap: 10px !important; margin-top: 20px !important; }
.wsf-btn {
	flex: 1; min-height: 48px !important; height: auto !important; border: 0 !important; margin: 0 !important;
	border-radius: var(--wsf-btn-radius, 10px) !important; color: #fff !important; cursor: pointer;
	font-size: var(--wsf-btn-size, 16px) !important; font-weight: var(--wsf-btn-weight, 600) !important; line-height: normal !important;
	background-color: var(--wsf-accent, #7f54b3) !important; transition: opacity .2s; box-shadow: none !important;
	text-transform: none !important;
}
.wsf-btn:hover { opacity: .9; }
.wsf-btn.wsf-btn-secondary { background: var(--wsf-btn-secondary-bg, #f0f0f0) !important; color: var(--wsf-btn-secondary-text, #333333) !important; }
.wsf-btn.wsf-loading { opacity: .7; pointer-events: none; }
.wsf-btn .wsf-loading-text { display: none; }
.wsf-btn.wsf-loading .wsf-submit-text { display: none; }
.wsf-btn.wsf-loading .wsf-loading-text { display: inline; }

/* پیام موفقیت/خطا */
.wsf-message { display: none; padding: 12px; margin-bottom: 15px; border-radius: 6px; font-size: 14px; }
.wsf-message.wsf-success { display: block; background: var(--wsf-success-bg, #e7f7ed); color: var(--wsf-success-text, #176b35); }
.wsf-message.wsf-error { display: block; background: var(--wsf-error-bg, #fdeaea); color: var(--wsf-error-text, #aa1111); }

/* ویزارد هوشمند: نشانگر بارگذاری گزینه‌های داینامیک */
.wsf-wizard-loading { text-align: center; font-size: 14px; color: #777; margin: 18px 0; }
.wsf-wizard-loading[hidden] { display: none; }

@media (max-width: 600px) {
	.wsf-modal-content { padding: 26px 20px; width: 94%; }
	.wsf-row { flex-direction: column; gap: 0; }
}
