@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;600;700&display=swap');

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

body {
    font-family: 'Vazirmatn', sans-serif;
    background: radial-gradient(circle at top, #2a5298 0, #1e3c72 35%, #0b1020 100%);
    color: #222;
    direction: rtl;
    scroll-behavior: smooth;
}

/* هدر چسبان */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 16, 32, 0.96);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 30px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd54f, #ffb300);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e3c72;
    font-weight: 700;
}

.logo-text {
    font-weight: 600;
    font-size: 1rem;
}

.site-header nav ul {
    list-style: none;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.site-header nav a {
    text-decoration: none;
    color: #f5f5f5;
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 999px;
    transition: 0.3s;
}

.site-header nav a:hover {
    background: #ffd54f;
    color: #1e3c72;
}

/* سکشن قهرمان */
.hero {
    max-width: 1100px;
    margin: 25px auto 10px;
    padding: 0 16px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    color: #fff;
}

.hero-content h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 0.98rem;
    line-height: 1.8;
    max-width: 480px;
    opacity: 0.95;
}

.hero-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.3s;
}

.btn.primary {
    background: #ffd54f;
    color: #1e3c72;
    font-weight: 600;
}

.btn.primary:hover {
    background: #ffca28;
    transform: translateY(-1px);
}

.btn.ghost {
    background: transparent;
    color: #ffd54f;
    border-color: #ffd54f;
}

.btn.ghost:hover {
    background: rgba(255, 213, 79, 0.1);
}

.hero-stats {
    margin-top: 18px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 8px 12px;
    min-width: 90px;
}

.stat-number {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffd54f;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* تصویرسازی سمت راست */
.hero-illustration {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.math-card {
    background: #fdfdfd;
    color: #1e3c72;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
    font-size: 0.9rem;
    animation: float 4s ease-in-out infinite;
}

.math-card.secondary {
    background: #e8eaf6;
    animation-delay: 1s;
}

.math-card h3 {
    margin-bottom: 6px;
    font-size: 1rem;
}

.answer-hint {
    margin-top: 6px;
    color: #2e7d32;
    font-weight: 600;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* کارت‌ها و بدنه اصلی */
.card {
    max-width: 1100px;
    margin: 18px auto;
    padding: 18px 18px 20px;
    border-radius: 16px;
    background: #fdfdfd;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.card h2 {
    margin-bottom: 10px;
    color: #1e3c72;
    border-right: 4px solid #ffd54f;
    padding-right: 8px;
    font-size: 1.3rem;
}

/* چرا این سایت */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.feature-item {
    background: #f5f7ff;
    border-radius: 12px;
    padding: 10px 12px;
border: 1px solid #e0e4ff;
    font-size: 0.9rem;
    line-height: 1.7;
}

.feature-item h3 {
    color: #2a5298;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

/* فصل‌ها */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.lesson {
    background: #f5f7ff;
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid #e0e4ff;
    font-size: 0.9rem;
    line-height: 1.7;
}

.lesson h3 {
    color: #2a5298;
    margin-bottom: 4px;
    font-size: 0.98rem;
}

.lesson ul {
    margin-top: 4px;
    padding-right: 16px;
}

/* مثال‌ها */
.example {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f5f7ff;
    border: 1px solid #e0e4ff;
    font-size: 0.9rem;
    line-height: 1.7;
}

/* آزمون */
.quiz-section p {
    font-size: 0.9rem;
    line-height: 1.7;
}

.question {
    margin-top: 10px;
}

.question label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.question input,
.question select {
    width: 100%;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid #c5cae9;
    font-size: 0.9rem;
}

.radio-group {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 0.9rem;
}

.feedback {
    display: block;
    margin-top: 3px;
    font-size: 0.8rem;
    min-height: 16px;
}

.quiz-progress {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 999px;
    overflow: hidden;
    margin: 10px 0 14px;
}

.quiz-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #ffca28, #ff7043);
    transition: width 0.4s ease;
}

button#checkQuiz {
    margin-top: 12px;
    padding: 8px 18px;
    border-radius: 999px;
    border: none;
    background: #ffca28;
    color: #1e3c72;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
}

button#checkQuiz:hover {
    background: #ffc107;
    transform: translateY(-1px);
}

#quizResult {
    margin-top: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* فوتر */
footer {
    text-align: center;
    color: #f5f5f5;
    font-size: 0.85rem;
    padding: 18px 0 24px;
}

/* دکمه بازگشت به بالا */
#backToTop {
    position: fixed;
    bottom: 18px;
    left: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #ffd54f;
    color: #1e3c72;
    font-size: 1.1rem;
    cursor: pointer;
    display: none;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
    transition: 0.3s;
    z-index: 90;
}

#backToTop:hover {
    background: #ffca28;
    transform: translateY(-1px);
}

/* واکنش‌گرا */
@media (max-width: 800px) {
    .hero {
        grid-template-columns: 1fr;
        margin-top: 18px;
    }

    .hero-illustration {
        order: -1;
    }

    .site-header {
        padding: 8px 14px;
    }

    .site-header nav ul {
        gap: 8px;
    }

    .site-header nav a {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

@media (max-width: 500px) {
    .hero-content h1 {
        font-size: 1.7rem;
    }

    .card {
        margin: 14px 10px;
        padding: 14px 12px 16px;
    }
}

