:root {
    --bg: #f5f3ff;
    --bg-card: #ffffff;
    --bg-soft: #f7fbfb;
    --border: #e0e7ff;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-soft: rgba(79, 70, 229, 0.12);
    --text: #1e293b;
    --text-dim: #64748b;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 16px;
    --shadow: 0 8px 30px -10px rgba(79, 70, 229, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; color: var(--primary-dark); }

.el-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.el-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.el-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    text-decoration: none;
}
.el-logo .mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.el-nav { display: flex; align-items: center; gap: 8px; }
.el-nav a, .el-nav button {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-dim);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.el-nav a:hover, .el-nav button:hover {
    background: var(--primary-soft);
    color: var(--primary);
    text-decoration: none;
}
.el-nav .btn-primary {
    background: var(--primary);
    color: #fff !important;
}
.el-nav .btn-primary:hover {
    background: var(--primary-dark);
}

.el-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.el-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}
.chapter-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}
.chapter-card:hover {
    box-shadow: 0 12px 32px -8px rgba(79, 70, 229, 0.18);
    border-color: #c7d2fe;
}
.chapter-card .cover {
    height: 120px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a78bfa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 42px;
    font-weight: 700;
    opacity: 0.95;
}
.chapter-card .body {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.chapter-card h3 {
    font-size: 17px;
    margin-bottom: 6px;
}
.chapter-card .desc {
    font-size: 13.5px;
    color: var(--text-dim);
    margin-bottom: 14px;
    flex: 1;
}
.chapter-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.price-tag {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 8px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 11px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
}
.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-sm { padding: 7px 12px; font-size: 13px; }

.content-block {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
}
.content-block h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--primary-dark);
}
.content-en {
    font-size: 16px;
    line-height: 1.8;
    white-space: pre-wrap;
    direction: ltr;
    text-align: left;
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 14px;
}
.content-fa {
    font-size: 15px;
    line-height: 1.9;
    background: #f0fdfa;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #c7d2fe;
    margin-top: 12px;
    display: none;
}
.content-fa.show { display: block; }

