:root {
	--dmf-accent: #3e68ff;
	--dmf-accent-hover: #2f52d6;
	--dmf-danger: #ef3e63;
	--dmf-single-accent: #e0774a;
	--dmf-single-accent-hover: #cf6539;
}

.dmf-form { max-width: 640px; margin: 0 auto; }

/*
 * شبکهٔ ۱۲ستونی. تا ۱٫۱۴ اینجا دو ستونِ ثابت بود و فیلد فقط «کامل» یا «نصف» می‌شد؛
 * ۱۲ کوچک‌ترین عددی است که ½ و ⅓ و ¼ و ⅔ را هم‌زمان و بدونِ اعشار می‌دهد، یعنی سه
 * فیلدِ کنار هم دقیقاً هم‌عرض درمی‌آیند. فاصله‌ها از متغیرِ فرم می‌آیند و fallbackشان
 * همان ۱۴ پیکسلِ قدیمی است، پس فرمی که تنظیمِ تازه ندارد تکان نمی‌خورد.
 */
/*
 * ⚠⚠ فاصله با `gap` ساخته نمی‌شود و این هستهٔ کلِ این چیدمان است. در گریدِ CSS
 * (و در فلکسِ با gap) فاصله از عرضِ ردیف کم می‌شود، پس سه فیلدِ ۳۳٪ به‌محضِ
 * بزرگ‌کردنِ فاصله می‌شکنند و یکی‌شان می‌افتد خطِ بعد — دقیقاً همان چیزی که
 * نباید بشود. اینجا عرضِ هر فیلد *دقیقاً* همان درصد است و فاصله از padding
 * خودِ فیلد می‌آید (`box-sizing: border-box`)، پس ۳۳+۳۳+۳۳ با هر فاصله‌ای
 * یک‌خطی می‌ماند. حاشیهٔ منفیِ ظرف، نیم‌فاصلهٔ دو لبهٔ بیرونی را برمی‌گرداند
 * تا فرم از دو طرف هم‌تراز بماند.
 */
.dmf-grid {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	margin-inline: calc(var(--dmf-gap-x, 14px) / -2);
}
.dmf-grid > * {
	flex: 0 0 auto;
	box-sizing: border-box;
	padding-inline: calc(var(--dmf-gap-x, 14px) / 2);
	margin-block-end: var(--dmf-gap-y, 14px);
	min-width: 0;
}

.dmf-col-20 { width: 20%; }
.dmf-col-25 { width: 25%; }
.dmf-col-30 { width: 30%; }
.dmf-col-33 { width: 33.3333%; }
.dmf-col-40 { width: 40%; }
.dmf-col-50 { width: 50%; }
.dmf-col-60 { width: 60%; }
.dmf-col-66 { width: 66.6667%; }
.dmf-col-70 { width: 70%; }
.dmf-col-75 { width: 75%; }
.dmf-col-80 { width: 80%; }
.dmf-col-100 { width: 100%; }

