/* ==========================================================================
   آزادکار — Design Tokens
   مفهوم طراحی: «دفتر کار» — نگاه به بازار کار مثل یک دفترچه/دفتر ثبت رسمی:
   کارت پروژه مثل بلیط کار، پروفایل فریلنسر مثل پرونده، رنگ سرمه‌ای برای اعتماد
   و طلایی برای ارزش و امضای تایید.
   ========================================================================== */
:root {
	--ink-900: #10192B;
	--ink-800: #172239;
	--ink-700: #24314C;
	--ink-500: #4B5972;
	--paper-50: #F2F4F7;
	--paper-100: #E4E8EE;
	--paper-0: #FFFFFF;
	--gold-500: #C08829;
	--gold-600: #A87420;
	--gold-100: #F2E3C2;
	--ok-600: #3E7A5D;
	--ok-100: #DCEEE3;
	--danger-600: #A6432F;
	--danger-100: #F4DFDA;
	--border: #DDE1E8;

	--font-display: 'Noto Naskh Arabic', 'Vazirmatn', serif;
	--font-body: 'Vazirmatn', Tahoma, sans-serif;

	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-5: 24px;
	--space-6: 32px;
	--space-7: 48px;
	--space-8: 64px;

	--radius-sm: 3px;
	--radius-md: 6px;
	--container: 1180px;
}

html { scroll-behavior: smooth; }

body.azadkar-rtl {
	font-family: var(--font-body);
	background: var(--paper-50);
	color: var(--ink-900);
	line-height: 1.8;
	font-size: 16px;
	direction: rtl;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	line-height: 1.4;
	margin: 0 0 var(--space-3);
	font-weight: 700;
	color: var(--ink-900);
}
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 19px; }

p { margin: 0 0 var(--space-4); max-width: 68ch; }

:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-5); }

/* ===== دکمه‌ها ===== */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
	padding: 12px 22px; border-radius: var(--radius-sm); font-family: var(--font-body);
	font-weight: 600; font-size: 15px; border: 1px solid transparent; cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-gold { background: var(--gold-500); color: var(--paper-0); }
.btn-gold:hover { background: var(--gold-600); }
.btn-ink { background: var(--ink-900); color: var(--paper-0); }
.btn-ink:hover { background: var(--ink-700); }
.btn-outline { background: transparent; color: var(--ink-900); border-color: var(--ink-900); }
.btn-outline:hover { background: var(--ink-900); color: var(--paper-0); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ===== فرم‌ها ===== */
.field { margin-bottom: var(--space-4); }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: var(--space-2); color: var(--ink-700); }
.field .hint { font-size: 12px; color: var(--ink-500); margin-top: var(--space-1); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], input[type=search], textarea, select {
	width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
	font-family: var(--font-body); font-size: 15px; background: var(--paper-0); color: var(--ink-900);
}
textarea { min-height: 140px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--gold-500); outline: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

/* ===== هدر سایت ===== */
.site-header { background: var(--paper-0); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) 0; gap: var(--space-4); }
.site-logo { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink-900); }
.site-logo span { color: var(--gold-500); }
.main-nav ul { display: flex; gap: var(--space-5); }
.main-nav a { font-weight: 500; font-size: 15px; }
.main-nav a:hover { color: var(--gold-600); }
.header-actions { display: flex; align-items: center; gap: var(--space-3); }
.nav-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--ink-900); padding: 4px 8px; }

@media (max-width: 860px) {
	.main-nav {
		position: fixed; inset-inline-start: 0; top: 0; bottom: 0; width: 80%; max-width: 320px;
		background: var(--ink-900); padding: var(--space-7) var(--space-5); transform: translateX(100%);
		transition: transform .25s ease; z-index: 100; overflow-y: auto;
	}
	.main-nav.is-open { transform: translateX(0); }
	.main-nav ul { flex-direction: column; gap: var(--space-4); }
	.main-nav a { color: var(--paper-0); font-size: 18px; }
	.nav-toggle { display: block; }
	.header-actions .btn-outline.btn-sm span.txt { display: none; }
}

