/* سامانهٔ آزمون آنلاین — بازطراحی ظاهری، راست‌به‌چپ، واکنش‌گرا.
   قلم: Vazirmatn از CDN در صورت دسترسی، وگرنه Tahoma سیستم (بدون وابستگی اجباری).
   این فایل فقط ظاهر است؛ منطق، مسیرها، نام فیلدها و رشته‌های فارسی دست نخورده‌اند. */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  --violet: #6d28d9;
  --violet-dark: #5b21b6;
  --violet-soft: #ede9fe;
  --violet-pale: #f5f3ff;
  --indigo: #4338ca;
  --ink: #1e293b;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f6f5fb;
  --card: #ffffff;
  --green: #15803d;
  --green-bg: #ecfdf5;
  --green-line: #86efac;
  --red: #b91c1c;
  --red-bg: #fef2f2;
  --red-line: #fca5a5;
  --amber: #92400e;
  --amber-bg: #fffbeb;
  --amber-line: #fcd34d;
  --blue-bg: #eff6ff;
  --blue-line: #93c5fd;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(30, 41, 59, .07), 0 8px 24px rgba(30, 41, 59, .06);
  --shadow-hover: 0 4px 8px rgba(30, 41, 59, .08), 0 16px 32px rgba(30, 41, 59, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Vazirmatn, Tahoma, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.9;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--violet); }
