/**
 * ورود با شماره موبایل — استایل کارت/مراحل/کدها + سیستم Toast + صفحات ادمین.
 *
 * @package Elementor_User_Panel
 */

/* ======================= کارت ورود ======================= */

.eup-login {
	display: flex;
	flex-direction: column;
	gap: 16px;
	background: #ffffff;
	border: 1px solid #e9ecef;
	border-radius: 16px;
	padding: 28px 24px;
	box-shadow: 0 10px 30px rgba( 15, 23, 42, 0.08 );
	box-sizing: border-box;
}

.eup-login *,
.eup-login *::before,
.eup-login *::after {
	box-sizing: border-box;
}

.eup-login-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
}

.eup-login-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba( 13, 110, 253, 0.1 );
	color: #0d6efd;
	font-size: 26px;
}

.eup-login-icon i,
.eup-login-icon svg {
	font-size: 26px;
	width: 26px;
	height: 26px;
}

.eup-login-icon svg {
	fill: currentColor;
}

.eup-login-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	color: #212529;
	line-height: 1.4;
}

.eup-login-subtitle {
	margin: 0;
	font-size: 14px;
	color: #6c757d;
	line-height: 1.8;
}

.eup-login-editor-notice {
	padding: 10px 12px;
	border-radius: 10px;
	background: #fff3cd;
	border: 1px solid #ffecb5;
	color: #664d03;
	font-size: 13px;
	line-height: 1.8;
}

/* ======================= مراحل فرم ======================= */

.eup-login-step {
	display: flex;
	flex-direction: column;
	margin: 0;
	animation: eup-login-in 0.28s ease;
}

/*
 * فاصله‌ها به جای gap با margin داده می‌شوند تا کنترل «فاصله برچسب تا فیلد»
 * (ویجت در المنتور) دقیقاً همان فاصله را تنظیم کند و با مقدار پیش‌فرض جمع نشود.
 */
.eup-login-step .eup-login-sent {
	margin: 0 0 12px;
}

.eup-login-step .eup-login-label {
	margin: 0 0 12px;
}

.eup-login-step .eup-login-otp {
	margin: 0 0 12px;
}

.eup-login-step .eup-login-help {
	margin: 0;
}

.eup-login-step .eup-login-actions,
.eup-login-step .eup-login-links {
	margin: 12px 0 0;
}

.eup-login-step[hidden] {
	display: none !important;
}

.eup-login-label {
	font-size: 14px;
	font-weight: 600;
	color: #343a40;
}

