/**
 * Shahrokh Login - Elementor Widget Styles
 * استایل‌های ویجت با CSS Isolation کامل
 *
 * توجه: تمام селکتورها با .shahrokh-elementor-widget شروع می‌شوند
 * برای جلوگیری از تداخل با استایل‌های خارجی
 */

/* ==========================================================================
   1. Container & Reset
   ========================================================================== */

/**
 * Container اصلی ویجت
 * از تداخل با استایل قالب جلوگیری می‌کند
 */
.shahrokh-elementor-widget {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: #333;
	direction: rtl;
	text-align: right;
}

/**
 * Reset برای عناصر داخلی
 * جلوگیری از ارث‌بری استایل‌های ناخواسته
 */
.shahrokh-elementor-widget *,
.shahrokh-elementor-widget *::before,
.shahrokh-elementor-widget *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/**
 * Container فرم
 */
.shahrokh-elementor-widget .shahrokh-form-container {
	display: block;
	width: 100%;
	isolation: isolate; /* ایجاد stacking context جدید */
	padding: 30px;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   2. Phase 1 - Test Styles
   استایل‌های موقت برای تست ویجت
   ========================================================================== */

.shahrokh-elementor-widget .shahrokh-test-message {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #ffffff;
	padding: 30px;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
	text-align: center;
}

.shahrokh-elementor-widget .shahrokh-test-message h3 {
	margin: 0 0 15px 0;
	font-size: 24px;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.3;
}

.shahrokh-elementor-widget .shahrokh-test-message p {
	margin: 0 0 20px 0;
	font-size: 16px;
	color: rgba(255, 255, 255, 0.9);
	line-height: 1.6;
}

.shahrokh-elementor-widget .shahrokh-system-info {
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(10px);
	border-radius: 8px;
	padding: 20px;
	margin-top: 20px;
}

.shahrokh-elementor-widget .shahrokh-system-info ul {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: right;
}

.shahrokh-elementor-widget .shahrokh-system-info li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	font-size: 14px;
}

.shahrokh-elementor-widget .shahrokh-system-info li:last-child {
	border-bottom: none;
}

.shahrokh-elementor-widget .shahrokh-system-info strong {
	font-weight: 600;
	color: #ffffff;
}

.shahrokh-elementor-widget .shahrokh-system-info .status-ok {
	background: rgba(46, 213, 115, 0.2);
	color: #2ed573;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
}

/* ==========================================================================
   3. Phase 2 - Production Styles
   استایل‌های فرم ورود کامل
   ========================================================================== */

/* ----- Form Labels ----- */
:where(.shahrokh-elementor-widget) .shahrokh-label {
	display: block;
	line-height: 1.5;
}

/* ----- Form Steps ----- */
.shahrokh-elementor-widget .shahrokh-step {
	display: none;
	animation: fadeIn 0.3s ease-in-out;
}

.shahrokh-elementor-widget .shahrokh-step.active {
	display: block;
}

/* Editor Preview: کنترل نمایش steps با prefix_class */
.shahrokh-preview-step1 .shahrokh-editor-step1 {
	display: block !important;
}

.shahrokh-preview-step1 .shahrokh-editor-step2 {
	display: none !important;
}

.shahrokh-preview-step2 .shahrokh-editor-step1 {
	display: none !important;
}

