/* =========================================================
   سامانه عکس اتحادیه — سیستم طراحی
   پالت: سرمه‌ای رسمی + طلایی مهر/تاییدیه (الهام از اسناد هویتی رسمی)
   فونت: وزیرمتن (Vazirmatn)
   ========================================================= */

:root {
  /* رنگ‌ها */
  --navy-900: #14213D;
  --navy-800: #1D2E52;
  --navy-700: #2A3E68;
  --blue-600: #3059E3;
  --blue-700: #2447C4;
  --gold-500: #C8952B;
  --gold-700: #8A6116;
  --gold-100: #FBF1DC;
  --bg: #F4F5F9;
  --surface: #FFFFFF;
  --ink-900: #151B2B;
  --ink-600: #5B6478;
  --ink-400: #8890A0;
  --line: #E5E8F0;
  --success: #1E9E5A;
  --success-bg: #E5F7ED;
  --danger: #D6455A;
  --danger-bg: #FCEAEE;
  --warning: #C8952B;
  --warning-bg: #FBF1DC;

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, .05);
  --shadow-md: 0 10px 28px -14px rgba(20, 33, 61, .22);

  /* بازنویسی متغیرهای بوت‌استرپ برای هماهنگی خودکار کامپوننت‌های موجود */
  --bs-body-font-family: 'Vazirmatn', -apple-system, sans-serif;
  --bs-body-color: var(--ink-900);
  --bs-body-bg: var(--bg);
  --bs-primary: var(--navy-900);
  --bs-primary-rgb: 20, 33, 61;
  --bs-border-radius: var(--radius-md);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-link-color: var(--blue-600);
  --bs-link-hover-color: var(--blue-700);
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn[wght].woff2') format('woff2 supports variations'),
       url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn[wght].woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

body {
  font-family: 'Vazirmatn', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink-900);
  font-size: 15px;
}

h1, h2, h3, h4, h5, h6 { font-weight: 800; color: var(--ink-900); letter-spacing: -.01em; }

h4 {
  position: relative;
  padding-bottom: .6rem;
  margin-bottom: 1.3rem !important;
}
h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 46px;
  height: 3px;
  border-radius: 3px;
  background: var(--gold-500);
}

a { color: var(--gold-700); text-decoration: none; }
a:hover { color: var(--navy-900); text-decoration: underline; }

/* ---------- کارت‌ها ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

/* ---------- دکمه‌ها ---------- */
.btn {
  border-radius: var(--radius-md);
  font-weight: 600;
  padding: .55rem 1.1rem;
  transition: transform .08s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--navy-900);
  border-color: var(--navy-900);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--navy-800);
  border-color: var(--gold-500);
  box-shadow: var(--shadow-md);
}

.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: #17824A; border-color: #17824A; }

.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #B93448; border-color: #B93448; }

.btn-outline-secondary, .btn-outline-dark {
  border-color: var(--line);
  color: var(--ink-600);
}
.btn-outline-secondary:hover, .btn-outline-dark:hover {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: #fff;
}

/* ---------- فرم‌ها ---------- */
.form-control, .form-select {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: .6rem .85rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(200, 149, 43, .18);
}
label { font-weight: 600; font-size: .88rem; color: var(--ink-600); margin-bottom: .3rem; display: inline-block; }

/* ---------- هشدارها ---------- */
.alert { border: none; border-radius: var(--radius-md); font-weight: 500; }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-info { background: #E7EDFC; color: var(--blue-700); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-secondary { background: var(--bg); color: var(--ink-600); }

/* ---------- جدول‌ها ---------- */
.table {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}
.table thead th, .table th {
  background: var(--navy-900);
  color: var(--gold-100);
  font-weight: 700;
  font-size: .82rem;
  text-transform: none;
  border-bottom: none !important;
  padding: .9rem 1rem;
}
.table td { padding: .85rem 1rem; vertical-align: middle; border-color: var(--line) !important; color: var(--ink-900); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: #FAFBFD; }
.table > tbody > tr:hover > * { background-color: var(--gold-100); transition: background-color .12s ease; }

/* کد/شناسه‌های عددی (کد ملی، شماره پیگیری) به سبک اسناد رسمی */
.mono-code {
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .15rem .5rem;
  font-weight: 600;
  display: inline-block;
}

/* ---------- نشان وضعیت (Badge) ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  border-radius: var(--radius-pill);
  font-size: .8rem;
  font-weight: 700;
}
.status-badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-ok      { background: var(--success-bg); color: var(--success); }
.status-pending { background: var(--warning-bg); color: var(--warning); }
.status-blocked { background: var(--danger-bg);  color: var(--danger); }
.status-neutral { background: var(--bg);         color: var(--ink-600); }

/* =========================================================
   چیدمان اصلی داخل سامانه (Sidebar + Topbar)
   ========================================================= */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 264px;
  flex: 0 0 264px;
  background: var(--navy-900);
  color: #C9D1E8;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.1rem;
}
.app-sidebar .brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  margin-bottom: 1.6rem;
  padding: 0 .3rem;
}
.app-sidebar .brand .brand-mark { width: 34px; height: 34px; flex: none; }
.app-sidebar .brand .brand-text { font-weight: 800; font-size: 1.02rem; line-height: 1.25; }
.app-sidebar .brand .brand-sub { font-size: .72rem; color: var(--gold-500); font-weight: 600; }

.nav-group-label {
  font-size: .72rem;
  font-weight: 700;
  color: #8592B4;
  letter-spacing: .03em;
  margin: 1.1rem .5rem .4rem;
}
.nav-group-label:first-of-type { margin-top: 0; }