.eup-login-input {
	display: block;
	width: 100%;
	padding: 12px 14px;
	font-size: 16px;
	font-family: inherit;
	color: #212529;
	background: #ffffff;
	border: 1px solid #dee2e6;
	border-radius: 12px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.eup-login-input::placeholder {
	color: #adb5bd;
}

.eup-login-input:focus {
	outline: none;
	border-color: #0d6efd;
	/* حلقهٔ آبی اینجا hard-code نمی‌شود: از کنترل «حلقه تمرکز»
	 * (login_input_focus_ring) می‌آید تا قابل تغییر و حذف باشد. */
}

.eup-login-sent {
	margin: 0;
	padding: 10px 12px;
	border-radius: 10px;
	background: rgba( 13, 110, 253, 0.08 );
	color: #084298;
	font-size: 14px;
	line-height: 1.8;
	text-align: center;
}

.eup-login-help {
	margin: 0;
	font-size: 13px;
	color: #6c757d;
	line-height: 1.8;
	text-align: center;
}

/* ======================= کارت‌های کد ======================= */

.eup-login-otp {
	display: flex;
	justify-content: center;
	gap: 10px;
	direction: ltr;
}

/* سلکتورها با پیشوند .eup-login تقویت شده‌اند (specificity دو-کلاسی) تا رول
 * input[type="text"]ِ resetِ تم hello-elementor (یک-attribute + نوع) غلبه نداشته باشد:
 * پدینگ/حاشیه/عرض/گردی طراحی‌شده حفظ می‌شوند. */
.eup-login .eup-login-otp-box {
	width: 48px;
	height: 52px;
	padding: 0;
	font-size: 22px;
	font-weight: 700;
	font-family: inherit;
	font-variant-numeric: tabular-nums;
	text-align: center;
	color: #212529;
	background: #ffffff;
	border: 1px solid #dee2e6;
	border-radius: 12px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.eup-login .eup-login-otp-box:focus {
	outline: none;
	border-color: #0d6efd;
	/* حلقهٔ آبی اینجا hard-code نمی‌شود: از کنترل «حلقه تمرکز»
	 * (login_otp_focus_ring) می‌آید تا قابل تغییر و حذف باشد. */
}

@media (max-width: 480px) {
	.eup-login-otp {
		gap: 6px;
	}

	.eup-login .eup-login-otp-box {
		width: 40px;
		height: 46px;
		font-size: 19px;
	}
}

/* ======================= دکمه‌ها و لینک‌ها ======================= */

.eup-login-actions {
	display: flex;
}

.eup-login-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 13px 20px;
	font-size: 16px;
	font-weight: 700;
	font-family: inherit;
	color: #ffffff;
	background: #0d6efd;
	border: none;
	border-radius: 12px;
	box-shadow: 0 6px 16px rgba( 13, 110, 253, 0.25 );
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.eup-login-btn:hover {
	background: #0b5ed7;
}

.eup-login-btn:active {
	transform: translateY( 1px );
}

.eup-login-btn:focus-visible {
	outline: 2px solid #0d6efd;
	outline-offset: 2px;
}

.eup-login-btn.is-loading,
.eup-login-btn[disabled] {
	opacity: 0.85;
	cursor: wait;
}

.eup-login-btn.is-loading .eup-login-btn-text {
	opacity: 0.6;
}

.eup-login-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba( 255, 255, 255, 0.4 );
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: eup-login-spin 0.7s linear infinite;
}

.eup-login-btn.is-loading .eup-login-spinner {
	display: inline-block;
}

.eup-login-links {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 18px;
}

/* دکمه‌های لینک (ارسال مجدد / تغییر شماره): پیشوند .eup-login تا در تساوی
 * specificity با رول [type=button]ِ تم، ترتیب بارگذاری تعیین‌کننده نباشد. */
.eup-login .eup-login-link {
	padding: 4px 6px;
	font-size: 14px;
	font-family: inherit;
	color: #6c757d;
	background: none;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
	transition: color 0.15s ease;
}

.eup-login .eup-login-link:hover:not( :disabled ),
.eup-login .eup-login-link:focus:not( :disabled ) {
	color: #0d6efd;
}

.eup-login .eup-login-link:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.eup-login-link[hidden] {
	display: none !important;
}

/* ======================= حالت‌های خاص ======================= */

.eup-login-welcome {
	margin: 0;
	font-size: 15px;
	color: #495057;
	line-height: 2;
	text-align: center;
}

.eup-login--offline .eup-login-welcome {
	font-size: 14px;
	color: #b45309;
}

@keyframes eup-login-in {
	from {
		opacity: 0;
		transform: translateY( 6px );
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes eup-login-spin {
	to {
		transform: rotate( 360deg );
	}
}

@media (prefers-reduced-motion: reduce) {
	.eup-login-step,
	.eup-toast {
		animation: none !important;
		transition: none !important;
	}
}

/* ======================= سیستم Toast ======================= */

.eup-toast-container {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX( -50% );
	z-index: 999999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: min( 360px, calc( 100vw - 32px ) );
	pointer-events: none;
	font-family: inherit;
}

.eup-toast {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px 16px;
	background: #ffffff;
	border: 1px solid #e9ecef;
	border-inline-start: 4px solid #2563eb;
	border-radius: 14px;
	box-shadow: 0 12px 32px rgba( 15, 23, 42, 0.16 );
	overflow: hidden;
	pointer-events: auto;
	opacity: 0;
	transform: translateY( -14px ) scale( 0.97 );
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.eup-toast.is-visible {
	opacity: 1;
	transform: none;
}

.eup-toast.is-leaving {
	opacity: 0;
	transform: translateY( -10px ) scale( 0.97 );
}

.eup-toast--success {
	border-inline-start-color: #16a34a;
}

.eup-toast--error {
	border-inline-start-color: #dc2626;
}

.eup-toast--warning {
	border-inline-start-color: #d97706;
}

.eup-toast--info {
	border-inline-start-color: #2563eb;
}

.eup-toast-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 4px;
	border-radius: 50%;
	background: #2563eb;
}

.eup-toast--success .eup-toast-icon {
	background: #16a34a;
}

.eup-toast--error .eup-toast-icon {
	background: #dc2626;
}

.eup-toast--warning .eup-toast-icon {
	background: #d97706;
}

.eup-toast-icon svg {
	width: 100%;
	height: 100%;
	fill: #ffffff;
}

.eup-toast-msg {
	flex: 1;
	font-size: 14px;
	line-height: 1.8;
	color: #1f2937;
	word-break: break-word;
}

.eup-toast-close {
	flex: 0 0 auto;
	padding: 0 2px;
	font-size: 20px;
	line-height: 1;
	color: #9ca3af;
	background: none;
	border: none;
	cursor: pointer;
}

.eup-toast-close:hover,
.eup-toast-close:focus {
	color: #374151;
}

.eup-toast-bar {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 3px;
	background: #2563eb;
	transform-origin: right center;
	animation-name: eup-toast-countdown;
	animation-timing-function: linear;
	animation-fill-mode: forwards;
}

.eup-toast--success .eup-toast-bar {
	background: #16a34a;
}

.eup-toast--error .eup-toast-bar {
	background: #dc2626;
}

.eup-toast--warning .eup-toast-bar {
	background: #d97706;
}

.eup-toast:hover .eup-toast-bar {
	animation-play-state: paused;
}

@keyframes eup-toast-countdown {
	from {
		transform: scaleX( 1 );
	}

	to {
		transform: scaleX( 0 );
	}
}

/* ======================= صفحات ادمین ======================= */

.eup-admin-head h1 {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 4px;
	font-size: 20px;
	font-weight: 600;
}

.eup-admin-sub {
	margin: 0;
	color: #64748b;
}

.eup-badge {
	display: inline-block;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 999px;
	vertical-align: middle;
}

.eup-badge--ok {
	background: #dcfce7;
	color: #15803d;
}

.eup-badge--warn {
	background: #fef3c7;
	color: #b45309;
}

.eup-cards {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 200px, 1fr ) );
	gap: 14px;
	margin: 18px 0;
}

.eup-admin-card {
	padding: 16px 18px;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	box-shadow: 0 4px 14px rgba( 15, 23, 42, 0.05 );
}

.eup-admin-block {
	margin-bottom: 18px;
}

.eup-admin-block h2 {
	margin-top: 0;
	font-size: 15px;
	font-weight: 600;
}

.eup-admin-card h3 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 600;
	color: #64748b;
}