.shahrokh-preview-step2 .shahrokh-editor-step2 {
	display: block !important;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ----- Input Group ----- */
.shahrokh-elementor-widget .shahrokh-input-group {
	margin-bottom: 20px;
}

.shahrokh-elementor-widget .shahrokh-input-group label {
	display: block;
	line-height: 1.5;
}

:where(.shahrokh-elementor-widget) .shahrokh-phone-input,
:where(.shahrokh-elementor-widget) .shahrokh-input-group input[type="tel"] {
	width: 100%;
	display: block;
	font-family: inherit;
	direction: ltr;
	text-align: left;
	transition: all 0.3s ease;
	outline: none !important;
}

:where(.shahrokh-elementor-widget) .shahrokh-phone-input::placeholder,
:where(.shahrokh-elementor-widget) .shahrokh-input-group input[type="tel"]::placeholder {
	direction: rtl;
	text-align: right;
}

/* ----- OTP Inputs ----- */
:where(.shahrokh-elementor-widget) .shahrokh-otp-container {
	display: flex;
	justify-content: center;
	margin-bottom: 25px;
	direction: ltr;
	flex-wrap: wrap;
}

:where(.shahrokh-elementor-widget) .shahrokh-otp-input {
	text-align: center;
	transition: all 0.3s ease;
	outline: none !important;
}

.shahrokh-elementor-widget .shahrokh-otp-input:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ----- Timer Box ----- */
:where(.shahrokh-elementor-widget) .shahrokh-timer-box {
	text-align: center;
	margin-bottom: 20px;
	display: none;
}

:where(.shahrokh-elementor-widget) .shahrokh-timer-box.active {
	display: block;
}

:where(.shahrokh-elementor-widget) .shahrokh-timer {
	font-family: inherit;
	direction: ltr;
	display: inline-block;
}

:where(.shahrokh-elementor-widget) .shahrokh-timer-text {
	margin-bottom: 6px;
}

/* ----- Actions / Buttons ----- */
.shahrokh-elementor-widget .shahrokh-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
}

:where(.shahrokh-elementor-widget) .shahrokh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.3s ease;
	outline: none !important;
	text-decoration: none !important;
	line-height: 1;
}

.shahrokh-elementor-widget .shahrokh-btn:disabled {
	opacity: 0.6 !important;
	cursor: not-allowed !important;
	transform: none !important;
}

.shahrokh-elementor-widget .shahrokh-btn.loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}

.shahrokh-elementor-widget .shahrokh-btn.loading::after {
	content: '';
	position: absolute;
	width: 18px;
	height: 18px;
	top: 50%;
	left: 50%;
	margin-left: -9px;
	margin-top: -9px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* ----- Message Box ----- */
:where(.shahrokh-elementor-widget) .shahrokh-message {
	line-height: 1.5;
	display: none;
	animation: slideDown 0.3s ease-in-out;
}

:where(.shahrokh-elementor-widget) .shahrokh-message.active {
	display: block;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ----- Responsive for Phase 2 ----- */
@media (max-width: 768px) {
	.shahrokh-elementor-widget .shahrokh-actions {
		flex-direction: column;
	}

	.shahrokh-elementor-widget .shahrokh-btn {
		width: 100%;
	}
}

@media (max-width: 480px) {
}

/* ==========================================================================
   4. Isolation Overrides
   بازنویسی استایل‌های احتمالی از قالب
   ========================================================================== */

/**
 * جلوگیری از تاثیر استایل‌های global قالب
 */
.shahrokh-elementor-widget input,
.shahrokh-elementor-widget button,
.shahrokh-elementor-widget select,
.shahrokh-elementor-widget textarea {
	background: none;
	border: none;
	outline: none;
	box-shadow: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

/**
 * Reset link styles
 */
.shahrokh-elementor-widget a {
	text-decoration: none;
	color: inherit;
	background: transparent;
	border: none;
	outline: none;
}

/**
 * Reset heading styles
 */
.shahrokh-elementor-widget h1,
.shahrokh-elementor-widget h2,
.shahrokh-elementor-widget h3,
.shahrokh-elementor-widget h4,
.shahrokh-elementor-widget h5,
.shahrokh-elementor-widget h6 {
	font-family: inherit;
	font-weight: inherit;
	line-height: inherit;
	margin: 0;
	padding: 0;
}

/* ==========================================================================
   5. Responsive
   ========================================================================== */

@media (max-width: 768px) {
	.shahrokh-elementor-widget .shahrokh-test-message {
		padding: 20px;
	}

	.shahrokh-elementor-widget .shahrokh-test-message h3 {
		font-size: 20px;
	}

	.shahrokh-elementor-widget .shahrokh-system-info {
		padding: 15px;
	}

	.shahrokh-elementor-widget .shahrokh-system-info li {
		flex-direction: column;
		align-items: flex-start;
		gap: 5px;
	}
}

/* ==========================================================================
   6. Print Styles
   ========================================================================== */

@media print {
	.shahrokh-elementor-widget {
		display: none;
	}
}