a:hover { color: var(--violet-dark); }
.wrap { max-width: 1020px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* ---------- سربرگ ---------- */
.topbar {
  background: linear-gradient(135deg, var(--violet) 0%, var(--indigo) 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(109, 40, 217, .25);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  display: flex; flex-wrap: wrap; gap: 12px 24px;
  align-items: center; justify-content: space-between;
  padding-block: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35);
  font-size: 1.25rem; font-weight: 800;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.5; }
.brand-name { font-weight: 800; font-size: 1.1rem; }
.brand-tag { font-size: .8rem; color: #ddd6fe; }
.mainnav { display: flex; flex-wrap: wrap; gap: 8px; }
.mainnav a {
  color: #ede9fe; text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 8px 14px; border-radius: 999px;
}
.mainnav a:hover { color: #fff; background: rgba(255, 255, 255, .15); text-decoration: none; }
.mainnav a:focus-visible, .brand:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #facc15; outline-offset: 2px;
}

/* ---------- بدنه و تیتر صفحه ---------- */
main.wrap { flex: 1; padding-bottom: 24px; }
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 8px 16px; margin: 26px 0 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 { margin: 0; font-size: 1.65rem; line-height: 1.6; }
.today {
  margin: 0; color: var(--muted); font-size: .9rem;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 14px; white-space: nowrap;
}
h1 { font-size: 1.65rem; margin: 26px 0 18px; line-height: 1.6; }
h2 { font-size: 1.25rem; margin: 0 0 12px; line-height: 1.7; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

/* ---------- کارت‌ها، بنرها، نشان‌ها ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; }
.card-narrow { max-width: 520px; margin-inline: auto; }
.card-narrow .btn { width: 100%; }
.notice, .info-banner {
  background: var(--amber-bg); border: 1px solid var(--amber-line);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; color: var(--amber);
}
.info-banner { background: var(--blue-bg); border-color: var(--blue-line); color: var(--ink-soft); }
.alert { border-radius: 12px; padding: 13px 18px; margin-bottom: 18px; border: 1px solid; font-weight: 600; }
.alert-error { background: var(--red-bg); border-color: var(--red-line); color: var(--red); }
.alert-success { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
.muted { color: var(--muted); }
.empty-state { text-align: center; padding: 32px 18px; color: var(--muted); font-size: 1.05rem; }

/* شبکهٔ کارت‌های آزمون و آمار پیشخوان */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.exam-card { display: flex; flex-direction: column; gap: 6px; transition: transform .15s ease, box-shadow .15s ease; }
.exam-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.exam-card h2 { font-size: 1.2rem; }
.exam-card .btn { margin-top: auto; align-self: flex-start; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--violet-pale); color: var(--violet-dark);
  border: 1px solid #ddd6fe; border-radius: 999px;
  padding: 3px 12px; font-size: .88rem; font-weight: 600;
}
.chip-muted { background: #f1f5f9; color: var(--ink-soft); border-color: var(--line); }
.badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 2px 11px; font-size: .85rem; font-weight: 700; white-space: nowrap;
}
.badge-yes, .badge-graded, .badge-pass { background: var(--green-bg); color: var(--green); }
.badge-no, .badge-fail { background: var(--red-bg); color: var(--red); }
.badge-pending, .badge-submitted { background: var(--amber-bg); color: var(--amber); }
.badge-progress, .badge-in_progress { background: var(--blue-bg); color: #1d4ed8; }
.badge-neutral { background: #f1f5f9; color: var(--ink-soft); }

/* پیشخوان مدیر */
.welcome { font-size: 1.1rem; font-weight: 700; margin-bottom: 18px; }
.stat { text-align: center; padding: 24px 18px; border-top: 4px solid var(--violet); }
.stat:nth-child(2) { border-top-color: #0ea5e9; }
.stat:nth-child(3) { border-top-color: #059669; }
.stat:nth-child(4) { border-top-color: #d97706; }
.stat:nth-child(5) { border-top-color: #db2777; }
.stat-label { display: block; color: var(--muted); font-size: .95rem; margin-bottom: 6px; }
.stat-num { display: block; font-size: 2.1rem; font-weight: 800; line-height: 1.3; color: var(--ink); }
.admin-nav { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- فرم‌ها و دکمه‌ها ---------- */
form label { display: block; margin-bottom: 14px; font-weight: 600; }
form label:has(input[type="checkbox"]) {
  display: flex; align-items: center; gap: 10px; font-weight: 500;
  background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 14px; cursor: pointer;
}
form label:has(input[type="checkbox"]) input { width: auto; min-height: auto; margin: 0; accent-color: var(--violet); }
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="datetime-local"], select, textarea {
  width: 100%; padding: 12px 14px; margin-top: 6px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; background: #fff; min-height: 50px;
  color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.8; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, .15);
}
input[type="radio"] { accent-color: var(--violet); width: 18px; height: 18px; }
.btn {
  display: inline-block; background: var(--violet); color: #fff; border: 0;
  border-radius: 999px; padding: 12px 26px; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none; text-align: center; min-height: 50px; line-height: 1.6;
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--violet-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: #fff; color: var(--violet); border: 2px solid var(--violet); }
.btn-secondary:hover { background: var(--violet-pale); color: var(--violet-dark); }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-small { padding: 8px 16px; min-height: 42px; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions .btn { margin: 0; }

/* ---------- جدول‌ها ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
table { width: 100%; border-collapse: collapse; background: #fff; min-width: 560px; }
table.data-table th, table.data-table td { padding: 12px 14px; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
th { background: var(--violet-pale); color: var(--violet-dark); font-weight: 700; white-space: nowrap; }
tbody tr:hover { background: #faf9ff; }
tbody tr:last-child td { border-bottom: 0; }
td .btn { margin: 2px; }

/* ---------- صفحهٔ برگزاری آزمون ---------- */
.timer {
  position: sticky; top: 70px; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  background: #1e293b; color: #fff; border-radius: 14px;
  padding: 13px 20px; font-weight: 700; margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, .25);
}
.timer-label { color: #cbd5e1; font-weight: 600; }
.timer #timer { font-size: 1.35rem; letter-spacing: .02em; color: #fff; direction: ltr; }
.timer-note { color: #cbd5e1; font-weight: 500; font-size: .9rem; }
.question {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.question p { margin-top: 0; }
.question p strong { color: var(--violet-dark); }
.question label { font-weight: 400; }
.question label:has(input[type="radio"]) {
  display: flex; align-items: flex-start; gap: 10px;
  background: #f8fafc; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer; font-weight: 500;
}
.question label:has(input[type="radio"]):hover { border-color: var(--violet); background: var(--violet-pale); }
.question label:has(input[type="radio"]:checked) { border-color: var(--violet); background: var(--violet-pale); font-weight: 700; }
.question textarea { background: #f8fafc; }
.question textarea:focus { background: #fff; }

/* ---------- نتیجهٔ آزمون ---------- */
.score-box {
  text-align: center; background: var(--violet-pale); border: 1px solid #ddd6fe;
  border-radius: var(--radius); padding: 24px 18px; margin: 16px 0;
}
.score-box .score-num { display: block; font-size: 2.4rem; font-weight: 800; line-height: 1.3; color: var(--violet-dark); }
.score-box .score-max { color: var(--muted); }
.result-verdict { text-align: center; margin: 12px 0; }
.answer-review .question { border-right: 4px solid var(--line); }
.answer-review .question.correct { border-right-color: var(--green-line); }
.answer-review .question.wrong { border-right-color: var(--red-line); }

/* ---------- پاصفحه ---------- */
.footer { margin-top: auto; padding: 22px 0; border-top: 1px solid var(--line); color: var(--muted); text-align: center; background: #fff; }
.inline-form { display: inline; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .stat-num { font-size: 1.8rem; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap { padding: 0 14px; }
  .topbar-inner { padding-block: 10px; }
  .brand-tag { display: none; }
  .page-head h1, h1 { font-size: 1.35rem; }
  .card { padding: 18px 16px; }
  .btn { width: 100%; }
  .actions .btn, .exam-card .btn, .card-narrow .btn { width: 100%; }
  .mainnav a { padding: 8px 10px; }
  .timer { top: 62px; padding: 12px 16px; }
  .timer #timer { font-size: 1.2rem; }
  .question { padding: 16px; }
  table { min-width: 480px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* کارت معرفی آزمون و وضعیت منقضی (افزوده‌شده پس از بازبینی کلاس‌ها) */
.exam-intro h2 { font-size: 1.4rem; }
.badge-expired { background: #f1f5f9; color: var(--ink-soft); }
