:root {
    --ink: #1E1B4B;
    --p-50: #F5F3FF;
    --p-100: #EDE9FE;
    --p-200: #DDD6FE;
    --p-300: #C4B5FD;
    --p-500: #7C3AED;
    --p-700: #5B21B6;
    --p-950: #2E1065;
    --muted: #5B5280;
    --amber: #F59E0B;
    --radius: 20px;
    --wrap: 1120px;
}

html { scroll-behavior: smooth; }

body {
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--ink);
    background: #fff;
    line-height: 1.7;
    overflow-x: hidden;
}

[hidden] { display: none !important; }

a { color: inherit; }

:focus-visible {
    outline: 3px solid var(--p-300);
    outline-offset: 3px;
    border-radius: 8px;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: 20px;
}

section[id], footer[id] { scroll-margin-top: 76px; }


/* ===== Buttons ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 24px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    border: 1.5px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(100deg, var(--p-500), var(--p-700));
}

.btn-primary:hover {
    color: #fff;
    box-shadow: 0 10px 22px rgba(124, 58, 237, 0.35);
}

.btn-ghost {
    color: var(--p-700);
    background: transparent;
    border-color: var(--p-200);
}

.btn-ghost:hover {
    background: var(--p-50);
    border-color: var(--p-300);
}

.btn-light {
    color: var(--p-700);
    background: #fff;
}

.btn-light:hover {
    background: var(--p-100);
}

.btn-sm {
    min-height: 40px;
    padding: 0 18px;
    font-size: 15px;
}


/* ===== Navbar ===== */

.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--p-100);
}

.nav-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand svg {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.brand-name {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}

.brand-tag {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.nav-toggle {
    display: none;
    margin-inline-start: auto;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    color: var(--p-700);
    background: var(--p-50);
    border: 0;
    border-radius: 12px;
    cursor: pointer;
}

.nav-toggle svg {
    width: 22px;
    height: 22px;
}

.nav-panel {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 24px;
}

.nav-links {
    display: flex;
    gap: 4px;
    margin-inline-start: 24px;
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 6px 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border-radius: 10px;
    transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
    color: var(--p-700);
    background: var(--p-50);
}

.nav-actions {
    display: flex;
    gap: 10px;
    margin-inline-start: auto;
}

@media (max-width: 859px) {

    .nav-toggle { display: inline-flex; }

    .nav-panel {
        display: none;
        position: absolute;
        top: 100%;
        inset-inline: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px 20px 22px;
        background: #fff;
        border-bottom: 1px solid var(--p-100);
        box-shadow: 0 20px 30px rgba(59, 7, 100, 0.1);
    }

    .nav[data-open="true"] .nav-panel { display: flex; }

    .nav-links {
        flex-direction: column;
        margin-inline-start: 0;
    }

    .nav-links a { padding: 10px 12px; }

    .nav-actions {
        flex-direction: column;
        margin-inline-start: 0;
    }

    .nav-actions .btn { width: 100%; }

}


/* ===== Hero ===== */

.hero {
    background: var(--p-50);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 40px;
    padding-block: 48px 64px;
}

.hero h1 {
    font-size: clamp(32px, 6.4vw, 56px);
    font-weight: 800;
    line-height: 1.3;
    max-width: 14em;
}

.hero-lead {
    max-width: 34em;
    margin-top: 18px;
    font-size: clamp(16px, 2.4vw, 19px);
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.hero-actions .btn {
    min-height: 52px;
    padding: 0 30px;
    font-size: 17px;
}

.hero-note {
    margin-top: 22px;
    font-size: 14px;
    color: var(--muted);
}

@media (min-width: 900px) {

    .hero-grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
        gap: 56px;
        padding-block: 72px 88px;
    }

}


/* ===== Hero Illustration ===== */

.stage {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin-inline: auto;
    aspect-ratio: 1 / 1;
    font-size: calc(min(100vw - 40px, 480px) / 32);
}

.stage-disc {
    position: absolute;
    inset: 1.5em;
    border-radius: 50%;
    background: var(--p-100);
}

.dash {
    position: absolute;
    top: 2.6em;
    right: 1em;
    width: 24em;
    padding: 1.5em;
    background: #fff;
    border-radius: 1.6em;
    box-shadow: 0 2em 3.6em rgba(91, 33, 182, 0.2);
}

.dash-top {
    display: flex;
    align-items: center;
    gap: 0.8em;
}

.dash-top svg {
    width: 2.6em;
    height: 2.6em;
}

.dash-title {
    font-size: 1.05em;
    font-weight: 800;
    line-height: 1.2;
}

.dash-sub {
    font-size: 0.8em;
    color: var(--muted);
}


/* ===== Progress ===== */

.dash-progress {
    display: flex;
    align-items: center;
    gap: 1.2em;
    margin-top: 1.3em;
    padding: 1em;
    background: var(--p-50);
    border-radius: 1.1em;
}

.ring {
    position: relative;
    width: 5.6em;
    height: 5.6em;
    flex-shrink: 0;
}

.ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-track {
    fill: none;
    stroke: var(--p-200);
    stroke-width: 9;
}

.ring-fill {
    fill: none;
    stroke: var(--p-500);
    stroke-width: 9;
    stroke-linecap: round;

    /*
       238.76 = محيط الدائرة (r = 38)
       60% من الدائرة = 143.256
       المتبقي = 95.504
    */
    stroke-dasharray: 238.76;
    stroke-dashoffset: 95.504;

    animation: ring-in 1.4s 0.3s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes ring-in {
    from { stroke-dashoffset: 238.76; }
}

.ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: 800;
    color: var(--p-700);
}


/* ===== Lessons ===== */

.dash-progress strong {
    display: block;
    font-size: 0.95em;
    line-height: 1.4;
}

.dash-progress span {
    display: block;
    font-size: 0.8em;
    line-height: 1.5;
    color: var(--muted);
}

.lessons {
    display: grid;
    gap: 0.6em;
    margin-top: 1.1em;
    padding: 0;
    list-style: none;
}

.lessons li {
    display: flex;
    align-items: center;
    gap: 0.8em;
    padding: 0.6em 0.8em;
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid var(--p-100);
    border-radius: 0.9em;
}

.lessons .mark {
    display: grid;
    place-items: center;
    width: 1.7em;
    height: 1.7em;
    flex-shrink: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--p-500);
}

.lessons .mark svg {
    width: 1em;
    height: 1em;
}

.lessons .now .mark { background: var(--amber); }

.lessons .now {
    border-color: var(--p-300);
    background: var(--p-50);
}

.lessons .next .mark { background: var(--p-200); }

.lessons .next { color: var(--muted); }

.chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.7em 1.1em;
    font-size: 0.9em;
    font-weight: 700;
    background: #fff;
    border-radius: 1em;
    box-shadow: 0 1em 2.4em rgba(91, 33, 182, 0.18);
}