.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-info { background: #f0fdfa; color: #4338ca; border: 1px solid #c7d2fe; }
.alert-success { background: #f5f3ff; color: #047857; border: 1px solid #c7d2fe; }
.alert-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.alert-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.question-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
}
.question-card.correct { border-color: var(--success); background: #f0fdf4; }
.question-card.wrong { border-color: var(--danger); background: #fef2f2; }
.q-options label {
    display: block;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.q-options label:hover { border-color: var(--primary); background: var(--primary-soft); }
.q-options input { margin-left: 8px; }

.result-box {
    text-align: center;
    padding: 40px 20px;
}
.result-box .score {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
}
.result-box .label {
    font-size: 18px;
    margin: 10px 0 20px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}
.page-sub {
    color: var(--text-dim);
    font-size: 14.5px;
    margin-bottom: 24px;
}

@media (max-width: 640px) {
    .chapter-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .el-header-inner { flex-wrap: wrap; }
}
@media (max-width: 360px) {
    .chapter-grid { grid-template-columns: 1fr; }
}

.el-logo .logo-img,
.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
    display: block;
}
.el-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 480px) {
    .el-header-inner { padding: 10px 14px; gap: 10px; }
    .el-logo { font-size: 15px; }
    .el-logo .logo-img, .logo-img { width: 30px; height: 30px; }
    .el-nav { gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
    .el-nav a, .el-nav button { padding: 7px 10px; font-size: 12.5px; }
    .el-container { padding: 20px 14px 44px; }
    .page-title { font-size: 19px; }
    .page-sub { font-size: 13px; }
    .chapter-card .cover { height: 90px; font-size: 32px; }
    .chapter-card .body { padding: 14px 15px 16px; }
    .chapter-card .meta { flex-wrap: wrap; }
    .chapter-card .meta .btn { flex: 1; min-width: 110px; }
}
@media (max-width: 360px) {
    html, body { font-size: 14.5px; }
    .el-logo span:not(.mark) { font-size: 13.5px; }
    .page-title { font-size: 17.5px; }
    .el-container { padding: 16px 10px 40px; }
    .chapter-card .body { padding: 12px; }
}

.faq-section {
    margin-top: 44px;
    padding: 36px 32px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}
.faq-head { text-align: center; max-width: 560px; margin: 0 auto 28px; }
.faq-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.faq-head h2 {
    font-size: 21px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
.faq-head p {
    font-size: 13.5px;
    color: var(--text-dim);
    line-height: 1.8;
}
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 760px;
    margin: 0 auto;
}
.faq-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.faq-item[open] {
    border-color: #c7d2fe;
    box-shadow: 0 8px 24px -12px rgba(79, 70, 229, 0.2);
}
.faq-item summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--text);
    list-style: none;
    user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-q-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
}
.faq-q-text { flex: 1; }
.faq-chevron {
    flex-shrink: 0;
    color: var(--text-dim);
    font-size: 16px;
    transition: transform .2s;
}
.faq-item[open] .faq-chevron { transform: rotate(180deg); color: var(--primary); }
.faq-a {
    padding: 0 18px 18px 56px;
    font-size: 13.5px;
    color: var(--text-dim);
    line-height: 1.9;
}
@media (max-width: 480px) {
    .faq-section { padding: 22px 16px; border-radius: 16px; margin-top: 30px; }
    .faq-head h2 { font-size: 17.5px; }
    .faq-item summary { padding: 13px 14px; font-size: 13.5px; gap: 10px; }
    .faq-q-icon { width: 24px; height: 24px; font-size: 12px; }
    .faq-a { padding: 0 14px 14px 42px; font-size: 13px; }
}
@media (max-width: 360px) {
    .faq-a { padding-right: 14px; padding-left: 14px; }
}

.feat-section { margin-bottom: 36px; }
.feat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 980px;
    margin: 0 auto;
}
.feat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 18px;
    text-align: center;
    box-shadow: var(--shadow);
}
.feat-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 12px;
    border-radius: 13px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.feat-card h3 { font-size: 14.5px; margin-bottom: 8px; color: var(--text); }
.feat-card p { font-size: 13px; color: var(--text-dim); line-height: 1.8; }
@media (max-width: 700px) {
    .feat-grid { grid-template-columns: repeat(2, 1fr); }
    .feat-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .feat-card { padding: 16px 12px; border-radius: 14px; }
    .feat-icon { width: 38px; height: 38px; font-size: 18px; border-radius: 10px; margin-bottom: 8px; }
    .feat-card h3 { font-size: 13px; }
    .feat-card p { font-size: 12px; line-height: 1.7; }
}
@media (max-width: 360px) {
    .feat-grid { gap: 8px; }
}

.chapter-grid,
.feat-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
}
.how-steps {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
}
@media (min-width: 900px) {
  .chapter-grid, .feat-grid { gap: 16px !important; }
}
@media (max-width: 899px) {
  .chapter-grid, .feat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .how-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .chapter-card .cover { height: 72px !important; font-size: 26px !important; }
  .chapter-card .body { padding: 10px 8px 12px !important; }
  .chapter-card h3 { font-size: 12.5px !important; }
  .chapter-card .desc { font-size: 11px !important; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .feat-card { padding: 12px 8px !important; }
  .feat-card h3 { font-size: 12px !important; }
  .feat-card p { font-size: 10.5px !important; line-height: 1.5 !important; }
  .feat-icon { width: 34px !important; height: 34px !important; font-size: 16px !important; margin-bottom: 6px !important; }
  .el-container { padding: 16px 10px 40px !important; }
  .hero { padding: 24px 12px 20px !important; border-radius: 16px !important; }
  .hero h1 { font-size: 1.25rem !important; }
  .hero p { font-size: 13px !important; }
  .el-header-inner { padding: 10px 12px !important; }
  .feat-card:last-child { grid-column: auto !important; }
}
@media (max-width: 360px) {
  .chapter-grid, .feat-grid {
    gap: 6px !important;
  }
  .chapter-card h3, .feat-card h3 { font-size: 11px !important; }
}