.sidebar-link {
  display: block;
  padding: .55rem .8rem;
  border-radius: var(--radius-md);
  color: #C9D1E8;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .15rem;
  border-inline-start: 3px solid transparent;
}
.sidebar-link:hover {
  background: var(--navy-800);
  color: #fff;
  text-decoration: none;
}
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(200,149,43,.22), var(--navy-800) 70%);
  color: #fff;
  font-weight: 700;
  border-inline-start-color: var(--gold-500);
}

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: .8rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-topbar .user-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg);
  border-radius: var(--radius-pill);
  padding: .35rem .5rem .35rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-600);
}
.app-topbar .user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy-900); color: var(--gold-100);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
}

.app-content { padding: 1.6rem; flex: 1 1 auto; }

/* موبایل: سایدبار به‌صورت نوار افقی بالای صفحه */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .app-sidebar { width: 100%; flex: none; flex-direction: row; align-items: center; overflow-x: auto; padding: .8rem 1rem; }
  .app-sidebar .brand { margin-bottom: 0; margin-inline-end: 1rem; }
  .nav-group-label { display: none; }
  .sidebar-link { white-space: nowrap; margin-inline-end: .3rem; margin-bottom: 0; border-inline-start: none; border-bottom: 3px solid transparent; }
  .sidebar-link.active { border-bottom-color: var(--gold-500); }
}

/* =========================================================
   صفحات پیش از ورود (Login / Register) — چیدمان دوستونه
   ========================================================= */
.auth-shell {
  min-height: 100vh;
  display: flex;
}
.auth-brand-panel {
  flex: 1 1 42%;
  background: radial-gradient(120% 120% at 20% 15%, var(--navy-700) 0%, var(--navy-900) 60%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.auth-brand-panel .aperture-deco {
  position: absolute;
  inset-inline-end: -80px;
  bottom: -80px;
  width: 380px;
  height: 380px;
  opacity: .16;
  animation: spin-slow 60s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .auth-brand-panel .aperture-deco { animation: none; }
}
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.auth-brand-panel .brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 2rem; position: relative; z-index: 1; }
.auth-brand-panel .brand .brand-mark { width: 40px; height: 40px; }
.aperture-deco .ap-core { fill: none; stroke: currentColor; stroke-width: 1.2; }
.aperture-deco { stroke-width: 1; }
.auth-brand-panel .brand .brand-text { font-weight: 800; font-size: 1.15rem; }
.auth-brand-panel .brand .brand-sub { font-size: .78rem; color: var(--gold-500); font-weight: 600; }
.auth-brand-panel h2 { color: #fff; font-size: 1.7rem; max-width: 380px; position: relative; z-index: 1; }
.auth-brand-panel p { color: #AEB8D6; max-width: 380px; position: relative; z-index: 1; }

.auth-form-panel {
  flex: 1 1 58%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}
.auth-form-panel .auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}

@media (max-width: 860px) {
  .auth-shell { flex-direction: column; }
  .auth-brand-panel { flex: none; padding: 2rem; }
  .auth-brand-panel h2 { font-size: 1.3rem; }
}

/* =========================================================
   صفحه اصلی عمومی (Default.aspx) — نوار قهرمان + دو کارت اقدام
   ========================================================= */
.home-hero {
  background: radial-gradient(120% 160% at 15% 0%, var(--navy-700) 0%, var(--navy-900) 65%);
  color: #fff;
  padding: 3.2rem 0 6.5rem;
  position: relative;
  overflow: hidden;
}
.home-hero .aperture-deco {
  position: absolute;
  inset-inline-end: -60px;
  top: -60px;
  width: 320px;
  height: 320px;
  opacity: .14;
  animation: spin-slow 60s linear infinite;
}
.home-hero .brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 2.2rem;
  position: relative;
  z-index: 1;
}
.home-hero .brand .brand-mark { width: 38px; height: 38px; }
.home-hero .brand .brand-text { font-weight: 800; font-size: 1.1rem; }
.home-hero .brand .brand-sub { font-size: .78rem; color: var(--gold-500); font-weight: 600; }
.home-hero h1 {
  color: #fff;
  font-size: 1.9rem;
  max-width: 620px;
  position: relative;
  z-index: 1;
}
.home-hero p.lead {
  color: #C9D1E8;
  max-width: 560px;
  font-size: 1rem;
  position: relative;
  z-index: 1;
}

.action-tiles {
  margin-top: -4.5rem;
  position: relative;
  z-index: 2;
}
.action-tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem 1.8rem;
  height: 100%;
  text-decoration: none !important;
  transition: transform .16s ease, box-shadow .16s ease;
  position: relative;
  overflow: hidden;
}
.action-tile::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 5px;
  background: var(--gold-500);
}
.action-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px -16px rgba(20, 33, 61, .32);
}
.action-tile .tile-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--gold-100);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
}
.action-tile .tile-icon svg { width: 26px; height: 26px; }
.action-tile h3 {
  color: var(--ink-900);
  font-size: 1.15rem;
  margin-bottom: .5rem;
}
.action-tile p {
  color: var(--ink-600);
  font-size: .9rem;
  margin-bottom: 1.2rem;
  min-height: 3.2rem;
}
.action-tile .tile-cta {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-weight: 700;
  color: var(--gold-700);
  font-size: .92rem;
}
.action-tile .tile-links {
  margin-top: .6rem;
  font-size: .82rem;
}
.action-tile .tile-links a { color: var(--ink-600); text-decoration: underline; }

.home-footer-note {
  text-align: center;
  color: var(--ink-400);
  font-size: .82rem;
  margin: 2.5rem 0 1rem;
}
