/* ---------------------------------------------------------------------------
 * Mihan Melk — صفحهٔ ورود / ثبت‌نام
 *
 * بوم فیگما (login-1 و login-2):
 *   کارت ۴۲۴ عرض، شعاع ۱۶، سایهٔ 0 4 12 rgba(0,0,0,.08)، فاصلهٔ داخلی ۲۴
 *   سربرگ ۳۷۶×۷۲ با خط زیر ۱px #ededed، آیکون ۴۸ سمت راست، عنوان ۲۰/۶۰۰/۳۲
 *   توضیح ۱۶/۴۰۰/۲۴ در ۲۴ پیکسل زیر سربرگ
 *   فیلد ۳۷۶×۴۸ شعاع ۱۲ با لیبل روی خط (۱۴/۶۰۰) و ورودی ۱۲/۳۰۰
 *   دکمه ۳۷۶×۴۸ شعاع ۱۶
 * ------------------------------------------------------------------------ */

.mm-auth {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	padding-block: 80px;
	background: var(--mm-surface-page);
}

.mm-auth__card {
	width: 424px;
	max-width: 100%;
	padding: 24px;
	background: var(--mm-surface);
	border-radius: 16px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

/* ---------- سربرگ ---------- */

/*
 * در طرح، آیکون و عنوان کنار هم و چسبیده به لبهٔ آغاز (راست) هستند و
 * بالای کادر سربرگ می‌نشینند، نه وسط آن.
 */
.mm-auth__head {
	display: flex;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 12px;
	height: 72px;
	border-bottom: 1px solid var(--mm-border);
}

.mm-auth__head-icon {
	width: 48px;
	height: 48px;
	flex: none;
	order: -1;
}

.mm-auth__title {
	/* ۸ = (۴۸ آیکون − ۳۲ ارتفاع عنوان) ÷ ۲، تا عنوان با آیکون هم‌تراز شود. */
	margin: 8px 0 0;
	font-size: 20px;
	font-weight: var(--mm-fw-semibold);
	line-height: 32px;
	color: var(--mm-text);
}

/* ---------- توضیح ---------- */

.mm-auth__desc {
	margin: 24px 0 0;
	font-size: 16px;
	font-weight: var(--mm-fw-regular);
	line-height: 24px;
	color: var(--mm-text);
}

.mm-auth__desc--center {
	text-align: center;
}

.mm-auth__desc b {
	font-weight: var(--mm-fw-semibold);
	color: var(--mm-text);
	direction: ltr;
	display: inline-block;
}

.mm-auth__desc--error {
	color: var(--mm-danger);
}

/* ---------- فیلد با لیبل روی خط ---------- */

.mm-auth__field {
	position: relative;
	margin-top: 24px;
}

.mm-auth__label {
	position: absolute;
	top: -10px;
	/* لیبل روی خطِ کادر، چسبیده به لبهٔ آغاز (راست در فارسی). */
	inset-inline-start: 12px;
	z-index: 2;
	padding-inline: 6px;
	background: var(--mm-surface);
	font-size: 14px;
	font-weight: var(--mm-fw-semibold);
	line-height: 20px;
	color: var(--mm-text);
	white-space: nowrap;
}

/*
 * گزینشگر دوکلاسه لازم است: در base.css قاعدهٔ input[type="text"] با
 * ویژگی‌گزینشی بالاتر، اندازهٔ فونت را بازنویسی می‌کرد.
 */
.mm-auth__card .mm-auth__input {
	width: 100%;
	height: 48px;
	padding: 0 12px;
	background: transparent;
	border: 1px solid var(--mm-border);
	border-radius: 12px;
	font-family: inherit;
	font-size: 12px;
	font-weight: var(--mm-fw-light);
	color: var(--mm-text);
}

.mm-auth__card .mm-auth__input::placeholder {
	font-size: 12px;
	font-weight: var(--mm-fw-light);
	color: var(--mm-text-muted);
}

.mm-auth__card .mm-auth__input:focus {
	outline: none;
	border-color: var(--mm-primary);
	box-shadow: 0 0 0 3px rgba(6, 56, 190, .12);
}

.mm-auth__card .mm-auth__input--code {
	letter-spacing: .4em;
	text-align: center;
	font-size: 18px;
	font-weight: var(--mm-fw-semibold);
}

/* ---------- شمارش معکوس ---------- */

.mm-auth__timer {
	margin: 21px 0 0;
	font-size: 14px;
	font-weight: var(--mm-fw-semibold);
	line-height: 20px;
	text-align: center;
	color: var(--mm-text);
	direction: ltr;
}

.mm-auth__hint {
	margin: 22px 0 0;
	font-size: 14px;
	font-weight: var(--mm-fw-light);
	line-height: 20px;
	text-align: center;
	color: var(--mm-text-muted);
}

.mm-auth__resend {
	display: block;
	width: 100%;
	margin-top: 16px;
	padding: 0;
	background: none;
	border: 0;
	font-family: inherit;
	font-size: 14px;
	font-weight: var(--mm-fw-semibold);
	color: var(--mm-primary);
	cursor: pointer;
}

/* ---------- دکمه‌ها ---------- */

.mm-auth__submit {
	width: 100%;
	height: 48px;
	margin-top: 24px;
	border-radius: 16px;
	font-size: 16px;
	font-weight: var(--mm-fw-regular);
	line-height: 24px;
}

.mm-auth__submit.is-busy {
	opacity: .7;
	pointer-events: none;
}

.mm-auth__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 48px;
	margin-top: 24px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 16px;
	font-family: inherit;
	font-size: 16px;
	font-weight: var(--mm-fw-regular);
	line-height: 24px;
	color: var(--mm-primary);
	cursor: pointer;
}

.mm-auth__link:hover {
	background: var(--mm-blue-50);
}

/* ---------- «مرا به خاطر بسپار» ---------- */

.mm-auth__check {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	margin-top: 24px;
	font-size: 16px;
	font-weight: var(--mm-fw-regular);
	line-height: 24px;
	cursor: pointer;
}

.mm-auth__check input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.mm-auth__check-box {
	/* در طرح، مربع انتخاب سمت راست است و متن سمت چپ آن. */
	order: -1;
	width: 20px;
	height: 20px;
	flex: none;
	border-radius: 8px;
	box-shadow: inset 0 0 0 1px var(--mm-border);
	transition: background-color var(--mm-transition), box-shadow var(--mm-transition);
}

.mm-auth__check input:checked + .mm-auth__check-box {
	background: var(--mm-primary);
	box-shadow: inset 0 0 0 1px var(--mm-primary);
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5.5 10.5l3 3 6-6' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-size: 20px 20px;
}

.mm-auth__check input:focus-visible + .mm-auth__check-box {
	outline: 2px solid var(--mm-primary);
	outline-offset: 2px;
}

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

.mm-auth__error {
	margin: 12px 0 0;
	padding: 10px 12px;
	background: rgba(239, 68, 68, .08);
	border-radius: 12px;
	font-size: 14px;
	line-height: 20px;
	color: var(--mm-danger);
}

@media (max-width: 520px) {
	.mm-auth {
		padding-block: 40px;
	}

	.mm-auth__card {
		padding: 16px;
	}
}
