/* ============================================================
   DESIGN SYSTEM — منصة مستقلة، هوية بصرية خاصة بيها
   ============================================================
   Typography: Tajawal (Google Fonts) — عصري، واضح، يدعم AR+EN
   Palette: بنفسجي عميق (Primary) + برتقالي مرجاني (Accent)
   ============================================================ */

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

:root {
    /* الألوان الأساسية */
    --primary: #5B21B6;
    --primary-dark: #3F1786;
    --primary-light: #7C3AED;
    --primary-soft: #EDE6FB;

    --accent: #FF6B4A;
    --accent-dark: #E8532F;
    --accent-soft: #FFE8E1;

    --success: #17A673;
    --success-soft: #E1F7EE;
    --warning: #F5A623;
    --warning-soft: #FFF3DE;
    --danger: #E5484D;
    --danger-soft: #FCE4E4;
    --info: #2B7FFF;
    --info-soft: #E4EFFF;

    --bg: #F7F5FC;
    --surface: #FFFFFF;
    --surface-alt: #FBFAFE;
    --text: #1E1B2E;
    --text-muted: #6B6580;
    --text-faint: #9992AD;
    --border: #E9E4F5;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(91, 33, 182, 0.06);
    --shadow: 0 8px 24px rgba(91, 33, 182, 0.10);
    --shadow-lg: 0 20px 48px rgba(91, 33, 182, 0.16);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

body { padding-bottom: 60px; }

h1, h2, h3, h4 { font-weight: 800; line-height: 1.35; margin: 0 0 16px; color: var(--text); }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 14px; color: var(--text-muted); }
a { color: var(--primary); text-decoration: none; font-weight: 600; }
a:hover { color: var(--primary-light); }

