/**
 * استایل پنل کاربر محدود (contracter.admin)
 * طراحی هماهنگ با فرانت‌اند افزونه
 */

.msc-contracter-wrap {
	max-width: 960px;
	margin: 0 auto;
	font-family: var(--msc-font, 'Vazirmatn', 'IRANSans', Tahoma, 'Segoe UI', sans-serif);
	color: var(--msc-text, #2c3338);
	line-height: 1.9;
}

.msc-ct-hidden { display: none !important; }

/* ===== فرم ورود ===== */
.msc-ct-login-card {
	max-width: 420px;
	margin: 40px auto;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 8px 30px rgba(30, 58, 95, 0.14);
	border-top: 4px solid var(--msc-accent, #c9a55c);
	padding: 34px 32px;
}

.msc-ct-login-header {
	text-align: center;
	margin-bottom: 26px;
}

.msc-ct-login-header .msc-ct-login-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--msc-primary, #1e3a5f), #2c517a);
	color: #fff;
	font-size: 30px;
	margin-bottom: 12px;
}

.msc-ct-login-header h2 {
	margin: 0 0 6px;
	color: var(--msc-primary, #1e3a5f);
	font-size: 20px;
}

.msc-ct-login-header p {
	margin: 0;
	color: var(--msc-text-soft, #5a6470);
	font-size: 13px;
}

/* ===== فرم‌ها ===== */
.msc-ct-field { margin-bottom: 18px; }

.msc-ct-field label {
	display: block;
	font-weight: 700;
	font-size: 13px;
	margin-bottom: 7px;
	color: var(--msc-text, #2c3338);
}

.msc-ct-input {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid var(--msc-border, #e1e5ea);
	border-radius: 8px;
	background: #fafbfc;
	font-family: inherit;
	font-size: 14px;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}

.msc-ct-input:focus {
	outline: none;
	border-color: var(--msc-primary, #1e3a5f);
	box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
	background: #fff;
}

textarea.msc-ct-input {
	resize: vertical;
	min-height: 80px;
}

.msc-ct-req { color: #c0392b; }

.msc-ct-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 640px) {
	.msc-ct-grid-2 { grid-template-columns: 1fr; }
}

/* ===== دکمه‌ها ===== */
.msc-btn.msc-btn-primary,
.msc-btn.msc-btn-secondary {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	justify-content: center;
	padding: 10px 22px;
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	border: 1.5px solid transparent;
	transition: all 0.2s;
}

.msc-btn.msc-btn-primary {
	background: var(--msc-primary, #1e3a5f);
	color: #fff;
}

.msc-btn.msc-btn-primary:hover {
	background: #2c517a;
	box-shadow: 0 4px 14px rgba(30, 58, 95, 0.3);
}

.msc-btn.msc-btn-primary:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.msc-btn.msc-btn-secondary {
	background: #fff;
	color: var(--msc-primary, #1e3a5f);
	border-color: var(--msc-border, #e1e5ea);
}

.msc-btn.msc-btn-secondary:hover {
	border-color: var(--msc-primary, #1e3a5f);
	background: #f5f8fc;
}

/* ===== پیام‌ها ===== */
.msc-ct-message {
	display: none;
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 16px;
	font-size: 13px;
	font-weight: 600;
}

.msc-ct-message.success {
	background: var(--msc-success-bg, #e8f5ee);
	color: var(--msc-success, #2d8659);
	border: 1px solid #b7e0c9;
}

.msc-ct-message.error {
	background: #fdecea;
	color: #c0392b;
	border: 1px solid #f2b7ae;
}

.msc-ct-toast {
	position: fixed;
	top: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: #2c3338;
	color: #fff;
	padding: 10px 22px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	z-index: 99999;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.msc-ct-toast-success { background: var(--msc-success, #2d8659); }
.msc-ct-toast-error { background: #c0392b; }

/* ===== اعلان‌ها ===== */
.msc-ct-notice {
	padding: 14px 18px;
	border-radius: 10px;
	margin-bottom: 20px;
	font-size: 13px;
	line-height: 1.9;
}

.msc-ct-notice-warning {
	background: #fff8e1;
	border: 1px solid #ffe082;
	border-right: 4px solid #c9a55c;
	color: #6b5a1f;
}

/* ===== داشبورد ===== */
.msc-ct-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	background: linear-gradient(135deg, var(--msc-primary, #1e3a5f), #2c517a);
	color: #fff;
	border-radius: 14px;
	padding: 22px 26px;
	margin-bottom: 24px;
	box-shadow: 0 8px 24px rgba(30, 58, 95, 0.22);
	flex-wrap: wrap;
}

.msc-ct-header-info h2 {
	margin: 0 0 6px;
	font-size: 19px;
	color: #fff;
}

.msc-ct-header-info p {
	margin: 0;
	font-size: 12.5px;
	opacity: 0.85;
	max-width: 560px;
}

.msc-ct-header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.msc-ct-user-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.25);
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 12.5px;
	font-weight: 600;
}

.msc-ct-header-actions .msc-btn.msc-btn-secondary {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.35);
	padding: 6px 16px;
	font-size: 12.5px;
}

.msc-ct-header-actions .msc-btn.msc-btn-secondary:hover {
	background: rgba(255, 255, 255, 0.2);
}

/* ===== بخش‌ها ===== */
.msc-ct-section {
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 3px 16px rgba(30, 58, 95, 0.09);
	border: 1px solid var(--msc-border, #e1e5ea);
	margin-bottom: 26px;
	overflow: hidden;
}

.msc-ct-section-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 16px 22px;
	background: linear-gradient(135deg, #f5f8fc, #eaf1f9);
	border-bottom: 3px solid var(--msc-accent, #c9a55c);
	color: var(--msc-primary, #1e3a5f);
	font-size: 15.5px;
}

.msc-ct-section-title .dashicons {
	color: var(--msc-accent, #c9a55c);
}

.msc-ct-section > form,
.msc-ct-box {
	padding: 22px;
}

.msc-ct-box {
	border: 1px solid var(--msc-border, #e1e5ea);
	border-radius: 10px;
	margin: 0 22px 22px;
	padding: 18px;
	background: #fafbfc;
}

.msc-ct-box-title {
	margin: 0 0 14px;
	font-size: 14px;
	color: var(--msc-primary, #1e3a5f);
}

.msc-ct-hint {
	font-size: 12px;
	color: var(--msc-text-soft, #5a6470);
	margin: 6px 0 0;
}

.msc-ct-party-type-box {
	background: #f5f8fc;
	border: 1.5px dashed var(--msc-primary, #1e3a5f);
	border-radius: 10px;
	padding: 16px 18px;
	margin: 0 22px 22px;
}

/* چک‌باکس و رادیو */
.msc-ct-check-row label,
.msc-ct-radio-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-weight: 600;
	font-size: 13.5px;
}

.msc-ct-radio-label {
	background: #fff;
	border: 1.5px solid var(--msc-border, #e1e5ea);
	padding: 9px 18px;
	border-radius: 8px;
	transition: all 0.2s;
}

.msc-ct-radio-label:hover { border-color: var(--msc-primary, #1e3a5f); }

.msc-ct-radio-label input[type="radio"] { accent-color: var(--msc-primary, #1e3a5f); }

.msc-ct-payment-switch {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

/* ===== نتیجه ساخت ===== */
.msc-ct-result {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	background: var(--msc-success-bg, #e8f5ee);
	border: 1.5px solid #b7e0c9;
	border-radius: 12px;
	padding: 18px 20px;
	margin: 0 22px 22px;
}

.msc-ct-result-icon {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--msc-success, #2d8659);
	color: #fff;
	font-size: 22px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}

.msc-ct-result-body h4 {
	margin: 0 0 10px;
	color: var(--msc-success, #2d8659);
	font-size: 15px;
}

.msc-ct-result-body p { margin: 0 0 10px; font-size: 13px; }

.msc-ct-result-body code {
	background: rgba(45, 134, 89, 0.12);
	padding: 3px 10px;
	border-radius: 5px;
	font-family: 'Courier New', monospace;
	font-size: 13px;
	direction: ltr;
	display: inline-block;
}

.msc-ct-result-link-row .msc-ct-input {
	margin-top: 6px;
	font-family: 'Courier New', monospace;
	font-size: 12px;
	background: #fff;
}

.msc-ct-result-actions {
	display: flex;
	gap: 10px;
	margin: 12px 0;
	flex-wrap: wrap;
}

.msc-ct-result-actions .msc-btn {
	padding: 8px 18px;
	font-size: 13px;
	text-decoration: none;
}

/* ===== جدول لیست ===== */
.msc-ct-table-wrap {
	overflow-x: auto;
	padding: 6px 0;
}

table.msc-ct-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12.5px;
}

table.msc-ct-table th {
	background: linear-gradient(135deg, #f5f8fc, #eaf1f9);
	color: var(--msc-primary, #1e3a5f);
	padding: 11px 14px;
	text-align: right;
	white-space: nowrap;
	border-bottom: 2.5px solid var(--msc-accent, #c9a55c);
}

table.msc-ct-table td {
	padding: 11px 14px;
	border-bottom: 1px solid var(--msc-border, #e1e5ea);
	vertical-align: middle;
}

table.msc-ct-table tr:hover td {
	background: #f8fafc;
}

.msc-ct-code-cell code {
	background: #f0f3f7;
	padding: 3px 8px;
	border-radius: 4px;
	font-family: 'Courier New', monospace;
	font-size: 11.5px;
	direction: ltr;
	display: inline-block;
}

.msc-ct-type-badge {
	display: inline-block;
	padding: 3px 12px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
}

.msc-ct-type-badge.person {
	background: #e8f1fb;
	color: #1e3a5f;
	border: 1px solid #b9cfe8;
}

.msc-ct-type-badge.legal {
	background: #f3ecdd;
	color: #8a6d1a;
	border: 1px solid #d8c391;
}

.msc-ct-link-cell {
	white-space: nowrap;
}

.msc-ct-copy-row,
.msc-ct-view-row {
	padding: 5px 10px !important;
	font-size: 11.5px !important;
}

.msc-ct-view-row { text-decoration: none; }

.msc-ct-no-link { color: #9aa4ae; }

.msc-ct-empty {
	text-align: center;
	color: var(--msc-text-soft, #5a6470);
	padding: 30px 20px;
	font-size: 13.5px;
}

.msc-ct-section .msc-ct-hint:last-child {
	padding: 0 22px 18px;
}

/* وضعیت‌ها — هماهنگ با استایل فرانت‌اند افزونه */
.msc-status-badge {
	display: inline-block;
	padding: 3px 14px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

.msc-status-pending {
	background: #fff8e1;
	color: #8a6d1a;
	border: 1px solid #e6d48a;
}

.msc-status-signed {
	background: #e8f5ee;
	color: #21674a;
	border: 1px solid #a8d8bf;
}

.msc-status-expired {
	background: #fdecea;
	color: #c0392b;
	border: 1px solid #f2b7ae;
}

/* دکمه لودینگ */
.msc-ct-btn-loader {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #fff;
}

.msc-ct-btn-loader::before {
	content: '';
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: msc-ct-spin 0.8s linear infinite;
}

@keyframes msc-ct-spin {
	to { transform: rotate(360deg); }
}