/* فقط مقدار مستقیم کارت‌ها (داشبورد)؛ توضیحات p.description نباید بولد/بزرگ شوند. */
.eup-admin-card > p:not( .description ) {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #0f172a;
}

.eup-card-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #cbd5e1;
}

.eup-card--ok .eup-card-dot {
	background: #16a34a;
	box-shadow: 0 0 0 4px rgba( 22, 163, 74, 0.15 );
}

.eup-card--warn .eup-card-dot {
	background: #f59e0b;
	box-shadow: 0 0 0 4px rgba( 245, 158, 11, 0.15 );
}

.eup-admin-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 16px 0;
}

.eup-admin-btn {
	display: inline-block;
	padding: 10px 18px;
	font-weight: 600;
	color: #ffffff !important;
	background: #0d6efd;
	border-radius: 10px;
	text-decoration: none;
	transition: filter 0.15s ease;
}

.eup-admin-btn:hover {
	filter: brightness( 0.95 );
}

.eup-admin-btn--ghost {
	color: #3730a3 !important;
	background: #eef2ff;
}

.eup-save-btn {
	padding: 6px 22px !important;
	border-radius: 10px !important;
}

.eup-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
}

.eup-switch input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.eup-switch-slider {
	position: absolute;
	inset: 0;
	background: #cbd5e1;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.eup-switch-slider::before {
	content: '';
	position: absolute;
	top: 3px;
	right: 3px;
	width: 18px;
	height: 18px;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.25 );
	transition: transform 0.2s ease;
}

.eup-switch input:checked + .eup-switch-slider {
	background: #0d6efd;
}

.eup-switch input:checked + .eup-switch-slider::before {
	transform: translateX( -20px );
}

.eup-switch input:focus + .eup-switch-slider {
	outline: 2px solid #0d6efd;
	outline-offset: 2px;
}

.eup-test-card form {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 10px;
}

.eup-test-card input[ type='tel' ] {
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	min-width: 200px;
}

/* --------------------------- خنثی‌ساز رنگ قرمز پوسته ---------------------------
   ریستِ تم (مثل Hello Elementor) روی :hover/:focus دکمه‌ها پس‌زمینهٔ #c36 می‌گذارد
   و با آپدیت پوسته برمی‌گردد. تخصصیت «body + عنصر + کلاس» (0-1-2) از ریستِ تم
   (0-1-1) بالاتر و از کنترل‌های رنگِ المنتور (0-2-0) و قواعد حالتِ خودِ فایل
   (:hover با 0-2-0) پایین‌تر است؛ پس نه قرمزی برمی‌گردد و نه رنگ سفارشی کاربر یا
   تیره‌شدن هاورِ خودِ دکمه از بین می‌رود. مقدار، عینِ قاعدهٔ پایهٔ همان کلاس است. */
body button.eup-login-btn {
	border: none;
	background-color: #0d6efd;
	color: #ffffff;
}

