.novin-smsir-otp-widget {
	direction: rtl;
	text-align: right;
	font-family: inherit;
	box-sizing: border-box;
	max-width: 440px;
	margin: 18px 0;
	background: var(--novin-smsir-bg, #fff);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 14px;
	padding: 30px;
	animation: novinSmsirFadeIn .35s ease-out;
}
.novin-smsir-otp-widget * {
	box-sizing: border-box;
	font-family: inherit;
}

/* برای فرم‌های ورود (وردپرس/ووکامرس/پاپ‌آپ قالب) ویجت همیشه وسط‌چین است.
   در چک‌اوت، ویجت داخل ستون صورت‌حساب باقی می‌ماند و وسط‌چین نمی‌شود. */
.novin-smsir-otp-widget[data-context="wplogin"],
.novin-smsir-otp-widget[data-context="account"],
.novin-smsir-otp-widget[data-context="global"],
.novin-smsir-otp-widget[data-context="shortcode"] {
	margin-left: auto;
	margin-right: auto;
}

.novin-smsir-otp-widget[data-context="checkout"] {
	max-width: 100%;
	width: 100%;
	flex: 0 0 100%;
}

@keyframes novinSmsirFadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ===== سربرگ ===== */
.novin-smsir-otp-header {
	text-align: center;
	margin-bottom: 20px;
}
.novin-smsir-otp-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	font-size: 22px;
	margin-bottom: 8px;
	border-radius: 50%;
	background: rgba(0, 122, 255, 0.08);
}
.novin-smsir-otp-header h3 {
	margin: 0 0 5px;
	font-size: 18px;
	font-weight: 700;
}
.novin-smsir-otp-header p {
	margin: 0;
	font-size: 13.5px;
	opacity: .65;
	line-height: 1.7;
}

/* ===== مراحل ===== */
.novin-smsir-otp-step {
	animation: novinSmsirFadeIn .25s ease-out;
}

.novin-smsir-otp-row {
	display: flex;
	gap: 8px;
	justify-content: center;
}