/* ===== هیرو ===== */
.hero { background: var(--ink-900); color: var(--paper-0); padding: var(--space-8) 0 var(--space-7); }
.hero h1 { color: var(--paper-0); max-width: 16ch; }
.hero .lead { color: #C7CEDC; font-size: 18px; max-width: 52ch; }
.hero-search { background: var(--paper-0); border-radius: var(--radius-md); padding: var(--space-3); display: flex; gap: var(--space-3); margin-top: var(--space-5); max-width: 640px; }
.hero-search input { border: none; flex: 1; }
.hero-search input:focus { outline: none; }
@media (max-width: 640px) { .hero-search { flex-direction: column; } }

.hero-stats { display: flex; gap: var(--space-7); margin-top: var(--space-7); border-top: 1px solid #2B3A57; padding-top: var(--space-5); flex-wrap: wrap; }
.hero-stat b { display: block; font-family: var(--font-display); font-size: 30px; color: var(--gold-500); font-weight: 700; }
.hero-stat span { color: #9AA6BC; font-size: 14px; }

/* ===== دسته‌بندی‌ها ===== */
.cat-strip { display: flex; gap: var(--space-3); overflow-x: auto; padding: var(--space-6) 0; }
.cat-pill { flex: 0 0 auto; border: 1px solid var(--border); background: var(--paper-0); padding: 10px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.cat-pill:hover, .cat-pill.is-active { border-color: var(--gold-500); background: var(--gold-100); }

/* ===== سربرگ بخش ===== */
.section { padding: var(--space-7) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: var(--space-6); gap: var(--space-4); flex-wrap: wrap; }
.section-head h2 { position: relative; padding-bottom: var(--space-3); margin-bottom: 0; }
.section-head h2::after { content: ""; position: absolute; bottom: 0; right: 0; width: 56px; height: 3px; background: var(--gold-500); }
.section-head .more { font-weight: 600; color: var(--gold-600); font-size: 14px; }

.grid { display: grid; gap: var(--space-5); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ===== کارت پروژه («بلیط کار») ===== */
.ticket { background: var(--paper-0); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s ease; }
.ticket:hover { border-color: var(--gold-500); }
.ticket-stub {
	display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) var(--space-4);
	background: var(--paper-50); font-size: 12px; color: var(--ink-500); border-bottom: 1px dashed var(--border); position: relative;
}
.ticket-stub::before, .ticket-stub::after {
	content: ""; position: absolute; bottom: -7px; width: 14px; height: 14px; border-radius: 50%;
	background: var(--paper-50); border: 1px solid var(--border);
}
.ticket-stub::before { inset-inline-start: -7px; }
.ticket-stub::after { inset-inline-end: -7px; }
.ticket-body { padding: var(--space-4); flex: 1; }
.ticket-body h3 { margin-bottom: var(--space-2); font-size: 18px; }
.ticket-body p { font-size: 14px; color: var(--ink-500); margin-bottom: var(--space-3); }
.ticket-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.tag { font-size: 12px; border: 1px solid var(--border); padding: 4px 10px; border-radius: var(--radius-sm); color: var(--ink-700); display: inline-block; }
.ticket-footer { display: flex; justify-content: space-between; align-items: center; padding: var(--space-4); border-top: 1px solid var(--border); }
.ticket-price { font-weight: 700; color: var(--gold-600); font-variant-numeric: tabular-nums; }

/* ===== کارت فریلنسر («پرونده») ===== */
.dossier { background: var(--paper-0); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-5); text-align: center; position: relative; }
.dossier-avatar { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto var(--space-3); overflow: hidden; border: 3px solid var(--paper-100); }
.dossier h3 { margin-bottom: 2px; font-size: 17px; }
.dossier .role { color: var(--gold-600); font-size: 13px; font-weight: 600; margin-bottom: var(--space-3); }
.dossier .rating { font-size: 13px; color: var(--ink-500); margin-bottom: var(--space-3); }
.dossier .rating .stars { color: var(--gold-500); letter-spacing: 2px; }
.dossier-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin-bottom: var(--space-4); }
.verified-badge {
	position: absolute; top: var(--space-4); inset-inline-end: var(--space-4);
	width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--gold-500);
	color: var(--gold-500); display: inline-flex; align-items: center; justify-content: center;
	font-size: 13px; font-weight: 700; background: var(--paper-0);
}

/* ===== نشان وضعیت ===== */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.badge-open { background: var(--ok-100); color: var(--ok-600); }
.badge-progress { background: var(--gold-100); color: var(--gold-600); }
.badge-done { background: var(--paper-100); color: var(--ink-700); }
.badge-danger { background: var(--danger-100); color: var(--danger-600); }

/* ===== اعلان‌ها ===== */
.notice { padding: var(--space-4); border-radius: var(--radius-sm); margin-bottom: var(--space-5); font-size: 14px; border: 1px solid transparent; }
.notice-success { background: var(--ok-100); color: var(--ok-600); border-color: #BFE0CE; }
.notice-error { background: var(--danger-100); color: var(--danger-600); border-color: #E8C3BB; }

/* ===== داشبورد ===== */
.dashboard-layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--space-6); align-items: start; }
@media (max-width: 860px) { .dashboard-layout { grid-template-columns: 1fr; } }
.dashboard-nav { background: var(--ink-900); border-radius: var(--radius-sm); padding: var(--space-4); position: sticky; top: 90px; }
.dashboard-nav a { display: block; color: #C7CEDC; padding: 10px var(--space-3); border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 2px; }
.dashboard-nav a.is-active, .dashboard-nav a:hover { background: rgba(255,255,255,.08); color: var(--paper-0); }
.stat-card { background: var(--ink-900); color: var(--paper-0); border-radius: var(--radius-sm); padding: var(--space-5); }
.stat-card b { font-family: var(--font-display); font-size: 30px; color: var(--gold-500); display: block; font-weight: 700; }
.stat-card span { color: #9AA6BC; font-size: 13px; }

.ledger-table { width: 100%; border-collapse: collapse; background: var(--paper-0); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ledger-table th, .ledger-table td { padding: var(--space-3) var(--space-4); text-align: right; font-size: 14px; border-bottom: 1px solid var(--border); }
.ledger-table th { background: var(--paper-50); font-weight: 600; color: var(--ink-700); }
.ledger-table tr:last-child td { border-bottom: none; }
.amount-pos { color: var(--ok-600); font-weight: 600; font-variant-numeric: tabular-nums; }
.amount-neg { color: var(--danger-600); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ===== فوتر ===== */
.site-footer { background: var(--ink-900); color: #9AA6BC; padding: var(--space-8) 0 var(--space-5); margin-top: var(--space-8); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-6); margin-bottom: var(--space-7); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-widget-title { color: var(--paper-0); font-size: 15px; margin-bottom: var(--space-3); font-family: var(--font-body); font-weight: 700; }
.site-footer a:hover { color: var(--gold-500); }
.site-footer li { margin-bottom: var(--space-2); font-size: 14px; }
.footer-bottom { border-top: 1px solid #2B3A57; padding-top: var(--space-5); text-align: center; font-size: 13px; }

/* ===== صفحه پروژه ===== */
.project-header { border-bottom: 1px solid var(--border); padding-bottom: var(--space-5); margin-bottom: var(--space-6); }
.project-meta { display: flex; gap: var(--space-5); flex-wrap: wrap; color: var(--ink-500); font-size: 14px; margin-top: var(--space-3); }
.proposal-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-4); margin-bottom: var(--space-4); background: var(--paper-0); }
.proposal-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); gap: var(--space-3); flex-wrap: wrap; }

/* ===== ورود / ثبت‌نام ===== */
.auth-box { max-width: 440px; margin: var(--space-8) auto; background: var(--paper-0); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-6); }
.auth-tabs { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); border-bottom: 1px solid var(--border); }
.auth-tabs a { padding: var(--space-3); font-weight: 600; color: var(--ink-500); border-bottom: 2px solid transparent; }
.auth-tabs a.is-active { color: var(--ink-900); border-color: var(--gold-500); }
.role-choice { display: flex; gap: var(--space-3); margin-bottom: var(--space-4); }
.role-choice label { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-3); text-align: center; cursor: pointer; font-size: 14px; display: block; }
.role-choice input { position: absolute; opacity: 0; pointer-events: none; }
.role-choice label:has(input:checked) { border-color: var(--gold-500); background: var(--gold-100); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
