.dml-hidden { display: none !important; }

.dml-hp-wrap { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

.dml-modal-overlay {
	position: fixed; inset: 0; background: rgba(20, 20, 30, .5);
	-webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
	display: flex; align-items: center; justify-content: center; z-index: 99999;
	animation: dml-fade-in .15s ease;
}
@keyframes dml-fade-in { from { opacity: 0; } to { opacity: 1; } }

.dml-modal-box {
	background: #fff; width: 360px; max-width: 92vw; border-radius: 18px; overflow: hidden;
	box-shadow: 0 20px 60px rgba(15, 15, 25, .25); direction: rtl;
	/* TODO: vendor Vazirmatn WOFF2 into assets/fonts/ and @font-face it here — see +FONT rule. Currently relies on Vazirmatn being available site-wide (e.g. via a base theme) or falls back to system fonts. */
	font-family: 'Vazirmatn', 'IRANSansX', Tahoma, Arial, sans-serif;
	box-sizing: border-box;
	animation: dml-pop-in .18s cubic-bezier(.2, .9, .3, 1);
}
.dml-modal-box * { box-sizing: border-box; }
@keyframes dml-pop-in { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }

.dml-modal-header {
	display: flex; justify-content: space-between; align-items: center;
	padding: 18px 20px; border-bottom: 1px solid #f1f1f4;
}
.dml-title { margin: 0; font-size: 16px; font-weight: 700; color: #23233a; }
.dml-close {
	background: #f5f5f8; border: none; width: 30px; height: 30px; border-radius: 50%;
	font-size: 18px; cursor: pointer; color: #7a7a85; line-height: 1;
	display: flex; align-items: center; justify-content: center;
	transition: background .15s ease, color .15s ease;
}
.dml-close:hover { background: #ececf1; color: #23233a; }
.dml-modal-body { padding: 20px; }

.dml-tabs { display: flex; gap: 4px; margin-bottom: 18px; background: #f4f4f7; padding: 4px; border-radius: 12px; }
.dml-mtab {
	flex: 1; padding: 9px 8px; border: none; border-radius: 9px; background: transparent;
	cursor: pointer; font-size: 13px; font-weight: 500; color: #6c6c78;
	transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.dml-mtab-active { background: #fff; color: var(--dml-primary); font-weight: 700; box-shadow: 0 2px 8px rgba(20, 20, 30, .08); }

.dml-field-label { display: block; font-size: 12.5px; color: #5a5a64; margin: 0 0 7px; }
.dml-input {
	width: 100%; box-sizing: border-box; height: 46px; border: 1.5px solid #e4e4ea; border-radius: 10px;
	padding: 0 14px; margin-bottom: 14px; font-size: 14px; background: #fbfbfd;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.dml-input:focus { border-color: var(--dml-primary); outline: none; background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--dml-primary) 12%, transparent); }

.dml-boxes { display: flex; gap: 8px; justify-content: center; margin: 8px 0 16px; width: 100%; }
.dml-box {
	flex: 1 1 0; min-width: 0; width: auto; max-width: 48px; height: 50px; text-align: center;
	border: 1.5px solid #e4e4ea; border-radius: 10px; font-size: 18px; font-weight: 600;
	box-sizing: border-box; padding: 0; background: #fbfbfd; color: #23233a;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.dml-box:focus { border-color: var(--dml-primary); outline: none; background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--dml-primary) 12%, transparent); }

.dml-error { color: #d33; font-size: 12px; min-height: 16px; margin-bottom: 8px; }

.dml-btn {
	width: 100%; height: 48px; border: none; border-radius: 12px; background: var(--dml-primary);
	color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; position: relative;
	transition: filter .15s ease, transform .1s ease, box-shadow .15s ease;
	box-shadow: 0 6px 16px color-mix(in srgb, var(--dml-primary) 30%, transparent);
}
.dml-btn:hover { filter: brightness(1.06); }
.dml-btn:active { transform: translateY(1px); }
.dml-btn:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.dml-loader {
	display: none; width: 17px; height: 17px; border: 2px solid rgba(255, 255, 255, .5);
	border-top-color: #fff; border-radius: 50%; animation: dml-spin .7s linear infinite;
	position: absolute; top: 50%; inset-inline-start: 16px; margin-top: -8.5px;
}
.dml-btn.dml-loading .dml-btn-text { visibility: hidden; }
.dml-btn.dml-loading .dml-loader { display: inline-block; }
@keyframes dml-spin { to { transform: rotate(360deg); } }

.dml-otp-note { font-size: 13px; text-align: center; margin-bottom: 14px; color: #6c6c78; line-height: 1.7; }
.dml-otp-row { display: flex; justify-content: space-between; margin-bottom: 14px; }
/* .dml-link is now also used on <button type="button"> (step-otp.php/step-password.php, per SEO-SEMANTICS: click-only controls must be <button> not <a href="#">) — reset native button chrome so it still reads as a text link. */
/* ⚠ اندازه‌گیری‌شده روی ۳۷۵ پیکسل: بدونِ این، هر سه کنترلِ متنی (ویرایش شماره،
   ارسال مجدد، «فعلاً نه») ارتفاعِ ۱۷ پیکسل داشتند — زیرِ کفِ ۲۴×۲۴ هدفِ لمسی.
   حاشیهٔ منفی، فاصلهٔ بصریِ قبلی را دست‌نخورده نگه می‌دارد. */
.dml-link { background: none; border: 0; padding: 4px 6px; margin: -4px -6px; font: inherit; font-size: 12.5px; color: var(--dml-primary); text-decoration: none; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; min-height: 24px; }
.dml-link:hover { text-decoration: underline; }
/* ⚠ اندازه‌گیری‌شده: #9a9aa3 روی سفید نسبتِ ۲٫۷۹ می‌دهد و رد می‌شود. «فعلاً نه»
   تنها راهِ خروجِ کسی است که کد ندارد، پس کنترلِ کم‌کنتراست اینجا هزینهٔ واقعی دارد. */
.dml-link-muted { color: #6c6c78; }
.dml-link.dml-disabled { pointer-events: none; color: #c6c6cd; }
.dml-footer-text { font-size: 12px; color: #6c6c78; text-align: center; margin-top: 14px; line-height: 1.7; }
.dml-footer-text a { color: var(--dml-primary); }

.dml-trigger-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font: inherit; }
.dml-account { display: inline-flex; align-items: center; gap: 8px; }
.dml-account-link { text-decoration: none; }
.dml-account-icon { width: 24px; height: 24px; }

/* نامِ دسترس‌پذیرِ دکمه در حالتِ «فقط آیکن»: از دید پنهان، برای صفحه‌خوان موجود.
   ⚠ display:none نه — آن، متن را از درختِ دسترس‌پذیری هم حذف می‌کند. */
.dml-btn-wrap .screen-reader-text {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.dml-btn-wrap { display: block; }
.dml-align-right { text-align: right; }
.dml-align-center { text-align: center; }
.dml-align-left { text-align: left; }
.dml-cta {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	cursor: pointer; text-decoration: none; box-sizing: border-box;
	background: var(--dml-btn-bg, transparent); color: var(--dml-btn-color, #000);
	border: var(--dml-btn-bw, 1px) solid var(--dml-btn-border, transparent);
	border-radius: var(--dml-btn-radius, 10px);
	padding: var(--dml-btn-pad, 8px) calc(var(--dml-btn-pad, 8px) + 8px);
	font-size: var(--dml-btn-size, 14px); font-family: inherit; line-height: 1.6; font-weight: 600;
	transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.dml-cta:hover, .dml-cta:focus-visible {
	background: var(--dml-btn-hover, var(--dml-btn-bg, transparent));
	color: var(--dml-btn-hover-color, var(--dml-btn-color, #000));
	border-color: var(--dml-btn-border-hover, var(--dml-btn-border, transparent));
}
.dml-cta:focus-visible { outline: 2px solid var(--dml-btn-hover-color, currentColor); outline-offset: 2px; }
.dml-cta:active { transform: translateY(1px); }
.dml-cta .dml-account-icon { width: var(--dml-btn-icon, 22px); height: var(--dml-btn-icon, 22px); flex: none; }
/* آیکن‌های خطی: ضخامتِ خط باید با اندازه بالا برود وگرنه در ۳۲ پیکسل محو می‌شود.
   آیکن‌های توپر stroke ندارند و این هیچ اثری رویشان نمی‌گذارد. */
.dml-cta .dml-account-icon { stroke-width: 1.6; }
.dml-account-icon-img { object-fit: contain; }

/* جعبه‌ی مربعیِ «فقط آیکن»: عرض و ارتفاع هر دو از یک متغیر، پس همیشه مربعِ دقیق است
   و پدینگ داخلی آن را نامتوازن نمی‌کند (box-sizing:border-box بالاتر ست شده). */
.dml-cta-icon-only {
	width: var(--dml-btn-box, 42px); height: var(--dml-btn-box, 42px);
	padding: var(--dml-btn-pad, 8px); gap: 0;
}
.dml-align-full .dml-cta { width: 100%; justify-content: center; }
.dml-align-full .dml-cta-icon-only { width: var(--dml-btn-box, 42px); }

/* حالتِ کشویی دکمه (کاربر واردشده) — همان دکمه، با منوی حساب کاربری زیرِ آن.
   خصوصیت‌های منطقی چون هدرِ سایت هم RTL است هم ممکن است LTR باشد. */
.dml-account-dd { position: relative; display: inline-block; }
.dml-account-dd .dml-dd-caret { transition: transform .18s ease; flex: none; }
.dml-account-dd.is-open .dml-dd-caret { transform: rotate(180deg); }
.dml-dd-menu {
	position: absolute; top: calc(100% + 6px); z-index: 1000;
	min-width: 210px; max-width: calc(100vw - 24px); margin: 0; padding: 8px 0; list-style: none;
	background: #fff; border-radius: 12px; box-shadow: 0 8px 28px rgba(16, 16, 36, .16);
	opacity: 0; visibility: hidden; transform: translateY(8px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
	text-align: start;
}
/* موقعیتِ منو انتخابِ مدیر است و فیزیکی می‌ماند، نه منطقی: مدیر «راست/وسط/چپ» را روی
   هدرِ واقعیِ خودش می‌بیند و انتخاب می‌کند؛ خصوصیتِ منطقی با تغییرِ جهتِ قالب زیرِ پایش
   جابه‌جا می‌شد و انتخابش معنای دیگری پیدا می‌کرد. */
.dml-dd-pos-right .dml-dd-menu { right: 0; left: auto; }
.dml-dd-pos-left .dml-dd-menu { left: 0; right: auto; }
.dml-dd-pos-center .dml-dd-menu { left: 50%; right: auto; transform: translate(-50%, 8px); }
.dml-account-dd.is-open .dml-dd-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dml-dd-pos-center.is-open .dml-dd-menu { transform: translate(-50%, 0); }
/* گذرگاهِ ماوس بین دکمه و منو: بدون این نوار ۶ پیکسلی، در حالتِ هاور منو درست وسطِ
   حرکتِ اشاره‌گر بسته می‌شود. */
.dml-account-dd::after { content: ""; position: absolute; inset-inline: 0; top: 100%; height: 8px; display: none; }
.dml-account-dd.is-open::after { display: block; }
.dml-dd-user { padding: 8px 18px 10px; margin-bottom: 6px; border-bottom: 1px solid #ececf1; font-size: 13px; color: #6c6c78; }
.dml-dd-user strong { color: #2c2c38; }
.dml-dd-item {
	display: block; padding: 10px 18px; min-height: 24px; line-height: 1.6;
	font-size: 14px; color: #2c2c38; text-decoration: none;
}
.dml-dd-item:hover, .dml-dd-item:focus { background: #f4f4f8; color: #2c2c38; text-decoration: none; }
.dml-dd-item.is-active { color: var(--dml-primary); font-weight: 700; }
.dml-dd-sep { height: 1px; margin: 6px 0; background: #ececf1; }
.dml-dd-logout { color: #b02a30; }
.dml-dd-logout:hover, .dml-dd-logout:focus { color: #b02a30; background: #fdf1f1; }

/* گامِ «کد معرف» — عیناً از ماکاپِ تاییدشده: prd/dm-login-referral/ */
.dml-ref-input { text-transform: uppercase; letter-spacing: .14em; text-align: center; font-weight: 700; margin-bottom: 8px; }
.dml-ref-hint { font-size: 12px; color: #6c6c78; text-align: center; margin: 0 0 14px; line-height: 1.7; }
.dml-ref-skip-row { display: flex; justify-content: center; margin-top: 10px; }
.dml-ref-state { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; font-size: 12.5px; line-height: 1.8; margin-bottom: 14px; }
.dml-ref-state-ok { background: #eafaf1; color: #0f7a4d; }
.dml-ref-state-warn { background: #fff6e5; color: #8a5a00; }
.dml-ref-state-icon { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 3px; }
.dml-ref-state-body { min-width: 0; }
.dml-ref-state-title { display: block; font-weight: 700; margin-bottom: 2px; }
.dml-ref-lock { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid currentColor; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; margin-top: 6px; }
.dml-ref-code-chip { display: inline-block; background: #fff; border: 1px dashed currentColor; border-radius: 8px; padding: 2px 10px; font-weight: 700; letter-spacing: .12em; margin-inline-start: 4px; }
.dml-ref-out { display: block; text-align: center; font-size: 12.5px; margin-top: 10px; color: var(--dml-primary); font-weight: 600; text-decoration: none; padding: 6px; min-height: 24px; }
