/* =========================================================
   تستیوا — Design System
   رنگ اصلی: سبزآبی عمیق | رنگ تأکید: زرد آفتابی | پس‌زمینه: کرم روشن
   ========================================================= */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn.woff2") format("woff2-variations"), url("../fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --brand: #0d6e63;
  --brand-600: #0b5d54;
  --brand-50: #e6f4f1;
  --brand-100: #c9e9e2;
  --sun: #f5b400;
  --sun-50: #fff6d9;
  --coral: #e5533d;
  --coral-50: #fdecea;
  --ink: #15232c;
  --ink-2: #4a5a64;
  --ink-3: #8595a0;
  --line: #e7e2d8;
  --bg: #f8f5ee;
  --card: #ffffff;
  --ok: #15803d;
  --ok-50: #e8f6ec;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --shadow: 0 1px 2px rgba(21, 35, 44, .05), 0 6px 20px rgba(21, 35, 44, .06);
  --shadow-lg: 0 10px 40px rgba(13, 110, 99, .18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-feature-settings: "ss01";
  color: var(--ink);
  background: var(--bg);
  line-height: 1.8;
  font-size: 15px;
}
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.5; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: .5rem } .mt-2 { margin-top: 1rem } .mt-3 { margin-top: 1.5rem }
.mb-0 { margin-bottom: 0 } .mb-2 { margin-bottom: 1rem }
.row { display: flex; gap: .75rem; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- برند ---------- */
.logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 900; font-size: 1.35rem; color: var(--ink); letter-spacing: -.3px; }
.logo img { width: 36px; height: 36px; flex: none; border-radius: 9px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-text small { font-size: .62rem; font-weight: 700; letter-spacing: 1.5px; color: var(--ink-3); direction: ltr; text-align: right; }
.side .logo-text small { color: #7f8f99; }
.logo b { color: var(--brand); }

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .6rem 1.25rem; border-radius: var(--r-sm);
  border: 1.5px solid transparent; font: inherit; font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s; text-align: center;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(13, 110, 99, .28); }
.btn-primary:hover { background: var(--brand-600); }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--brand-100); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-danger { background: var(--coral); color: #fff; }
.btn-sm { min-height: 36px; padding: .3rem .8rem; font-size: .88rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; font-weight: 600; }
.link-btn[disabled] { color: var(--ink-3); cursor: default; }

/* ---------- فرم‌ها ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .35rem; font-size: .92rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: .65rem .9rem; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: #fff; font: inherit; color: var(--ink); transition: border .15s, box-shadow .15s;
}
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.input-ltr { direction: ltr; text-align: center; letter-spacing: 2px; font-size: 1.2rem; font-weight: 700; }
.otp-input { letter-spacing: 14px; font-size: 1.7rem; padding-inline-start: 22px; }
.hint { color: var(--ink-3); font-size: .82rem; margin-top: .3rem; }

/* انتخاب‌گر دکمه‌ای (به‌جای منوی کشویی، برای راحتی در موبایل) */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: .5rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: .4rem .6rem;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; font-weight: 600; cursor: pointer; text-align: center;
}
.choice input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px var(--brand-100); }

