/*
 *  فرم مشتری طرح تبدیل ۱۴۰۵
 *
 * استفاده از CSS Variables المنتور با fallback به مقادیر پیش‌فرض.
 * در صورت فعال بودن المنتور، رنگ‌های گلوبال از کیت طراحی شما استفاده می‌شود.
 */

.tt1405-form-wrap {
	--tt-primary: var(--e-global-color-primary, #2271b1);
	--tt-primary-hover: var(--e-global-color-accent, #135e96);
	--tt-text: var(--e-global-color-text, #2c3338);
	--tt-secondary: var(--e-global-color-secondary, #4f5b66);
	--tt-bg: #ffffff;
	--tt-bg-soft: #f6f7f9;
	--tt-border: #e0e3e7;
	--tt-success: #1a7f37;
	--tt-warning: #b54708;
	--tt-error: #c0392b;
	--tt-radius: 6px;

	font-family: var(--e-global-typography-text-font-family, inherit);
	color: var(--tt-text);
	margin: 24px 0;
	padding: 0;
	direction: rtl;
	width: 100%;
	box-sizing: border-box;
}

.tt1405-form {
	background: var(--tt-bg);
	border: 1px solid var(--tt-border);
	border-radius: var(--tt-radius);
	padding: 28px 32px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ----------- نوار پیشرفت ----------- */

.tt1405-progress {
	margin-bottom: 28px;
}

.tt1405-progress-bar {
	height: 8px;
	background: var(--tt-bg-soft);
	border-radius: 4px;
	overflow: hidden;
}

.tt1405-progress-fill {
	display: block;
	height: 100%;
	background: var(--tt-primary);
	transition: width 0.35s ease;
	width: 12.5%;
}

.tt1405-progress-text {
	margin-top: 8px;
	font-size: 13px;
	color: var(--tt-secondary);
	text-align: left;
}

/* ----------- مرحله ----------- */

.tt1405-step-title {
	margin: 0 0 20px;
	font-size: 18px;
	font-weight: 600;
	color: var(--tt-text);
	border-right: 4px solid var(--tt-primary);
	padding-right: 12px;
}

.tt1405-field {
	margin-bottom: 18px;
}

.tt1405-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 500;
	color: var(--tt-text);
}

.tt1405-field label small {
	color: var(--tt-secondary);
	font-weight: normal;
	margin-right: 4px;
}

.tt1405-input {
	width: 100%;
	padding: 11px 14px;
	font-size: 15px;
	font-family: inherit;
	color: var(--tt-text);
	background: var(--tt-bg);
	border: 1px solid var(--tt-border);
	border-radius: var(--tt-radius);
	box-sizing: border-box;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.tt1405-input:focus {
	outline: none;
	border-color: var(--tt-primary);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12);
}

.tt1405-input:disabled {
	background: var(--tt-bg-soft);
	cursor: not-allowed;
}

.tt1405-readonly {
	padding: 11px 14px;
	background: var(--tt-bg-soft);
	border: 1px solid var(--tt-border);
	border-radius: var(--tt-radius);
	color: var(--tt-text);
	min-height: 44px;
	line-height: 1.6;
}

/* ----------- لیست کیت‌ها ----------- */

.tt1405-kits-list {
	display: grid;
	gap: 10px;
	margin-bottom: 8px;
}

.tt1405-kit-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--tt-bg);
	border: 1px solid var(--tt-border);
	border-radius: var(--tt-radius);
	transition: border-color 0.2s, background 0.2s;
}

.tt1405-kit-option.is-selected {
	border-color: var(--tt-primary);
	background: rgba(34, 113, 177, 0.06);
}

.tt1405-kit-name {
	font-weight: 500;
}

.tt1405-kit-counter {
	font-size: 0.9em;
	color: var(--tt-muted, #666);
	margin-bottom: 10px;
}

.tt1405-qty {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.tt1405-kit-option .tt1405-qty button {
	flex: 0 0 auto;
	width: 40px;
	min-width: 40px;
	height: 40px;
	padding: 0 !important;
	margin: 0;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	font-size: 28px;
	line-height: 1 !important;
	font-weight: 700;
	cursor: pointer;
	transition: opacity 0.15s, transform 0.1s;
}

.tt1405-kit-option .tt1405-qty .tt1405-qty-plus {
	color: #1f9d57; /* سبز */
}

.tt1405-kit-option .tt1405-qty .tt1405-qty-minus {
	color: #d63638; /* قرمز */
}

.tt1405-kit-option .tt1405-qty button:hover:not(:disabled) {
	opacity: 0.7;
}

.tt1405-kit-option .tt1405-qty button:active:not(:disabled) {
	transform: scale(0.9);
}

.tt1405-kit-option .tt1405-qty button:disabled {
	color: #b5b9bf !important; /* خاکستری کم‌رنگ */
	cursor: not-allowed;
}

.tt1405-qty-val {
	min-width: 28px;
	text-align: center;
	font-weight: 700;
	font-size: 16px;
	color: var(--tt-text, #222);
}

/* ----------- جدول اطلاعات قبض ----------- */

.tt1405-bill-result,
.tt1405-postal-result {
	margin: 16px 0 0;
	padding: 14px;
	background: var(--tt-bg-soft);
	border-radius: var(--tt-radius);
}

.tt1405-info-table {
	width: 100%;
	border-collapse: collapse;
}

.tt1405-info-table th,
.tt1405-info-table td {
	padding: 8px 10px;
	text-align: right;
	font-size: 14px;
	border-bottom: 1px solid var(--tt-border);
}

.tt1405-info-table tr:last-child th,
.tt1405-info-table tr:last-child td {
	border-bottom: 0;
}

.tt1405-info-table th {
	width: 130px;
	color: var(--tt-secondary);
	font-weight: 500;
}

/* ----------- ردیف افقی (دکمه + اطلاعات) ----------- */

.tt1405-row-inline {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.tt1405-otp-info {
	font-size: 13px;
	color: var(--tt-secondary);
}

/* ----------- چک‌باکس قرارداد ----------- */

.tt1405-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 16px 0;
	cursor: pointer;
	font-size: 14px;
}

.tt1405-checkbox input {
	accent-color: var(--tt-primary);
	width: 16px;
	height: 16px;
}

/* ----------- جعبه قرارداد ----------- */

.tt1405-contract-box {
	max-height: 320px;
	overflow-y: auto;
	padding: 16px 20px;
	background: var(--tt-bg-soft);
	border: 1px solid var(--tt-border);
	border-radius: var(--tt-radius);
	font-size: 14px;
	line-height: 1.8;
	margin-bottom: 12px;
}

/* اجبار به ارث بردن فونت سایت در همه عناصر داخل قرارداد */
.tt1405-form-wrap .tt1405-contract-box,
.tt1405-form-wrap .tt1405-contract-box * {
	font-family: inherit !important;
	font-size: inherit !important;
}

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

.tt1405-actions {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--tt-border);
}

/* پایه - با specificity بالا برای غلبه بر استایل تم */
.tt1405-form-wrap .tt1405-btn,
.tt1405-form-wrap button.tt1405-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 26px;
	margin: 0;
	font-size: 14px;
	font-family: inherit;
	font-weight: 500;
	line-height: 1.5;
	color: var(--tt-text);
	background: var(--tt-bg);
	border: 1.5px solid var(--tt-border);
	border-radius: var(--tt-radius);
	cursor: pointer;
	text-decoration: none;
	text-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	min-height: auto;
	width: auto;
	height: auto;
	transition: all 0.2s ease;
}

.tt1405-form-wrap .tt1405-btn:hover {
	background: var(--tt-bg-soft);
	border-color: var(--tt-secondary);
	color: var(--tt-text);
}

.tt1405-form-wrap .tt1405-btn:focus {
	outline: 3px solid rgba(34, 113, 177, 0.18);
	outline-offset: 1px;
}

/* دکمه‌های اصلی (بعد، ثبت نهایی) - رنگ پررنگ تم */
.tt1405-form-wrap .tt1405-btn-primary,
.tt1405-form-wrap .tt1405-btn-next,
.tt1405-form-wrap button.tt1405-btn-primary,
.tt1405-form-wrap button.tt1405-btn-next {
	background: var(--tt-primary);
	color: #ffffff;
	border-color: var(--tt-primary);
}

.tt1405-form-wrap .tt1405-btn-primary:hover,
.tt1405-form-wrap .tt1405-btn-next:hover {
	background: var(--tt-primary-hover);
	border-color: var(--tt-primary-hover);
	color: #ffffff;
}

/* دکمه‌های ثانویه (دریافت کد تأیید، استعلام) - خاکستری روشن */
.tt1405-form-wrap .tt1405-btn-secondary,
.tt1405-form-wrap button.tt1405-btn-secondary {
	background: var(--tt-bg-soft);
	color: var(--tt-text);
	border-color: var(--tt-border);
}

.tt1405-form-wrap .tt1405-btn-secondary:hover {
	background: #ebedf0;
	border-color: var(--tt-secondary);
	color: var(--tt-text);
}

/* دکمه «قبل» - سبک باز و کم‌برجسته */
.tt1405-form-wrap .tt1405-btn-prev,
.tt1405-form-wrap button.tt1405-btn-prev {
	background: transparent;
	color: var(--tt-secondary);
	border-color: var(--tt-border);
	font-weight: 400;
}

.tt1405-form-wrap .tt1405-btn-prev:hover {
	background: var(--tt-bg-soft);
	color: var(--tt-text);
	border-color: var(--tt-secondary);
}

.tt1405-form-wrap .tt1405-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	pointer-events: none;
}

/* ----------- پیام‌ها ----------- */

.tt1405-msg {
	padding: 10px 14px;
	border-radius: var(--tt-radius);
	font-size: 14px;
	margin: 12px 0;
}

.tt1405-msg.is-success { background: #e6f7ec; color: var(--tt-success); border-right: 3px solid var(--tt-success); }
.tt1405-msg.is-warning { background: #fff7e6; color: var(--tt-warning); border-right: 3px solid var(--tt-warning); }
.tt1405-msg.is-error   { background: #fdecea; color: var(--tt-error); border-right: 3px solid var(--tt-error); }
.tt1405-msg.is-info    { background: #e7f1ff; color: var(--tt-primary); border-right: 3px solid var(--tt-primary); }

/* Toast پیام موقت */
.tt1405-toast {
	position: fixed;
	bottom: 20px;
	right: 50%;
	transform: translateX(50%);
	padding: 12px 20px;
	background: rgba(0, 0, 0, 0.85);
	color: #fff;
	border-radius: var(--tt-radius);
	font-size: 14px;
	z-index: 10000;
	max-width: 90%;
	text-align: center;
}

/* ----------- پیام موفقیت ----------- */

.tt1405-step-success {
	text-align: center;
	padding: 24px 0;
}

.tt1405-success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: var(--tt-success);
	color: #ffffff;
	font-size: 40px;
	font-weight: bold;
	margin-bottom: 18px;
}

.tt1405-success-text {
	font-size: 16px;
	line-height: 1.9;
	color: var(--tt-text);
	max-width: 480px;
	margin: 0 auto;
}

/* ----------- موبایل ----------- */

@media (max-width: 600px) {
	.tt1405-form {
		padding: 20px 16px;
	}

	.tt1405-form-wrap {
		margin: 16px auto;
		padding: 0 12px;
	}

	.tt1405-step-title {
		font-size: 16px;
	}

	.tt1405-input {
		font-size: 16px; /* جلوگیری از zoom در iOS */
	}

	.tt1405-actions {
		flex-direction: row;
	}

	.tt1405-btn {
		padding: 12px 18px;
		font-size: 14px;
		flex: 1;
	}

	.tt1405-info-table th {
		width: 100px;
		font-size: 13px;
	}
}

/* ----------- جلوگیری از تداخل با Loading ----------- */

.tt1405-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* استایل حوزه‌های انتخاب‌شده در فرم نصاب (مرحله ۲) */
.tt1405-selected-areas {
	margin-top: 8px;
	padding: 10px 12px;
	background: #f6f7f7;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	min-height: 40px;
}
.tt1405-selected-areas .tt1405-empty {
	margin: 0;
	color: #888;
	font-size: 13px;
}
.tt1405-selected-province {
	margin: 6px 0;
	line-height: 2;
}
.tt1405-selected-province strong {
	color: #2271b1;
	margin-left: 4px;
}
.tt1405-selected-chip {
	display: inline-block;
	padding: 3px 10px;
	margin: 2px 4px 2px 0;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 14px;
	font-size: 13px;
}
.tt1405-selected-chip a {
	text-decoration: none;
	color: #d63638;
	font-weight: bold;
	margin-right: 4px;
	font-size: 14px;
	line-height: 1;
}
.tt1405-selected-chip a:hover {
	color: #a00;
}
.tt1405-step-desc {
	color: #555;
	font-size: 13px;
	margin: -4px 0 12px;
}
.tt1405-success-box {
	text-align: center;
	padding: 30px 20px;
	background: #f0f9f4;
	border: 1px solid #b6e2c8;
	border-radius: 8px;
}
.tt1405-success-msg {
	font-size: 15px;
	line-height: 2;
	margin: 12px 0 0;
}
.tt1405-success-msg strong {
	color: #00733d;
	font-size: 17px;
	margin: 0 4px;
}