.novin-smsir-mobile-input {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	height: 50px;
	border: 1.5px solid rgba(0, 0, 0, 0.12);
	border-radius: 10px;
	padding: 0 14px;
	font-size: 16px;
	background: transparent;
	direction: ltr;
	text-align: center;
	letter-spacing: .5px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.novin-smsir-mobile-input:focus {
	outline: none;
	border-color: #0d7bff;
	box-shadow: 0 0 0 3px rgba(13, 123, 255, .12);
}

/* ===== باکس‌های کد (فقط نمایشی) + اینپوت واقعی پنهان (برای پرشدن خودکار) ===== */
.novin-smsir-code-wrap {
	position: relative;
	margin-bottom: 12px;
}
.novin-smsir-code-boxes {
	display: flex;
	gap: 8px;
	direction: ltr;
	pointer-events: none;
	justify-content: center;
}
.novin-smsir-code-box {
	flex: 1 1 0;
	height: 52px;
	max-width: 58px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1.5px solid rgba(0, 0, 0, 0.12);
	border-radius: 10px;
	font-size: 20px;
	font-weight: 700;
	transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.novin-smsir-code-box.novin-smsir-filled {
	border-color: #17b26a;
	background: rgba(23, 178, 106, .06);
}
.novin-smsir-code-wrap.novin-smsir-code-focused .novin-smsir-code-box.novin-smsir-active {
	border-color: #0d7bff;
	box-shadow: 0 0 0 3px rgba(13, 123, 255, .12);
	transform: translateY(-1px);
}
/* اینپوت واقعی: نامرئی اما دقیقا روی باکس‌ها قرار دارد تا لمس/فوکوس/پرشدن خودکار پیامک کار کند */
.novin-smsir-code-real-input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	border: none;
	padding: 0;
	margin: 0;
	background: transparent;
	font-size: 16px; /* جلوگیری از زوم خودکار سافاری روی آیفون */
	direction: ltr;
	letter-spacing: 8px;
	z-index: 2;
}

.novin-smsir-code-actions {
	margin-bottom: 4px;
}

/* ===== دکمه‌ها ===== */
.novin-smsir-otp-btn {
	padding: 14px 18px;
	line-height: 1.3;
	border: none;
	border-radius: 10px;
	font-size: 14.5px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	flex: 1 1 auto;
	transition: transform .12s ease, opacity .12s ease, background-color .12s ease;
}
.novin-smsir-otp-btn:active:not(:disabled) {
	transform: scale(.97);
}
.novin-smsir-otp-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
}
.novin-smsir-otp-widget .novin-smsir-otp-btn-primary {
	background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
	color: #fff !important;
	flex: 0 0 auto;
	box-shadow: 0 3px 10px rgba(37, 99, 235, .35);
	border: none !important;
}
.novin-smsir-otp-widget .novin-smsir-otp-btn-primary:hover:not(:disabled) {
	background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
	box-shadow: 0 5px 16px rgba(37, 99, 235, .45);
}
.novin-smsir-otp-widget .novin-smsir-otp-btn-success {
	background: linear-gradient(135deg, #17b26a, #0e9c5a) !important;
	color: #fff !important;
	border: none !important;
	box-shadow: 0 3px 10px rgba(23, 178, 106, .3);
}
.novin-smsir-otp-widget .novin-smsir-otp-btn-success:hover:not(:disabled) {
	background: linear-gradient(135deg, #129a5a, #0b7f49) !important;
}
.novin-smsir-otp-widget .novin-smsir-otp-btn-secondary {
	background: rgba(0, 0, 0, .06) !important;
	color: inherit !important;
	border: none !important;
}
.novin-smsir-otp-widget .novin-smsir-otp-btn-secondary:hover:not(:disabled) {
	background: rgba(0, 0, 0, .1) !important;
}

.novin-smsir-otp-link {
	display: block;
	width: 100%;
	background: none;
	border: none;
	color: inherit;
	opacity: .6;
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
	margin-top: 10px;
	text-align: center;
	padding: 4px;
}
.novin-smsir-otp-link:hover {
	opacity: 1;
}

/* ===== تایمر ===== */
.novin-smsir-otp-timer {
	text-align: center;
	font-size: 11.5px;
	font-variant-numeric: tabular-nums;
	opacity: .55;
	margin-top: 8px;
	direction: ltr;
}
.novin-smsir-otp-timer.expired {
	color: #e5484d;
	opacity: .9;
}

/* ===== پیام وضعیت ===== */
.novin-smsir-otp-message {
	margin-top: 10px;
	padding: 8px 12px;
	border-radius: 8px;
	display: none;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	line-height: 1.7;
	white-space: normal;
	word-break: break-word;
	animation: novinSmsirFadeIn .2s ease-out;
}
.novin-smsir-otp-message.success {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 4px;
	background: rgba(23, 178, 106, .1);
	color: #128a52;
}
.novin-smsir-otp-message.error { display: block; background: rgba(229, 72, 77, .1); color: #d8393e; }
.novin-smsir-otp-message.info  { display: block; background: rgba(13, 123, 255, .1); color: #0d7bff; }

.novin-smsir-otp-note {
	font-size: 12px;
	opacity: .7;
	line-height: 1.8;
	margin-bottom: 14px;
}

.novin-smsir-box {
	max-width: 100%;
	margin: 18px 0;
	padding-top: 14px;
	border-top: 1px dashed rgba(0, 0, 0, .1);
}
.novin-smsir-box .novin-smsir-otp-message {
	margin-top: 0;
	text-align: right;
	font-size: 13px;
}

/* باز/بسته شدن فرم کلاسیک - عنصر بومی HTML، بدون نیاز به جاوااسکریپت برای کار کردن */
.novin-smsir-details {
	max-width: 380px;
	margin: 4px auto 18px;
	direction: rtl;
}
.novin-smsir-details summary {
	cursor: pointer;
	text-align: center;
	font-size: 12.5px;
	opacity: .6;
	text-decoration: underline;
	list-style: none;
	padding: 6px;
}
.novin-smsir-details summary::-webkit-details-marker { display: none; }
.novin-smsir-details summary:hover { opacity: 1; }
.novin-smsir-details[open] summary { margin-bottom: 10px; }
.woocommerce-checkout .novin-smsir-details {
	display: none; /* در چک‌اوت این بخش لازم نیست */
}

/* ===== دکمه ثبت سفارش قفل‌شده ===== */
#place_order.novin-smsir-disabled {
	opacity: .5;
	cursor: not-allowed;
	pointer-events: none;
}

/* ===== واکنش‌گرا و بزرگ‌تر برای موبایل ===== */
@media (max-width: 480px) {
	.novin-smsir-otp-widget {
		max-width: 100%;
		padding: 20px;
		border-radius: 12px;
	}
	.novin-smsir-otp-header {
		margin-bottom: 16px;
	}
	.novin-smsir-otp-icon {
		width: 40px;
		height: 40px;
		font-size: 18px;
	}
	.novin-smsir-otp-header h3 {
		font-size: 16px;
	}
	.novin-smsir-mobile-input {
		height: 48px;
		font-size: 14.5px;
	}
	.novin-smsir-otp-btn {
		padding: 13px 16px;
		font-size: 14.5px;
	}
	.novin-smsir-code-box {
		height: 46px;
		max-width: 50px;
		font-size: 18px;
	}
	.novin-smsir-code-wrap {
		margin-bottom: 12px;
	}
	.novin-smsir-otp-row {
		gap: 8px;
	}
}

@media (max-width: 340px) {
	.novin-smsir-code-boxes {
		gap: 6px;
	}
	.novin-smsir-code-box {
		max-width: 42px;
		height: 42px;
		font-size: 16px;
	}
}