.chip svg {
    width: 1.5em;
    height: 1.5em;
    color: var(--p-500);
}

.chip-secure {
    top: 12em;
    left: 0;
}

.chip-steps {
    bottom: -0.4em;
    left: 3.5em;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5em;
    width: 15em;
}

.steps-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35em;
}

.steps-bar i {
    height: 0.55em;
    border-radius: 1em;
    background: var(--p-200);
}

.steps-bar i.done { background: var(--p-500); }

.steps-bar i.now { background: var(--amber); }


/* ===== Sections ===== */

.section { padding-block: 72px; }

.section-head {
    max-width: 40em;
    margin-bottom: 40px;
}

.section h2 {
    font-size: clamp(26px, 4.4vw, 38px);
    font-weight: 800;
    line-height: 1.35;
}

.section-lead {
    margin-top: 12px;
    font-size: 17px;
    color: var(--muted);
}


/* ===== About ===== */

.about {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.about-text p {
    max-width: 32em;
    margin-top: 18px;
    font-size: 17px;
    color: var(--muted);
}

.about-text p:first-of-type { margin-top: 20px; }

.journey {
    padding: 28px 24px;
    background: var(--p-50);
    border-radius: var(--radius);
}

.journey h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
}

.journey ol {
    position: relative;
    display: grid;
    gap: 22px;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.journey ol::before {
    content: "";
    position: absolute;
    top: 18px;
    bottom: 18px;
    right: 17px;
    width: 2px;
    background: var(--p-200);
}

.journey li {
    position: relative;
    display: flex;
    gap: 16px;
    counter-increment: step;
}

.journey li::before {
    content: counter(step, arabic-indic);
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    background: var(--p-500);
    border-radius: 50%;
    box-shadow: 0 0 0 5px var(--p-50);
}

.journey strong {
    display: block;
    font-size: 16px;
    line-height: 1.5;
}

.journey li span {
    font-size: 14.5px;
    color: var(--muted);
}

@media (min-width: 900px) {

    .about {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
        gap: 64px;
    }

}


/* ===== Features ===== */

.features { background: var(--p-50); }

.feature-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.feature {
    padding: 28px;
    background: #fff;
    border: 1px solid var(--p-100);
    border-radius: var(--radius);
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    color: var(--p-700);
    background: var(--p-100);
    border-radius: 14px;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.feature h3 {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.4;
}

.feature p {
    margin-top: 8px;
    font-size: 15.5px;
    color: var(--muted);
}

.feature-lead {
    color: #fff;
    background: linear-gradient(135deg, var(--p-700), var(--p-950));
    border-color: transparent;
}

.feature-lead .feature-icon {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

.feature-lead p { color: var(--p-200); }

@media (min-width: 600px) {

    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .feature-lead { grid-column: span 2; }

}

@media (min-width: 900px) {

    .feature-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }

    .feature { grid-column: span 2; }

    .feature-lead,
    .feature-wide { grid-column: span 3; }

    .feature-lead { padding: 36px; }

    .feature-lead h3 { font-size: 23px; }

}


/* ===== CTA ===== */

.cta-section { padding-block: 72px; }

.cta {
    position: relative;
    overflow: hidden;
    padding: 56px 24px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, var(--p-500) 0%, var(--p-700) 50%, var(--p-950) 100%);
    border-radius: 28px;
}

.cta::before,
.cta::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: #fff;
    opacity: 0.07;
}