/* ---------- کارت ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.25rem; }
.card + .card { margin-top: 1rem; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }

/* ---------- پیام‌ها ---------- */
.alert { padding: .8rem 1rem; border-radius: var(--r-sm); margin-bottom: 1rem; font-weight: 600; font-size: .92rem; }
.alert-error { background: var(--coral-50); color: #a52a17; }
.alert-success { background: var(--ok-50); color: var(--ok); }
.alert-info { background: var(--sun-50); color: #7a5600; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge svg, .floating-chip svg, .btn svg, .alert svg { width: 16px; height: 16px; flex: none; }
.floating-chip { white-space: nowrap; }
.badge-ok { background: var(--ok-50); color: var(--ok); }
.badge-warn { background: var(--sun-50); color: #8a6100; }
.badge-off { background: #eef0f2; color: var(--ink-2); }
.badge-bad { background: var(--coral-50); color: #b42318; }

/* ---------- صفحه‌ی ورود ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.auth-bg {
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(245, 180, 0, .16), transparent 70%),
    radial-gradient(700px 400px at 0% 100%, rgba(13, 110, 99, .14), transparent 70%), var(--bg);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 1.75rem 1.5rem; border-radius: var(--r-lg); }
.auth-head { text-align: center; margin-bottom: 1.25rem; }
.auth-head .logo { font-size: 1.7rem; }
.auth-head .logo img { width: 52px; height: 52px; border-radius: 13px; }
.auth-foot { text-align: center; color: var(--ink-3); font-size: .8rem; margin-top: 1rem; }
.dev-code { direction: ltr; font-weight: 800; letter-spacing: 3px; }

/* ---------- قالب دانش‌آموز ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(248, 245, 238, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 720px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; justify-content: space-between; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.main { max-width: 720px; margin: 0 auto; padding: 1.25rem 1rem 6.5rem; }

.bottom-nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .55rem; color: var(--ink-3); font-size: .74rem; font-weight: 600; }
.bottom-nav a svg { width: 24px; height: 24px; }
.bottom-nav a.active { color: var(--brand); }
@media (min-width: 900px) { .bottom-nav { max-width: 720px; margin: 0 auto; border-radius: 18px 18px 0 0; box-shadow: var(--shadow); } }

/* خوش‌آمد */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.hello h1 { font-size: 1.35rem; margin: 0; }
.hello .muted { font-size: .9rem; }

/* سه دکمه‌ی بزرگ */
.big-actions { display: grid; gap: .85rem; }
.big-action {
  position: relative; display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.15rem; border-radius: var(--r-lg);
  color: var(--ink); background: #fff; box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.big-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.big-action .ic { width: 58px; height: 58px; border-radius: 18px; display: flex; align-items: center; justify-content: center; flex: none; }
.big-action .ic svg { width: 30px; height: 30px; }
.big-action h3 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.big-action p { margin: 0; font-size: .86rem; color: var(--ink-2); line-height: 1.6; }
.big-action .arrow { margin-inline-start: auto; color: var(--ink-3); }
.big-action.primary { background: linear-gradient(135deg, #0d6e63 0%, #0f8a7b 100%); color: #fff; }
.big-action.primary p { color: rgba(255, 255, 255, .85); }
.big-action.primary .arrow { color: rgba(255, 255, 255, .7); }
.big-action.primary .ic { background: rgba(255, 255, 255, .16); color: #fff; }
.big-action.primary::after {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; inset-inline-end: -60px; top: -80px;
  background: radial-gradient(circle, rgba(245, 180, 0, .45), transparent 65%);
}
.ic-sun { background: var(--sun-50); color: #b07d00; }
.ic-coral { background: var(--coral-50); color: var(--coral); }
.ic-brand { background: var(--brand-50); color: var(--brand); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1rem; }
.mini-stat { background: #fff; border-radius: var(--r); padding: .8rem .5rem; text-align: center; box-shadow: var(--shadow); }
.mini-stat b { display: block; font-size: 1.2rem; font-weight: 900; color: var(--ink); }
.mini-stat span { font-size: .75rem; color: var(--ink-3); }

.section-title { font-weight: 800; font-size: 1rem; margin: 1.6rem 0 .7rem; display: flex; align-items: center; gap: .4rem; }

.empty { text-align: center; padding: 2.5rem 1rem; }
.empty .ic { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: center; }
.empty .ic svg { width: 38px; height: 38px; }

.sub-banner { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-radius: var(--r); background: var(--sun-50); border: 1px dashed #e9c766; margin-top: 1rem; }
.sub-banner .grow { font-size: .88rem; font-weight: 600; color: #6e4f00; }

.kv { display: flex; justify-content: space-between; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--ink-2); }
.kv b { font-weight: 700; }

/* ---------- صفحه‌ی اصلی (معرفی) ---------- */
.landing-nav { max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; }
.hero { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 3rem; display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr .9fr; padding-top: 3.5rem; } }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.35; font-weight: 900; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--brand); position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; inset-inline: 0; bottom: .1em; height: .28em; background: var(--sun); opacity: .45; z-index: -1; border-radius: 4px; }
.hero p.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 520px; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.hero-art { position: relative; }
.mock-phone { max-width: 320px; margin: 0 auto; background: var(--ink); border-radius: 36px; padding: 12px; box-shadow: 0 30px 60px rgba(21, 35, 44, .25); transform: rotate(-3deg); }
.mock-screen { background: var(--bg); border-radius: 26px; padding: 1rem; }
.mock-q { background: #fff; border-radius: 14px; padding: .8rem; font-size: .82rem; box-shadow: var(--shadow); }
.mock-opt { margin-top: .45rem; padding: .45rem .7rem; border-radius: 10px; border: 1.5px solid var(--line); font-size: .78rem; }
.mock-opt.on { border-color: var(--brand); background: var(--brand-50); font-weight: 700; }
.mock-timer { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; font-weight: 800; margin-bottom: .6rem; }
.mock-timer span { background: var(--sun); padding: .1rem .6rem; border-radius: 999px; }
.floating-chip { position: absolute; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); padding: .55rem .8rem; font-size: .8rem; font-weight: 700; display: flex; gap: .4rem; align-items: center; }
.features { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem 3rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature .ic { width: 50px; height: 50px; border-radius: 15px; display: flex; align-items: center; justify-content: center; margin-bottom: .6rem; }
.feature .ic svg { width: 26px; height: 26px; }
.steps { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem 3rem; }
.steps ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); counter-reset: s; }
.steps li { counter-increment: s; background: #fff; border-radius: var(--r); padding: 1.1rem 1.1rem 1.1rem 1.1rem; box-shadow: var(--shadow); display: flex; gap: .8rem; align-items: flex-start; }
.steps li::before { content: counter(s, persian); width: 36px; height: 36px; flex: none; border-radius: 12px; background: var(--ink); color: var(--sun); display: flex; align-items: center; justify-content: center; font-weight: 900; }
.site-foot { border-top: 1px solid var(--line); padding: 1.5rem 1.25rem; text-align: center; color: var(--ink-3); font-size: .85rem; }

/* ---------- پنل مدیریت ---------- */
.admin { display: grid; min-height: 100vh; }
@media (min-width: 960px) { .admin { grid-template-columns: 250px 1fr; } }
.side { background: var(--ink); color: #c9d3d9; padding: 1rem; }
.side .logo { color: #fff; margin: .25rem .25rem 1.25rem; }
.side .logo b { color: var(--sun); }
.side nav a { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: 10px; color: #c9d3d9; font-weight: 600; font-size: .92rem; }
.side nav a svg, .side nav button svg { width: 20px; height: 20px; opacity: .85; }
.side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side nav a.active { background: var(--brand); color: #fff; }
.side .nav-group { font-size: .72rem; color: #7f8f99; margin: 1rem .75rem .3rem; font-weight: 700; }
@media (max-width: 959px) {
  .side { padding: .6rem 1rem; }
  .side .logo { margin: 0; }
  .side nav { display: none; padding-top: .6rem; }
  .side.open nav { display: block; }
  .side-head { display: flex; justify-content: space-between; align-items: center; }
}
@media (min-width: 960px) { .side-toggle { display: none; } }
.side-toggle { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .45rem .9rem; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; color: #fff; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; }
.side-toggle svg { width: 22px; height: 22px; flex: none; }
.side.open .side-toggle { background: var(--brand); border-color: var(--brand); }
@media (max-width: 959px) {
  .side { position: sticky; top: 0; z-index: 40; }
  .side.open nav { max-height: calc(100vh - 70px); overflow-y: auto; }
}
.admin-main { padding: 1.25rem; min-width: 0; }
@media (min-width: 960px) { .admin-main { padding: 2rem 2.25rem; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.4rem; }
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1.5rem; }
.stat { background: #fff; border-radius: var(--r); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat span { color: var(--ink-2); font-size: .82rem; font-weight: 600; }
.stat b { display: block; font-size: 1.6rem; font-weight: 900; margin-top: .15rem; }
.stat.accent { background: var(--ink); color: #fff; }
.stat.accent span { color: #b8c4cb; }
.stat.accent b { color: var(--sun); }

.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: start; background: #faf8f3; color: var(--ink-2); font-weight: 700; padding: .75rem 1rem; font-size: .8rem; white-space: nowrap; }
.table td { padding: .75rem 1rem; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #fcfbf8; }

/* ---------- خطا ---------- */
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.error-page .code { font-size: 4.5rem; font-weight: 900; color: var(--brand); line-height: 1; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- انگیزه: شمارش معکوس، پیوستگی، نصب اپ ---------- */
.pulse-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.countdown { background: var(--ink); color: #fff; border-radius: var(--r); padding: .8rem 1rem; position: relative; overflow: hidden; }
.countdown b { display: block; font-size: 2rem; font-weight: 900; color: var(--sun); line-height: 1.15; }
.countdown span { font-size: .82rem; color: #c9d3d9; font-weight: 600; position: relative; z-index: 1; }
.countdown::after { content: ""; position: absolute; inset-inline-start: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(13,110,99,.6), transparent 70%); }
.streak { background: #fff; border-radius: var(--r); padding: .7rem 1rem; display: flex; align-items: center; gap: .6rem; box-shadow: var(--shadow); }
.streak .flame { font-size: 1.6rem; filter: grayscale(1); opacity: .45; }
.streak.on .flame { filter: none; opacity: 1; animation: flick 1.6s ease-in-out infinite; }
.streak b { display: block; font-weight: 900; line-height: 1.3; }
.streak span { font-size: .78rem; color: var(--ink-2); }
@keyframes flick { 50% { transform: scale(1.12) rotate(-4deg); } }
.install-banner { display: flex; align-items: center; gap: .75rem; background: #fff; border: 1.5px solid var(--brand-100); border-radius: var(--r); padding: .75rem 1rem; margin-top: 1rem; }
.install-banner img { border-radius: 10px; flex: none; }
.install-banner b { display: block; font-size: .92rem; }
.install-banner span { font-size: .8rem; color: var(--ink-2); }

/* ---------- فرم‌ها و ابزار پنل مدیریت ---------- */
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar .input { min-height: 42px; width: auto; flex: 1; min-width: 180px; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 960px) { .grid-2 { grid-template-columns: 340px 1fr; align-items: start; } }
.form-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { margin-bottom: 0; flex: 1; min-width: 120px; }
.input-sm { min-height: 40px !important; padding: .35rem .7rem !important; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { padding: .45rem 1rem; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); font-weight: 700; color: var(--ink-2); font-size: .9rem; display: inline-flex; align-items: center; gap: .4rem; }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab .dot { width: 9px; height: 9px; border-radius: 50%; }
.chapter { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: .75rem; background: #fff; }
.chapter-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; background: #faf8f3; border-radius: var(--r-sm) var(--r-sm) 0 0; flex-wrap: wrap; }
.chapter-head b { flex: 1; }
.topic { display: flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-top: 1px solid var(--line); font-size: .92rem; }
.topic .grow { min-width: 0; }
.chip { display: inline-flex; align-items: center; padding: .1rem .55rem; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); font-size: .75rem; font-weight: 700; }
.inline-edit { display: none; gap: .4rem; align-items: center; flex: 1; }
.editing .inline-edit { display: flex; }
.editing .view-mode { display: none; }
.icon-btn { background: none; border: 0; padding: .25rem; color: var(--ink-3); cursor: pointer; border-radius: 8px; display: inline-flex; }
.icon-btn:hover { background: var(--brand-50); color: var(--brand); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.danger:hover { background: var(--coral-50); color: var(--coral); }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .4rem; }
.check { display: flex; align-items: center; gap: .45rem; padding: .45rem .6rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.pager { display: flex; gap: .35rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 700; color: var(--ink-2); }
.pager span.cur { background: var(--brand); color: #fff; border-color: var(--brand); }
.color-input { width: 46px; height: 40px; padding: 2px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
.dot { display: inline-block; flex: none; }

/* ---------- بانک سؤال ---------- */
@media (min-width: 960px) { .q-grid { grid-template-columns: 320px 1fr; } }
.opt-row { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }
.opt-radio input { position: absolute; opacity: 0; }
.opt-radio span { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--ink-3); cursor: pointer; flex: none; transition: all .15s; }
.opt-radio input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: 0 0 0 4px var(--ok-50); }
.opt-radio input:focus-visible + span { box-shadow: 0 0 0 4px var(--brand-100); }
.q-card { margin-bottom: 1rem; }
.q-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.q-check { width: 20px; height: 20px; accent-color: var(--brand); }
.q-body { font-weight: 600; line-height: 2; }
.q-img { display: block; max-height: 320px; border-radius: 12px; margin: .6rem 0; border: 1px solid var(--line); }
.q-opts { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .4rem; }
@media (min-width: 720px) { .q-opts { grid-template-columns: 1fr 1fr; } }
.q-opts li { display: flex; gap: .5rem; align-items: flex-start; padding: .45rem .7rem; border: 1.5px solid var(--line); border-radius: 10px; font-size: .92rem; }
.q-opts li span { font-weight: 800; color: var(--ink-3); }
.q-opts li.correct { border-color: var(--ok); background: var(--ok-50); }
.q-opts li.correct span { color: var(--ok); }
.q-exp { margin-top: .6rem; background: #faf8f3; border-radius: 10px; padding: .5rem .8rem; font-size: .9rem; }
.q-exp summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.q-foot { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.q-foot form { margin: 0; }
.reject-box { position: relative; }
.reject-box summary { list-style: none; }
.reject-box .card { position: absolute; inset-inline-end: 0; bottom: 110%; width: 280px; z-index: 5; }
details > summary::-webkit-details-marker { display: none; }

/* ===================== مرحله ۴: آزمون ===================== */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.exam-list { display: grid; gap: .75rem; }
.exam-item { display: flex; align-items: center; gap: .75rem; color: inherit; padding: 1rem 1.1rem; }
.exam-item .arrow { color: var(--ink-3); display: flex; }
.exam-item.state-resume { border: 2px solid var(--sun); }
.exam-item.state-open { border-inline-start: 4px solid var(--brand); }
.exam-item.state-locked, .exam-item.state-closed { opacity: .75; }
.pct-pill { background: var(--brand-50); color: var(--brand-600); border-radius: 999px; padding: .25rem .7rem; font-weight: 800; white-space: nowrap; }
.rules { padding-inline-start: 1.2rem; color: var(--ink-2); font-size: .9rem; margin: 1rem 0; }
.rules li { margin-bottom: .35rem; }

/* صفحه‌ی آزمون: تمام‌صفحه، بدون منو، تمرکز کامل */
.exam { min-height: 100vh; display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; background: var(--bg); }
.exam-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); }
.exam-title { flex: 1; font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-timer { display: flex; align-items: center; gap: .3rem; background: var(--brand-50); color: var(--brand-600); padding: .25rem .7rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.exam-timer b { font-size: 1.05rem; font-weight: 800; direction: ltr; }
.exam-timer svg { width: 18px; height: 18px; }
.exam-timer.warn { background: var(--coral-50); color: var(--coral); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.05); } }
.save-state { display: flex; align-items: center; gap: .3rem; font-size: .75rem; color: var(--ok); white-space: nowrap; }
.save-state .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.save-state[data-s="saving"], .save-state[data-s="queued"] { color: var(--ink-3); }
.save-state[data-s="off"] { color: var(--coral); }
.net-banner { background: var(--coral); color: #fff; padding: .55rem 1rem; font-size: .85rem; display: flex; gap: .5rem; align-items: center; }
.net-banner svg { width: 18px; height: 18px; flex: none; }
.exam-progress { height: 4px; background: var(--line); }
.exam-progress span { display: block; height: 100%; background: var(--sun); transition: width .3s; width: 0; }
.exam-q { flex: 1; padding: 1rem 1rem 6rem; }
.q-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.q-text { font-size: 1.08rem; line-height: 2; white-space: pre-line; margin-bottom: 1rem; font-weight: 500; }
.opts { display: grid; gap: .6rem; margin-bottom: .75rem; }
.opt { display: flex; align-items: center; gap: .75rem; width: 100%; text-align: start; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: .8rem .9rem; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, background .15s; min-height: 56px; }
.opt:hover { border-color: var(--brand-100); }
.opt .opt-n { width: 32px; height: 32px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; color: var(--ink-2); }
.opt .opt-t { flex: 1; white-space: pre-line; }
.opt.on, .opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.opt.on .opt-n, .opt:has(input:checked) .opt-n { background: var(--brand); color: #fff; }
label.opt input { position: absolute; opacity: 0; pointer-events: none; }
.exam-bar { position: fixed; bottom: 0; inset-inline: 0; z-index: 20; display: flex; gap: .5rem; padding: .6rem max(1rem, calc((100vw - 760px) / 2 + 1rem)); padding-bottom: calc(.6rem + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.exam-bar .btn { flex: 1; padding-inline: .5rem; gap: .35rem; font-size: .85rem; }
.exam-bar #prev, .exam-bar #next { flex: 0 0 56px; }
.exam-bar #next.to-sheet { flex: 0 0 auto; }
.exam-bar #prev svg { transform: scaleX(-1); }
.exam-bar button:disabled { opacity: .35; }
.flag-btn.on { background: var(--sun-50); border-color: var(--sun); color: #8a6500; }

.sheet-wrap, .modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(21, 35, 44, .45); display: flex; align-items: flex-end; justify-content: center; }
.modal-wrap { align-items: center; padding: 1rem; }
.sheet { background: var(--card); width: 100%; max-width: 760px; max-height: 85vh; overflow: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
.modal { width: 100%; max-width: 420px; }
.legend { display: flex; gap: 1rem; margin: .5rem 0; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: middle; border: 2px solid var(--line); }
.legend .lg-ans { background: var(--brand); border-color: var(--brand); }
.legend .lg-flag { border-color: var(--sun); background: var(--sun-50); }
.sheet-subj { font-weight: 800; font-size: .85rem; margin: .75rem 0 .35rem; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: .4rem; }
.cell { border: 2px solid var(--line); background: var(--card); border-radius: 10px; padding: .25rem 0; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.3; color: var(--ink-2); }
.cell b { font-size: .9rem; }
.cell small { font-size: .7rem; }
.cell.ans { background: var(--brand); border-color: var(--brand); color: #fff; }
.cell.flag { border-color: var(--sun); box-shadow: inset 0 0 0 2px var(--sun); }
.cell.ans.flag { box-shadow: inset 0 0 0 3px var(--sun); }
.cell.cur { outline: 3px solid var(--ink); outline-offset: 1px; }
.sheet-sum { margin: 1rem 0 .6rem; text-align: center; }

/* کارنامه */
.report-hero { text-align: center; }
.report-pct { font-size: 3.6rem; font-weight: 900; color: var(--brand); line-height: 1.2; margin: .3rem 0; }
.report-pct small { font-size: 1.4rem; }
.report-pct.neg, .neg { color: var(--coral); }
.report-rank { font-size: 1rem; margin-bottom: .75rem; }
.report-rank b { color: var(--brand); font-size: 1.25rem; }
.mini-stat.ok b { color: var(--ok); }
.mini-stat.bad b { color: var(--coral); }
.bar-row { margin-bottom: .9rem; }
.bar-row:last-child { margin-bottom: 0; }
.bar { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: .3rem 0 .2rem; }
.bar.sm { height: 6px; }
.bar span { display: block; height: 100%; border-radius: 999px; }
.weak-list { display: grid; gap: .1rem; }
.weak-item { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.weak-item:last-of-type { border-bottom: 0; }
.weak-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.weak-n { width: 30px; height: 30px; border-radius: 50%; background: var(--coral-50); color: var(--coral); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.rv { margin-bottom: .75rem; }
.rv-correct { border-inline-start: 4px solid var(--ok); }
.rv-wrong { border-inline-start: 4px solid var(--coral); }
.rv-blank { border-inline-start: 4px solid var(--line); }
.q-opts li.mine-wrong { background: var(--coral-50); border-color: var(--coral); }
.explain { background: var(--brand-50); border-radius: var(--r-sm); padding: .75rem .9rem; margin-top: .75rem; white-space: normal; }
.author { display: flex; align-items: flex-start; gap: .4rem; margin-top: .6rem; color: var(--ink-2); }
.author svg { width: 16px; height: 16px; flex: none; margin-top: .3rem; }
.share-img { max-height: 60vh; border-radius: var(--r); box-shadow: var(--shadow); }
.trend-bars { display: flex; align-items: flex-end; gap: .5rem; height: 110px; margin-top: .5rem; direction: ltr; }
.trend-bars .tb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.trend-bars .tb span { width: 100%; max-width: 34px; background: var(--brand); border-radius: 6px 6px 0 0; }
.trend-bars .tb:last-child span { background: var(--sun); }
.trend-bars small { font-size: .7rem; color: var(--ink-2); }
.quiz { max-width: 760px; }

/* سازنده‌ی آزمون (مدیر) */
.bp-row { display: grid; grid-template-columns: 1.2fr 1.5fr 1fr 90px auto 36px; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.bp-avail { white-space: nowrap; color: var(--ok); font-weight: 700; }
.bp-avail.low { color: var(--coral); }
@media (max-width: 760px) { .bp-row { grid-template-columns: 1fr 1fr; padding-bottom: .5rem; border-bottom: 1px dashed var(--line); } }
.report-hero .mini-stats { grid-template-columns: repeat(4, 1fr); }
.report-hero .mini-stat { box-shadow: none; background: var(--bg); }
.q-opts em.mine { font-style: normal; font-size: .72rem; background: var(--ink); color: #fff; border-radius: 999px; padding: 0 .5rem; margin-inline-start: auto; white-space: nowrap; align-self: center; }
.inline-ic svg { width: 16px; height: 16px; vertical-align: -3px; }

/* ===================== مرحله ۵: اشتراک و پرداخت ===================== */
.code-box { display: grid; gap: .35rem; margin-bottom: 1rem; }
.plans { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.plan { position: relative; display: grid; gap: .5rem; border: 2px solid transparent; }
.plan.featured { border-color: var(--sun); box-shadow: var(--shadow-lg); }
.plan-tag { position: absolute; top: -12px; inset-inline-start: 1rem; background: var(--sun); color: var(--ink); font-weight: 800; font-size: .75rem; padding: .15rem .7rem; border-radius: 999px; }
.plan-price b { font-size: 1.6rem; font-weight: 900; color: var(--brand); }
.plan-feat { list-style: none; padding: 0; margin: .25rem 0; color: var(--ink-2); }
.plan-feat li::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.gw-pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.gw input { position: absolute; opacity: 0; }
.gw span { display: inline-block; border: 1.5px solid var(--line); border-radius: 999px; padding: .25rem .8rem; font-size: .85rem; cursor: pointer; }
.gw input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); font-weight: 700; }
.gw input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-100); }
.pay-result { max-width: 480px; margin: 1rem auto; }
.big-ic { width: 64px; height: 64px; margin: 0 auto .75rem; font-size: 1.8rem; font-weight: 900; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.big-ic svg { width: 32px; height: 32px; }
.plan-admin { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.gw-admin { display: grid; gap: .5rem; margin-bottom: .75rem; }
.gw-admin .check { display: flex; align-items: center; gap: .5rem; }
.terms { max-width: 820px; }
.terms h3 { margin-top: 1rem; }
.terms ul { padding-inline-start: 1.2rem; }

/* موبایل پنل مدیر: کارت‌های آمار دوتایی */
@media (max-width: 959px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .stat { padding: .85rem .9rem; }
  .stat b { font-size: 1.25rem; }
}