/* نام‌های نسخه‌های پیشین؛ مارکاپِ قدیمیِ کش‌شده یا قالبی که خودش این کلاس‌ها را می‌زند نباید بشکند. */
.dmf-col-full { width: 100%; }
.dmf-col-half { width: 50%; }
.dmf-field-wrap { display: flex; flex-direction: column; }
.dmf-field-wrap label { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.dmf-req { color: var(--dmf-danger); }
.dmf-form input[type=text],
.dmf-form input[type=email],
.dmf-form input[type=tel],
.dmf-form input[type=number],
.dmf-form input[type=file],
.dmf-form select,
.dmf-form textarea {
	width: 100%;
	padding: var(--dmf-ctl-pad, 10px 12px);
	/* 1.13.1: skinnable (RULES-DELTA §5) — the fallback IS the old literal, nothing moves on an existing site. */
	border: 1px solid var(--dmf-field-line, #cad0da);
	border-radius: var(--dmf-radius, 8px);
	background: var(--dmf-field, #fff);
	color: var(--dmf-field-ink, inherit);
	font-family: inherit;
	font-size: 14px;
	box-sizing: border-box;
}
.dmf-form textarea { resize: vertical; }

/*
 * ⚠⚠ ارتفاعِ یکسان — تصمیمِ قفل‌شدهٔ مالک (۲۰۲۶-۰۹-۲۲). پیش از این ارتفاعِ ورودی
 * از «فاصلهٔ درونی + ارتفاعِ خط» درمی‌آمد و ارتفاعِ دکمه از فاصلهٔ درونیِ دیگری
 * و قلمِ بزرگ‌ترِ خودش، پس دکمه همیشه چند پیکسل بلندتر از فیلدِ کنارش بود.
 * حالا هر دو از یک متغیر (`--dmf-ctl-h`) ارتفاع می‌گیرند، فاصلهٔ عمودیِ درونی
 * صفر است و متن در وسط می‌نشیند، و ضخامتِ حاشیه هم مشترک است (box-sizing
 * border-box، پس حاشیه داخلِ همان ارتفاع حساب می‌شود).
 * `min-height` است نه `height`: اگر کاربر اندازهٔ متنِ مرورگرش را بزرگ کرده
 * باشد، کنترل بزرگ می‌شود به‌جای اینکه متن بریده شود.
 */
.dmf-form input[type=text],
.dmf-form input[type=email],
.dmf-form input[type=tel],
.dmf-form input[type=number],
.dmf-form select {
	min-height: var(--dmf-ctl-h, 44px);
	padding-block: 0;
	padding-inline: var(--dmf-ctl-px, 12px);
	border-width: var(--dmf-border, 1px);
	line-height: 1.3;
}
.dmf-form textarea {
	padding-inline: var(--dmf-ctl-px, 12px);
	border-width: var(--dmf-border, 1px);
}
.dmf-form input[type=file] {
	min-height: var(--dmf-ctl-h, 44px);
	border-width: var(--dmf-border, 1px);
}
.dmf-form input:focus, .dmf-form select:focus, .dmf-form textarea:focus { outline: none; border-color: var(--dmf-accent); box-shadow: 0 0 0 3px rgba(62, 104, 255, .12); }
.dmf-choices { display: flex; flex-direction: column; gap: 6px; }
.dmf-choice { font-weight: 400; font-size: 14px; }

/*
 * ⚠ NEVER park a hidden element at a negative PHYSICAL offset. `left:-9999px` is harmless in LTR,
 * because leftward overflow is not scrollable — so it survives every LTR test and review. In an
 * RTL document the physical-left side IS the scrollable one, and this single declaration added
 * ~10,000px of empty width to every page carrying a form. MEASURED on a live RTL site:
 * documentElement.scrollWidth 11264 against a 1265px viewport, and 10389 against a 390px phone,
 * with the page draggable sideways into blank space. Neutralising this one element collapsed
 * scrollWidth to exactly clientWidth in both cases.
 *
 * The honeypot must still be invisible to a human and fillable by a bot, so it stays in the DOM
 * and in flow-position, CLIPPED rather than moved. `clip` is kept alongside `clip-path` for old
 * engines. Do not "simplify" this back to an offset.
 */
.dmf-hp {
	position: absolute !important;
	inset-inline-start: 0 !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

/*
 * A label that is present for assistive tech and invisible on screen. CLIPPED, in flow — the same
 * technique as .dmf-hp above and for the same reason: an offset would reintroduce the RTL
 * scroll-width bug. `:focus` is deliberately NOT restored here; this labels a field, it is not a
 * skip link, and nothing focuses it.
 */
.dmf-sr-only {
	position: absolute !important;
	inset-inline-start: 0 !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

.dmf-actions { margin-top: var(--dmf-gap-y, 16px); }
/*
 * ⚠ SKINNABLE, and this one was measured as unreadable on a real site. The BACKGROUND was already
 * a custom property, so a host theme could set its own accent — but the INK stayed a `#fff`
 * literal. On any theme whose accent is light (a cyan brand colour here) the label then measured
 * **1.66:1** against its own button, on the primary submit of every form the site ships. A
 * property that lets a theme change half a colour pair is worse than none: it invites exactly the
 * combination it cannot survive. `--dmf-on-accent` keeps #fff as its fallback, so nothing moves
 * for an existing install.
 */
/*
 * ⚠ عرضِ دکمه از کلاسِ درصدیِ خودش می‌آید. یک `width:100%` روی خودِ .dmf-submit
 * هم‌وزنِ `.dmf-col-25` است و چون پایین‌ترِ همین فایل نوشته شده، بی‌صدا برنده
 * می‌شد و دکمه هر عرضی که انتخاب می‌شد تمام‌عرض می‌ماند (اندازه‌گیری شد: ۶۴۰ از
 * ۶۴۰ در حالی که ۲۵٪ انتخاب بود). پس تمام‌عرض فقط برای دکمه‌ای می‌ماند که اصلاً
 * کلاسِ ستونی ندارد — یعنی مارکاپِ نسخه‌های پیشین.
 */
.dmf-submit:not([class*="dmf-col-"]) { width: 100%; }
/* حاشیهٔ شفاف با همان ضخامتِ ورودی‌ها: بدونِ آن، دکمه دو برابرِ ضخامتِ حاشیه کوتاه‌تر از فیلدِ کنارش می‌شد. */
.dmf-submit { min-height: var(--dmf-ctl-h, 44px); padding-block: 0; padding-inline: var(--dmf-btn-px, 18px); line-height: 1.3; border: var(--dmf-border, 1px) solid transparent; box-sizing: border-box; border-radius: var(--dmf-radius, 9px); background: var(--dmf-accent); color: var(--dmf-on-accent, #fff); font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s ease; }
.dmf-submit:hover { background: var(--dmf-accent-hover); }
.dmf-submit:disabled { opacity: .55; cursor: not-allowed; }
.dmf-submit.dmf-loading { opacity: .7; }

.dmf-form-msg { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
/*
 * ⚠ 1.13.1: these six names are PUBLIC (a host theme sets them) and an earlier version read them;
 * a later one hardcoded the literals and every dark theme's success/error box went back to a light
 * pastel with nothing erroring. Restored with the literals as fallbacks — never drop them again.
 */
.dmf-form-msg.dmf-ok { background: var(--dmf-ok-bg, #e7f4ec); color: var(--dmf-ok-ink, #1d7a52); border: 1px solid var(--dmf-ok-line, #bfe3cd); }
.dmf-form-msg.dmf-err { background: var(--dmf-err-bg, #faeaea); color: var(--dmf-err-ink, #a32d2d); border: 1px solid var(--dmf-err-line, #f0c4c4); }

/*
 * نقطهٔ شکستِ موبایل انتخابیِ خودِ فرم است، ولی به‌صورتِ کلاس نه متغیر: یک
 * media query نمی‌تواند مقدارِ یک متغیرِ CSS را بخواند، و تولیدِ یک بلوکِ
 * <style> به‌ازای هر فرم یعنی قواعدِ ظاهری از شیوه‌نامه بیرون بزنند. چهار
 * گزینهٔ ثابت همان کار را بدونِ آن هزینه می‌کند.
 */
/*
 * روی صفحهٔ کوچک دو رفتار هست و تیکِ «چیدمانِ اختصاصیِ موبایل» بینشان انتخاب می‌کند:
 * خاموش ⇒ همه‌چیز تمام‌عرض می‌شود (رفتارِ همیشگی). روشن ⇒ هر فیلد عرضِ موبایلِ
 * خودش را می‌گیرد و فیلدی که عرضِ موبایل ندارد دست‌نخورده می‌ماند.
 * ⚠ قواعدِ موبایل بعد از قواعدِ دسکتاپ می‌آیند و وزنشان یک کلاس بیشتر است، پس
 * همیشه برنده‌اند؛ روی مقدارِ دسکتاپ `!important` لازم نیست.
 */
/*
 * ⚠ تصمیمِ «چیدمانِ اختصاصیِ موبایل» مالِ هر فیلد است، نه مالِ کلِ فرم
 * (کاربر-تعیین ۲۰۲۶-۰۹-۲۰): معمولاً فقط یکی دو فیلد چیدمانِ ویژه می‌خواهند و
 * بقیه باید همان تمام‌عرضِ همیشگی بمانند. پس فیلدی که عرضِ موبایل دارد
 * (`dmf-mcol-*`) از قاعدهٔ تمام‌عرض شدن مستثنی می‌شود و بقیه دست‌نخورده
 * تمام‌عرض می‌شوند. هیچ کلیدِ سراسری‌ای در کار نیست.
 */
@media (max-width: 782px) {
	.dmf-break-782 .dmf-grid > *:not([class*="dmf-mcol-"]) { width: 100%; }
}
@media (max-width: 600px) {
	.dmf-break-600 .dmf-grid > *:not([class*="dmf-mcol-"]) { width: 100%; }
}
@media (max-width: 480px) {
	.dmf-break-480 .dmf-grid > *:not([class*="dmf-mcol-"]) { width: 100%; }
}
@media (max-width: 782px) {
	.dmf-grid > .dmf-mcol-20 { width: 20%; }
	.dmf-grid > .dmf-mcol-25 { width: 25%; }
	.dmf-grid > .dmf-mcol-30 { width: 30%; }
	.dmf-grid > .dmf-mcol-33 { width: 33.3333%; }
	.dmf-grid > .dmf-mcol-40 { width: 40%; }
	.dmf-grid > .dmf-mcol-50 { width: 50%; }
	.dmf-grid > .dmf-mcol-60 { width: 60%; }
	.dmf-grid > .dmf-mcol-66 { width: 66.6667%; }
	.dmf-grid > .dmf-mcol-70 { width: 70%; }
	.dmf-grid > .dmf-mcol-75 { width: 75%; }
	.dmf-grid > .dmf-mcol-80 { width: 80%; }
	.dmf-grid > .dmf-mcol-100 { width: 100%; }
}
@media (max-width: 480px) {
	.dmf-submit-block-sm { width: 100%; }
}

/* اندازهٔ کنترل‌ها: فقط فاصلهٔ درونی و قلمِ برچسب، نه ارتفاعِ ثابت — ارتفاعِ ثابت با متنِ بزرگ‌ترِ مرورگرِ کاربر می‌شکند. */
.dmf-size-compact { --dmf-ctl-pad: 7px 10px; }
.dmf-size-normal { --dmf-ctl-pad: 10px 12px; }
.dmf-size-comfy { --dmf-ctl-pad: 14px 16px; }
.dmf-size-compact .dmf-field-wrap > label { font-size: 13px; margin-bottom: 4px; }
.dmf-size-comfy .dmf-field-wrap > label { font-size: 15px; margin-bottom: 8px; }

/*
 * حالتِ «برچسب داخلِ فیلد» و «بدونِ برچسب»: برچسب فقط از چشم پنهان می‌شود و
 * هرگز از مارکاپ حذف نمی‌شود — یک ورودیِ بی‌نام برای صفحه‌خوان یعنی فرمی که
 * هیچ‌کس با فناوریِ کمکی نمی‌تواند پرش کند. همان تکنیکِ کلیپِ .dmf-sr-only،
 * نه جابه‌جاییِ فیزیکی (تلهٔ عرضِ اسکرول در RTL).
 */
.dmf-labels-inside .dmf-field-wrap > label,
.dmf-labels-hidden .dmf-field-wrap > label {
	position: absolute !important;
	inset-inline-start: 0 !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* دکمه: عرضش از کلاسِ ستونی می‌آید، پس عرضِ ۱۰۰٪ فقط داخلِ خانهٔ خودش معنی دارد. */
.dmf-actions { display: flex; }
.dmf-actions.dmf-align-start { justify-content: flex-start; }
.dmf-actions.dmf-align-center { justify-content: center; }
.dmf-actions.dmf-align-end { justify-content: flex-end; }
/* ⚠ عرضِ دکمه از همان کلاسِ درصدی می‌آید؛ یک `width:auto` اینجا آن را بی‌اثر می‌کرد. */
.dmf-actions .dmf-submit { min-width: 0; flex: 0 0 auto; }
.dmf-submit-inline { align-self: flex-end; }

/* دکمه: متن، آیکون یا هر دو. */
.dmf-submit { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.dmf-submit-icon { display: inline-flex; align-items: center; line-height: 0; }
.dmf-submit-icon svg { width: 18px; height: 18px; display: block; }
.dmf-submit-icon img { display: block; width: 18px; height: 18px; object-fit: contain; }
.dmf-sub-icon { gap: 0; }

/*
 * آیکونِ جهت‌دار (ارسال، پیکان) در صفحهٔ راست‌به‌چپ قرینه می‌شود؛ «جلو» در فارسی
 * سمتِ چپ است و هواپیمای کاغذی باید بالا-چپ را نشان دهد نه بالا-راست. جهت از خودِ
 * سند خوانده می‌شود، نه از زبانِ افزونه: همین فرم در یک سایتِ انگلیسی نباید قرینه
 * شود. سه انتخابگر برای سه منبعِ جهت: خاصیتِ dir روی html، کلاسِ rtl که وردپرس
 * روی body می‌گذارد، و :dir(rtl) برای جهتی که از والدِ نزدیک‌تر به ارث رسیده.
 * آیکونِ آپلودیِ کاربر قرینه نمی‌شود — نمی‌دانیم جهت‌دار است یا نه.
 */
html[dir="rtl"] .dmf-icon-dir svg,
body.rtl .dmf-icon-dir svg,
.dmf-is-rtl .dmf-icon-dir svg { transform: scaleX(-1); }
/* ⚠ جدا از قاعدهٔ بالا و عمداً: انتخابگرِ ناشناخته کلِ فهرستِ انتخابگرها را باطل می‌کند، و :dir() پیش از Chrome 120 وجود ندارد. */
.dmf-icon-dir:dir(rtl) svg { transform: scaleX(-1); }

/*
 * ⚠ رنگِ آیکون: یک شکل ممکن است با fill کشیده شده باشد و دیگری با stroke، و
 * هیچ‌کدام رنگِ دیگری را نمی‌گیرد. پس کاربر خودش انتخاب می‌کند کدام‌یک رنگ شود؛
 * حدس‌زدنِ ما یعنی آیکونی که رنگ عوض نمی‌کند و هیچ خطایی هم نمی‌دهد.
 * `!important` اینجا لازم است چون ویژگیِ presentational خودِ SVG (مثلاً
 * fill="#000" روی path) از هر قاعدهٔ CSS قوی‌تر نیست ولی روی عناصرِ درونی نشسته.
 */
.dmf-icon-paint-fill .dmf-submit-icon svg,
.dmf-icon-paint-fill .dmf-submit-icon svg * { fill: var(--dmf-icon-color, currentColor) !important; }
.dmf-icon-paint-stroke .dmf-submit-icon svg,
.dmf-icon-paint-stroke .dmf-submit-icon svg * { stroke: var(--dmf-icon-color, currentColor) !important; }

/*
 * آیکونِ داخلِ فیلد. ⚠ فاصلهٔ متن از آیکون با padding-inline-start ساخته می‌شود
 * و از متغیرِ فاصلهٔ درونیِ همان اندازهٔ کنترل مستقل است، وگرنه در حالتِ «فشرده»
 * متن روی آیکون می‌افتد. موقعیت با inset-inline-start است نه left، تا در RTL
 * سمتِ درست بنشیند.
 */
.dmf-input-wrap { position: relative; display: block; }
.dmf-field-icon {
	position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%);
	display: inline-flex; line-height: 0; pointer-events: none; color: var(--dmf-field-ink, #7a7d99);
}
.dmf-field-icon svg { width: 17px; height: 17px; display: block; }
.dmf-field-icon img { width: 17px; height: 17px; display: block; object-fit: contain; }
.dmf-has-icon .dmf-input-wrap input { padding-inline-start: 40px; }

/* برچسبِ خاموشِ یک فیلد: از چشم پنهان، در مارکاپ باقی. */
.dmf-label-off {
	position: absolute !important;
	inset-inline-start: 0 !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

form.dmf-form.dmf-form-single { max-width: 460px; width: 100%; margin: 0; }
.dmf-single-row {
	display: flex;
	align-items: stretch;
	background: #f4f5f7;
	border: 1px solid #e3e6ea;
	border-radius: 8px;
	overflow: hidden;
}
.dmf-single-field { flex: 1 1 auto; }
.dmf-form .dmf-single-field input {
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 0;
	background: transparent;
	padding: 10px 14px;
	font-size: 13px;
	box-sizing: border-box;
	direction: rtl;
	text-align: right;
}
.dmf-form .dmf-single-field input:focus { outline: none; box-shadow: none; }
.dmf-single-submit {
	flex: 0 0 auto;
	width: auto;
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 10px 18px;
	border-radius: 0;
	background: var(--dmf-single-accent);
	color: var(--dmf-single-on-accent, var(--dmf-on-accent, #fff));
	white-space: nowrap;
}
.dmf-single-submit:hover { background: var(--dmf-single-accent-hover); }
.dmf-single-submit svg { flex: 0 0 auto; transform: scaleX(-1); }