/* ============ Layout Containers ============ */
header, section, footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px;
}
form { max-width: 520px; margin: 24px auto; padding: 32px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ============ Buttons ============ */
button, .btn, .btn-primary, .btn-secondary, .btn-enroll, .btn-start-exam,
.btn-download, .btn-print, .btn-share, .btn-record {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 999px;
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
button, .btn-primary, .btn-enroll, .btn-start-exam {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    box-shadow: 0 6px 16px rgba(255, 107, 74, 0.35);
}
button:hover, .btn-primary:hover, .btn-enroll:hover, .btn-start-exam:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(255, 107, 74, 0.45);
}
.btn-secondary {
    background: var(--surface);
    color: var(--primary);
    border: 2px solid var(--primary-soft);
}
.btn-secondary:hover { background: var(--primary-soft); }
.btn-download, .btn-print, .btn-share {
    background: var(--primary-soft);
    color: var(--primary-dark);
    box-shadow: none;
}
.btn-download:hover, .btn-print:hover, .btn-share:hover { background: var(--primary); color: #fff; }
.btn-record { background: var(--danger); color: #fff; }

/* ============ Forms ============ */
label { display: block; font-weight: 700; margin: 16px 0 6px; font-size: 0.9rem; color: var(--text); }
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], input[type=file], input[type=color],
select, textarea {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background: var(--surface-alt);
    color: var(--text);
    transition: border-color 0.15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--surface);
}
textarea { resize: vertical; min-height: 100px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkbox-label input { width: auto; }
button[type=submit], form button { width: 100%; margin-top: 20px; padding: 15px; font-size: 1.05rem; }

/* ============ Hero / Landing ============ */
.hero { text-align: center; padding-top: 72px; }
.hero h1 { font-size: 2.8rem; background: linear-gradient(135deg, var(--primary), var(--primary-light)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-subtitle { font-size: 1.2rem; max-width: 640px; margin: 0 auto 32px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; margin-bottom: 32px; flex-wrap: wrap; }
.trust-badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.trust-badges .badge {
    background: var(--surface);
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.why-ncdt { text-align: center; }
.value-props { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 32px; }
.value-prop {
    background: var(--surface);
    padding: 32px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: right;
}
.value-prop h3 { font-size: 1.1rem; }

.categories-strip { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 24px; }
.category-pill, .categories a {
    background: var(--surface);
    border: 2px solid var(--border);
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}
.category-pill:hover, .categories a:hover, .categories a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.section-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.see-all-link { font-weight: 700; }

/* ============ Course Cards / Grids ============ */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; margin-top: 24px; }
.course-card, .course-progress-card {
    display: block;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: var(--text);
}
.course-card:hover, .course-progress-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.course-card img, .course-progress-card img { width: 100%; height: 160px; object-fit: cover; background: var(--primary-soft); }
.course-card h3, .course-progress-card h3 { padding: 16px 16px 4px; margin: 0; font-size: 1.05rem; }
.course-card .summary { padding: 0 16px; font-size: 0.9rem; }
.course-card .meta { display: flex; justify-content: space-between; padding: 0 16px 16px; align-items: center; }
.course-card .category { font-size: 0.8rem; color: var(--text-faint); }
.course-card .price { font-weight: 800; color: var(--accent-dark); font-size: 1.1rem; }
.cert-badge {
    margin: 0 16px 16px; padding: 8px 12px; background: var(--warning-soft);
    color: #92600A; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 700;
}
.empty-state, .empty { text-align: center; color: var(--text-faint); padding: 40px; }

/* ============ Testimonials ============ */
.testimonials { text-align: center; }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 24px; }
.testimonial-card { background: var(--surface); padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow-sm); text-align: right; }
.stars { font-size: 1.1rem; margin-bottom: 10px; }
.testimonial-text { font-style: normal; color: var(--text); }
.testimonial-author { font-weight: 700; color: var(--primary); font-size: 0.9rem; }

.newsletter-cta { text-align: center; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: var(--radius-lg); color: #fff; padding: 56px 24px; }
.newsletter-cta h2, .newsletter-cta p { color: #fff; }
.newsletter-cta .btn-primary { background: var(--accent); }

/* ============ Course Detail Page ============ */
.course-header { text-align: center; }
.course-header .instructor { color: var(--text-muted); }
.accreditation { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.accreditation .badge { background: var(--primary-soft); color: var(--primary-dark); padding: 8px 18px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; }
.partner-logo { height: 36px; }
.certificate-preview {
    background: var(--warning-soft); color: #92600A; text-align: center;
    padding: 16px; border-radius: var(--radius); font-weight: 700; max-width: 700px; margin: 0 auto 24px;
}
.chapters-preview ol { list-style: none; padding: 0; }
.chapters-preview li {
    background: var(--surface); padding: 16px 20px; border-radius: var(--radius-sm);
    margin-bottom: 10px; display: flex; justify-content: space-between; box-shadow: var(--shadow-sm);
}
.materials-count { color: var(--text-faint); font-size: 0.85rem; }

.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 20px; }
.plan-card { background: var(--surface); border-radius: var(--radius); padding: 28px 20px; text-align: center; box-shadow: var(--shadow-sm); border: 2px solid transparent; }
.plan-card:hover { border-color: var(--primary-light); }
.plan-card .price { font-size: 1.8rem; font-weight: 800; color: var(--primary); margin: 10px 0; }
.plan-card .seats { color: var(--text-faint); font-size: 0.85rem; }
.coupon-form { display: flex; gap: 10px; max-width: 400px; margin: 24px auto 0; background: none; box-shadow: none; padding: 0; }
.coupon-form input { flex: 1; }
.coupon-form button { width: auto; padding: 13px 24px; }

/* ============ Enrollment / Checkout ============ */
.order-summary { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); text-align: center; }
.original-price.strikethrough { text-decoration: line-through; color: var(--text-faint); }
.discount { color: var(--success); font-weight: 700; }
.final-price { font-size: 1.4rem; }
.instapay-instructions { background: var(--info-soft); padding: 24px; border-radius: var(--radius); margin: 24px 0; }
.instapay-instructions ol { padding-inline-start: 20px; }

/* ============ Banners / Alerts ============ */
.banner, .success-message, .errors, .error, .success, .warning, .info {
    padding: 16px 20px; border-radius: var(--radius-sm); margin: 16px auto; max-width: 700px; font-weight: 600;
}
.banner-info, .info { background: var(--info-soft); color: #124F9E; }
.banner-warning, .warning { background: var(--warning-soft); color: #92600A; }
.success-message, .success { background: var(--success-soft); color: #0C6B4C; }
.errors, .error { background: var(--danger-soft); color: #A31A1E; }
.privacy-note, .subtitle { color: var(--text-faint); font-size: 0.85rem; text-align: center; }

/* ============ Chapter Materials / Exam ============ */
.materials-list { max-width: 800px; margin: 0 auto; }
.material { background: var(--surface); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.material iframe, .material audio { width: 100%; border-radius: var(--radius-sm); }
.notes-panel { margin-top: 16px; background: var(--surface-alt); border-radius: var(--radius-sm); padding: 16px; }
.note-item { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.note-timestamp { background: var(--primary-soft); color: var(--primary-dark); padding: 2px 8px; border-radius: 6px; font-size: 0.75rem; margin-inline-end: 8px; }

.question { background: var(--surface); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); position: relative; }
.question label { font-weight: 500; display: block; background: var(--surface-alt); padding: 12px 16px; border-radius: var(--radius-sm); margin: 8px 0; cursor: pointer; }
.question label:hover { background: var(--primary-soft); }
.per-question-timer { position: absolute; top: -14px; left: 20px; background: var(--accent); color: #fff; padding: 4px 14px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; }
.per-question-timer-notice, .time-limit { background: var(--warning-soft); color: #92600A; padding: 12px 18px; border-radius: var(--radius-sm); text-align: center; }
.passage-block { background: var(--primary-soft); padding: 20px; border-radius: var(--radius); margin-bottom: 20px; }
.orderable-list { list-style: none; padding: 0; }
.orderable-list li { background: var(--surface-alt); padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 8px; cursor: grab; border: 2px dashed var(--border); }
.match-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.exam-result { text-align: center; background: var(--surface); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); max-width: 500px; margin: 0 auto; }
.exam-result .score { font-size: 3rem; font-weight: 800; color: var(--primary); }

/* ============ Dashboard ============ */
.progress-bar { background: var(--border); border-radius: 999px; height: 10px; overflow: hidden; margin: 12px 16px 0; }
.progress-fill { background: linear-gradient(90deg, var(--accent), var(--primary-light)); height: 100%; border-radius: 999px; }
.progress-text { padding: 8px 16px 16px; font-size: 0.85rem; color: var(--text-faint); }
.badge-completed { background: var(--success-soft); color: #0C6B4C; padding: 6px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; margin: 0 16px 16px; display: inline-block; }
.badges-row { display: flex; gap: 12px; flex-wrap: wrap; }
.badge-item { background: var(--surface); padding: 12px 20px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); font-weight: 700; }
.certificates-list { display: flex; flex-direction: column; gap: 10px; }
.certificate-card { background: var(--surface); padding: 18px 20px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); display: flex; justify-content: space-between; align-items: center; }
.certificate-card .serial { color: var(--text-faint); font-size: 0.8rem; }
.messages-icon { position: relative; font-size: 1.4rem; }
.badge-count { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; border-radius: 999px; font-size: 0.7rem; padding: 2px 6px; }

/* ============ Verify Certificate ============ */
.verification-result { max-width: 600px; margin: 0 auto; text-align: center; background: var(--surface); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); }
.verification-result.verified { border-top: 6px solid var(--success); }
.verification-result.not-found { border-top: 6px solid var(--danger); }
.checkmark, .cross { font-size: 3rem; }
.verification-result table { width: 100%; border-collapse: collapse; margin-top: 20px; text-align: right; }
.verification-result td { padding: 12px; border-bottom: 1px solid var(--border); }
.verification-result td:first-child { color: var(--text-faint); font-weight: 700; width: 40%; }
.certificate-actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.eagle-seal, .verification-result .partner-logo { height: 60px; margin-top: 16px; }

/* ============ Admin Dashboards (overview, coupons, settings) ============ */
.pending-actions-banner { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.action-card {
    background: var(--primary-soft); color: var(--primary-dark); padding: 20px; border-radius: var(--radius-sm);
    text-align: center; font-weight: 700; display: block;
}
.action-card.urgent { background: var(--danger-soft); color: #A31A1E; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-top: 16px; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow-sm); }
.stat-value { display: block; font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--text-faint); font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
th, td { padding: 14px 16px; text-align: right; border-bottom: 1px solid var(--border); }
th { background: var(--primary-soft); color: var(--primary-dark); font-size: 0.85rem; }

/* ============ Misc ============ */
.switch-auth, .auth-links { text-align: center; margin-top: 16px; font-size: 0.9rem; }
.description { max-width: 800px; margin: 0 auto; }

@media (max-width: 640px) {
    .hero h1 { font-size: 1.9rem; }
    header, section, footer { padding: 32px 16px; }
    form { padding: 24px; }
}

/* ============================================================
   SITE HEADER / NAV — نافبار موحد لكل صفحات الموقع
   ============================================================ */
header.site-header, footer.site-footer { max-width: none; margin: 0; padding: 0; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}
.site-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.site-logo {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--primary);
    white-space: nowrap;
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    flex: 1;
}
.site-nav a {
    color: var(--text);
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
}
.site-nav a:hover { color: var(--primary); }
.site-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}
.lang-toggle {
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}
.lang-toggle:hover { color: var(--primary-dark); }
.btn-nav-primary {
    background: var(--primary);
    color: #fff;
    padding: 9px 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
}
.btn-nav-primary:hover { background: var(--primary-light); color: #fff; }
.btn-nav-secondary { color: var(--text); font-weight: 700; font-size: 0.85rem; }
.btn-nav-secondary:hover { color: var(--primary); }
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
    box-shadow: none;
}

@media (max-width: 900px) {
    .site-nav {
        position: absolute;
        inset-inline: 0;
        top: 100%;
        background: var(--surface);
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 10px 24px 20px;
        box-shadow: var(--shadow);
        display: none;
    }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 10px 0; width: 100%; }
    .nav-toggle { display: inline-flex; }
    .site-actions .btn-nav-secondary { display: none; }
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
    background: var(--primary-dark);
    color: #fff;
    margin-top: 56px;
}
.site-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 36px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}
.footer-brand { display: flex; flex-direction: column; gap: 2px; }
.footer-brand strong { font-size: 1.1rem; }
.footer-brand span { opacity: 0.75; font-size: 0.82rem; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: #fff; opacity: 0.85; font-weight: 600; }
.site-footer a:hover { opacity: 1; }
.footer-copy { opacity: 0.65; font-size: 0.82rem; white-space: nowrap; }

/* ============================================================
   HOMEPAGE REDESIGN ADDITIONS
   ============================================================ */
.hero { padding-top: 56px; }
.hero-badge-row { display: flex; justify-content: center; margin-bottom: 18px; }
.hero-eyebrow {
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: 7px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
}
.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.stat-item { text-align: center; }
.stat-item .num { display: block; font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-item .label { color: var(--text-faint); font-size: 0.85rem; }
.accreditation-strip {
    text-align: center;
    padding: 32px 24px;
}
.accreditation-strip .accred-title {
    color: var(--text-faint);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}