.cta::before {
    width: 320px;
    height: 320px;
    top: -110px;
    right: -90px;
}

.cta::after {
    width: 240px;
    height: 240px;
    bottom: -90px;
    left: -60px;
}

.cta > * { position: relative; }

.cta h2 {
    font-size: clamp(26px, 5vw, 40px);
    font-weight: 800;
    line-height: 1.35;
}

.cta p {
    margin: 12px auto 0;
    max-width: 30em;
    font-size: 17px;
    color: var(--p-200);
}

.cta .btn {
    margin-top: 28px;
    min-height: 54px;
    padding: 0 40px;
    font-size: 18px;
}

.cta-alt {
    margin-top: 16px;
    font-size: 15px;
}

.cta-alt a {
    font-weight: 800;
    text-underline-offset: 4px;
}


/* ===== Footer ===== */

.footer {
    color: var(--p-200);
    background: var(--p-950);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding-block: 56px 40px;
}

.footer .brand-name { color: #fff; }

.footer-about {
    max-width: 26em;
    margin-top: 16px;
    font-size: 15px;
}

.footer h3 {
    margin-bottom: 14px;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.footer ul {
    display: grid;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.footer li a {
    font-size: 15px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer li a:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer-note { font-size: 14px; }

.footer-bottom {
    padding-block: 20px;
    text-align: center;
    font-size: 14px;
    border-top: 1px solid rgba(221, 214, 254, 0.18);
}

@media (min-width: 760px) {

    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
        gap: 48px;
    }

}

@media (prefers-reduced-motion: reduce) {

    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

}


/* ===== Teachers ===== */

.teachers-section {
    padding-top: 72px;
    padding-bottom: 72px;
    background: #fff;
}

.teachers-head {
    width: 100%;
    max-width: none;
    margin: 0 auto 28px;
    text-align: center !important;
}

.teachers-head h2 {
    width: 100%;
    margin: 0 0 6px;
    text-align: center !important;
    font-size: clamp(26px, 4.4vw, 38px);
    font-weight: 800;
    color: #000;
}

.teachers-head .section-lead {
    width: 100%;
    margin: 0 auto;
    text-align: center !important;
    font-size: 17px;
    font-weight: 700;
    color: #000;
}

.teacher-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    padding: 35px;
    background: var(--p-50);
    border: 1px solid var(--p-100);
    border-radius: var(--radius);
}

.teacher-image-box {
    width: 100%;
    max-width: 420px;
    height: 420px;
    margin-inline: auto;
    overflow: hidden;
    background: var(--p-100);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(91, 33, 182, 0.15);
}

.teacher-image-box img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    background: #f4f0ff;
    transition: 0.3s;
}

.teacher-info { padding: 20px; }

.teacher-info h2 {
    margin-bottom: 15px;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    color: var(--p-700);
}

.teacher-info h3 {
    max-width: 30em;
    margin-bottom: 25px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.8;
    color: var(--muted);
}

/* Public teacher cards mirror the course card layout shown in the student dashboard. */
.teacher-carousel {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    align-items: center;
    gap: 14px;
}

.teacher-cards {
    grid-column: 2;
    display: flex;
    min-width: 0;
    gap: 24px;
    overflow-x: auto;
    padding: 8px 4px 18px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
}

.teacher-cards::-webkit-scrollbar { display: none; }
.teacher-cards.single { justify-content: center; }

.teachers-nav {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    color: var(--p-700);
    background: #fff;
    border: 1px solid var(--p-200);
    border-radius: 50%;
    font-size: 20px;
    transition: background .2s, transform .2s;
}

.teachers-nav:hover { background: var(--p-50); transform: scale(1.04); }

.public-teacher-card {
    display: flex;
    flex: 0 0 min(340px, calc(100% - 16px));
    min-height: 420px;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    overflow: hidden;
    text-align: center;
    color: #f8f5ff;
    background: #1b1034;
    border: 1px solid #38245c;
    border-radius: 28px;
    box-shadow: 0 14px 34px rgba(27, 16, 52, .12);
    scroll-snap-align: center;
}

.public-teacher-photo {
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
    margin: 0 auto 22px;
    object-fit: contain;
    object-position: center;
    background: #fff;
    border: 3px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
}

.public-teacher-subject {
    margin: 4px 0 16px;
    color: #fff;
    font-size: 23px;
    font-weight: 800;
}

.public-teacher-name {
    margin: 0 0 16px;
    color: #c4b5fd;
    font-size: 18px;
    font-weight: 600;
}

.public-teacher-bio {
    display: -webkit-box;
    min-height: 56px;
    margin: 0 0 24px;
    overflow: hidden;
    color: #d7cdef;
    line-height: 1.8;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.public-teacher-action {
    display: grid;
    width: 100%;
    min-height: 58px;
    margin-top: auto;
    place-items: center;
    color: #fff;
    background: linear-gradient(100deg, #7c3aed, #5b21b6);
    border-radius: 16px;
    font-weight: 800;
    text-decoration: none;
}

.public-teacher-action:hover,
.public-teacher-action:focus-visible {
    color: #fff;
    filter: brightness(1.08);
}

@media (max-width: 540px) {
    .teacher-carousel { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 6px; }
    .teachers-nav { width: 36px; height: 36px; font-size: 16px; }
    .public-teacher-card { flex-basis: min(320px, calc(100% - 8px)); min-height: 400px; padding: 24px 20px; }
}

.teacher-arrows {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.teacher-arrow {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--p-200);
    background: #fff;
    color: var(--p-700);
    border-radius: 50%;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.teacher-arrow:hover {
    background: var(--p-500);
    color: #fff;
    border-color: var(--p-500);
}

.teacher-arrow i { font-size: 18px; }


/* ===== Teachers Responsive ===== */

@media (max-width: 899px) {

    .teachers-section {
        padding-top: 56px;
        padding-bottom: 60px;
    }

    .teacher-box {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 25px;
    }

    .teacher-image-box { height: 350px; }

    .teacher-info {
        padding: 5px;
        text-align: center;
    }

    .teacher-info h3 { margin-inline: auto; }

    .teacher-arrows { justify-content: center; }

}

@media (max-width: 500px) {

    .teachers-section { padding-top: 48px; }

    .teacher-box { padding: 18px; }

    .teacher-image-box { height: 300px; }

    .teacher-info h2 { font-size: 28px; }

    .teacher-info h3 { font-size: 15px; }

}

/* ===== Stats counters ===== */

.stats-section { padding-block: 48px 8px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 16px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--p-100);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(91, 33, 182, 0.06);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--p-300);
    box-shadow: 0 14px 30px rgba(124, 58, 237, 0.16);
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    font-size: 24px;
    color: var(--p-700);
    background: var(--p-100);
    border-radius: 16px;
}

.stat-num {
    direction: ltr;
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 800;
    line-height: 1.2;
    color: var(--p-700);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    margin-top: 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--muted);
}

@media (max-width: 520px) {
    .stats-section { padding-top: 32px; }
    .stats-grid { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card { padding: 18px 6px; border-radius: 16px; }
    .stat-icon { width: 38px; height: 38px; margin-bottom: 10px; font-size: 18px; border-radius: 12px; }
    .stat-label { font-size: 12.5px; }
}
