/* ==========================================================================
   مركز الفردوس لتحفيظ القرآن الكريم — الستايل الرئيسي للواجهة
   النظام: "الكوفي المربّع". الألوان والخطوط والاستدارات كلها من tokens.css
   ========================================================================== */

/* ============ الأساسيات ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    accent-color: var(--c-teal-700);
}

body {
    background: var(--c-paper);
    color: var(--c-ink);
    font-family: var(--font-ui);
    font-size: 1.0625rem;
    line-height: 1.85;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

::selection {
    background: var(--c-orange-100);
    color: var(--c-teal-950);
}

:focus-visible {
    outline: 3px solid var(--c-orange-soft);
    outline-offset: 2px;
    border-radius: var(--r-cell);
}

h1,
h2 {
    font-family: var(--font-kufi);
    font-weight: 700;
    line-height: 1.3;
    text-wrap: balance;
    color: var(--c-ink);
}

h2 {
    font-weight: 600;
}

h3,
h4 {
    font-family: var(--font-ui);
    font-weight: 800;
    line-height: 1.5;
    text-wrap: balance;
    color: var(--c-ink);
}

.wrap {
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* عنوان صغير فوق العناوين: مربع برتقالي صغير من الشعار، بدون تباعد حروف */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55em;
    font-size: .875rem;
    font-weight: 800;
    color: var(--c-teal-700);
}

.eyebrow::before {
    content: "";
    width: .55em;
    height: .55em;
    border-radius: 2px;
    background: var(--c-orange);
    flex: none;
}


/* حاوية عامة للصفحات التي تستخدم .container بدون Bootstrap */
.container {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* ============ الأزرار: كتل وليست كبسولات ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    min-height: 48px;
    padding: .7rem 1.5rem;
    border-radius: var(--r-block);
    font-weight: 800;
    font-size: .95rem;
    line-height: 1.3;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease),
        color .2s var(--ease), border-color .2s var(--ease);
}

.btn:active {
    transform: translateY(1px);
}

/* الزر الأساسي: برتقالي الشعار بنص أخضر عميق (لا أبيض على البرتقالي) */
.btn-amber,
.btn-primary-fd {
    background: var(--c-orange);
    color: var(--c-teal-950);
    box-shadow: 0 3px 0 var(--c-orange-edge);
}

.btn-amber:hover,
.btn-primary-fd:hover {
    background: var(--c-orange-soft);
}

.btn-amber:active,
.btn-primary-fd:active {
    box-shadow: 0 1px 0 var(--c-orange-edge);
    transform: translateY(2px);
}

.btn-teal {
    background: var(--c-teal-700);
    color: var(--c-white);
}

.btn-teal:hover {
    background: var(--c-teal-800);
}

.btn-ghost {
    background: transparent;
    border-color: var(--c-line);
    color: var(--c-ink);
}

.btn-ghost:hover {
    border-color: var(--c-teal-700);
    color: var(--c-teal-700);
}

.btn-outline-teal {
    background: transparent;
    border-color: rgba(240, 234, 222, 0.4);
    color: var(--c-cream);
}

.btn-outline-teal:hover {
    border-color: var(--c-cream);
    background: rgba(240, 234, 222, 0.08);
}

.btn-dark {
    background: var(--c-teal-950);
    color: var(--c-cream);
}

.btn-dark:hover {
    background: var(--c-teal-900);
}

/* إجراء لا يمكن الرجوع عنه (حذف): أحمر واضح، لا يشبه أي زر آخر */
.btn-danger {
    background: var(--c-wrong);
    color: var(--c-white);
}

.btn-danger:hover {
    background: var(--c-wrong-deep);
}

.btn[disabled],
.btn.is-disabled {
    background: var(--c-line);
    color: var(--c-ink-muted);
    box-shadow: none;
    cursor: not-allowed;
}

/* ============ حركة الظهور ============ */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger>* {
    transition-delay: calc(var(--i, 0) * 90ms);
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ============ الهيدر ============ */
.site-header {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 100;
    padding: .85rem 0;
    transition: background .35s var(--ease), box-shadow .35s var(--ease);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-header.scrolled {
    background: rgba(246, 241, 228, 0.88);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 1px 0 var(--hairline), 0 12px 24px -18px rgba(0, 0, 0, 0.25);
    padding: .55rem 0;
}

/* الشريط العلوي أخضر ثابت دائمًا (انظر قسم "الشريط العلوي" أسفل الملف)، فلا حاجة لتلوين خاص فوق الهيرو. */

.brand {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.brand-mark-img {
    height: 44px;
    width: auto;
    flex: none;
    object-fit: contain;
}

.brand-name {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name b {
    font-family: var(--font-kufi);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--ink);
}

.brand-name span {
    font-size: .72rem;
    color: var(--ink-soft);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: clamp(.9rem, 1.6vw, 1.6rem);
}

.main-nav a {
    white-space: nowrap;
    font-size: .92rem;
    font-weight: 600;
    color: var(--ink-soft);
    position: relative;
    padding-block: .3rem;
    transition: color .25s var(--ease);
}

.main-nav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: var(--c-orange);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .3s var(--ease);
}

.main-nav a:hover {
    color: var(--ink);
}

.main-nav a:hover::after {
    transform: scaleX(1);
}

.main-nav a.btn::after {
    display: none;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--ink);
    width: 38px;
    height: 38px;
    cursor: pointer;
    position: relative;
    z-index: 3;
}

.nav-toggle .icon-close {
    display: none;
}

.nav-toggle.active .icon-hamburger {
    display: none;
}

.nav-toggle.active .icon-close {
    display: block;
}

/* لما تكون القائمة مفتوحة، لازم أيقونة الإغلاق تبقى واضحة دايمًا
   بغض النظر عن كونها فوق الهيرو الغامق أو فوق لوحة القائمة الفاتحة */
#siteHeader.nav-open .nav-toggle {
    color: var(--ink);
}

/* ============ لوحة القائمة على الموبايل ============ */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 43, 37, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s var(--ease);
    z-index: 90;
}

.nav-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-head {
    display: none;
}

/* ============ الهيرو ============ */
.hero {
    position: relative;
    background: var(--c-teal-900);
    color: var(--c-paper);
    padding: calc(6.5rem + 3.5rem) 0 6rem;
    overflow: hidden;
}

/* بدون التلاشي ده، حافة الهيرو الغامقة بتقطع فجأة على خلفية الصفحة الفاتحة (paper) —
   خط حاد واضح بين الغامق والفاتح. التلاشي هنا بيدمج الحافة بلون الصفحة اللي بعده مباشرة،
   من غير ما نحتاج نعرف شكل القسم اللي جاي بعد الهيرو في كل صفحة. */
.hero::after,
.page-hero::after {
    display: none;
    content: "";
    position: absolute;
    z-index: 0;
    inset-inline: 0;
    bottom: 0;
    height: 90px;
    background: linear-gradient(to bottom, transparent, var(--paper));
    pointer-events: none;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    opacity: .06;
    pointer-events: none;
}

.hero-glow,
.hero-glow-soft {
    display: none;
}

.hero-glow {
    position: absolute;
    left: -12%;
    top: -22%;
    width: 58%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 150, 78, 0.24), transparent 65%);
    pointer-events: none;
    filter: blur(10px);
}

.hero-glow-soft {
    position: absolute;
    right: 6%;
    bottom: -15%;
    width: 48%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(246, 241, 228, 0.10), transparent 70%);
    pointer-events: none;
    filter: blur(6px);
}

.motes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.motes span {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(246, 241, 228, 0.55);
    animation: drift 14s linear infinite;
}

@keyframes drift {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: .9;
    }

    90% {
        opacity: .5;
    }

    100% {
        transform: translateY(-140px) translateX(18px);
        opacity: 0;
    }
}

.hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.05fr .8fr;
    gap: 3rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .95rem;
    border-radius: var(--r-cell);
    background: rgba(240, 234, 222, 0.08);
    border: 1px solid rgba(246, 241, 228, 0.22);
    font-size: .85rem;
    font-weight: 700;
    color: var(--c-cream);
    margin-bottom: 1.5rem;
}

.hero-badge b {
    color: var(--amber-bright);
    font-variant-numeric: tabular-nums;
}

.hero h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1.22;
    margin-bottom: 1.25rem;
    color: var(--c-paper-raised);
}

.hero h1 em {
    font-style: normal;
    color: var(--amber-bright);
}

.hero .lede {
    font-size: 1.14rem;
    color: rgba(246, 241, 228, 0.82);
    max-width: 46ch;
    margin-bottom: 2.1rem;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.6rem;
}

.hero-trust {
    display: flex;
    gap: 1.75rem;
    flex-wrap: wrap;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(246, 241, 228, 0.16);
}

.hero-trust .t-item {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.hero-trust .t-item strong {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--c-paper-raised);
}

.hero-trust .t-item span {
    font-size: .82rem;
    color: rgba(246, 241, 228, 0.65);
}

.hero-art {
    position: relative;
}

.hero-art svg {
    width: 100%;
    height: auto;
}

/* ============ عناصر مشتركة للأقسام ============ */
.section {
    padding: clamp(4.5rem, 8vw, 7rem) 0;
}

.section-head {
    max-width: 640px;
    margin-bottom: 3rem;
}

.section-head h2 {
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    margin-top: .6rem;
    line-height: 1.35;
}

.section-head p {
    color: var(--ink-soft);
    font-size: 1.02rem;
    margin-top: .9rem;
    max-width: 56ch;
}

.section-head.center {
    margin-inline: auto;
    text-align: center;
}

.section-head.center p {
    margin-inline: auto;
}

/* ============ عن المركز ============ */
.about {
    background: var(--paper);
}

.about .wrap {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 3.5rem;
    align-items: center;
}

.about-figure {
    position: relative;
    border-radius: var(--r-tile);
    overflow: hidden;
    background: var(--paper-raised);
    border: 1px solid var(--hairline);
    aspect-ratio: 4/5;
    box-shadow: var(--card-shadow);
}

.about-figure svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.about-copy .section-head {
    margin-bottom: 1.2rem;
}

.about-copy p {
    color: var(--ink-soft);
    margin-bottom: 1.1rem;
    font-size: 1.02rem;
}

.about-list {
    list-style: none;
    margin-top: 1.6rem;
    display: grid;
    gap: .85rem;
}

.about-list li {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    font-weight: 600;
    font-size: .96rem;
}

.about-list li svg {
    flex: none;
    color: var(--teal);
    margin-top: .15rem;
}

/* ============ البرامج ============ */
.programs {
    background: var(--white);
    border-block: 1px solid var(--hairline);
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.4rem;
}

.program-card {
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 1.9rem 1.6rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}

.program-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
    border-color: transparent;
}

.program-mark {
    width: 14px;
    height: 14px;
    border-radius: var(--r-cell);
    margin-bottom: 1.1rem;
}

.program-card .icon {
    width: 38px;
    height: 38px;
    color: var(--teal);
    margin-bottom: 1rem;
}

.program-card h3 {
    font-size: 1.12rem;
    margin-bottom: .55rem;
}

.program-card p {
    font-size: .92rem;
    color: var(--ink-soft);
}

/* ============ رحلة الطالب ============ */
.journey {
    background: var(--paper);
}

.chain {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: relative;
    margin-top: 2.5rem;
}

.chain::before {
    content: "";
    position: absolute;
    top: 26px;
    right: calc(12.5% - 1px);
    left: calc(12.5% - 1px);
    height: 4px;
    border-radius: 2px;
    background: var(--c-line);
}

.chain-node {
    position: relative;
    padding-inline: 1rem;
    text-align: center;
}

.chain-dot {
    width: 56px;
    height: 56px;
    border-radius: var(--r-block);
    background: var(--c-teal-900);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.1rem;
    font-family: var(--font-kufi);
    font-weight: 700;
    color: var(--c-cream);
    font-size: 1.45rem;
    position: relative;
    z-index: 1;
    font-variant-numeric: tabular-nums;
}

.chain-node:first-child .chain-dot {
    background: var(--c-orange);
    color: var(--c-teal-950);
    box-shadow: 0 4px 0 var(--c-orange-edge);
}

.chain-node h3 {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: .4rem;
}

.chain-node p {
    font-size: .92rem;
    color: var(--ink-soft);
    max-width: 22ch;
    margin-inline: auto;
}

/* ============ الإحصائيات ============ */
.stats {
    background: var(--white);
    color: var(--ink);
    border-block: 1px solid var(--hairline);
}

.stats .wrap {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    text-align: center;
}

.stat-item strong {
    display: block;
    font-weight: 800;
    font-size: clamp(2.1rem, 3.4vw, 2.7rem);
    color: var(--teal);
    font-variant-numeric: tabular-nums;
}

.stat-item:nth-child(2n) strong {
    color: var(--amber);
}

.stat-item span {
    font-size: .92rem;
    color: var(--ink-soft);
}

/* ============ الاقتباس ============ */
.quote-band {
    background: var(--paper);
    text-align: center;
}

.quote-band .wrap {
    max-width: 760px;
}

.quote-mark {
    color: var(--gold);
    width: 34px;
    height: 34px;
    margin: 0 auto 1.2rem;
}

.quote-band blockquote {
    font-family: var(--font-matn);
    font-size: clamp(1.3rem, 2.4vw, 1.75rem);
    line-height: 1.7;
    color: var(--ink);
}

.quote-band cite {
    display: block;
    margin-top: 1.3rem;
    font-style: normal;
    font-size: .86rem;
    color: var(--ink-soft);
    font-weight: 700;
}

/* ============ شريط الدعوة ============ */
.cta-band {
    background: var(--c-orange);
    color: var(--c-teal-950);
    position: relative;
    overflow: hidden;
}

.cta-band .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.cta-band h2 {
    color: var(--c-teal-950);
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    margin-bottom: .5rem;
}

.cta-band p {
    color: var(--c-teal-900);
    font-size: .98rem;
}

/* ============ الفوتر ============ */
.site-footer {
    background: var(--ink-deep);
    color: rgba(246, 241, 228, 0.78);
    padding: 4rem 0 1.75rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(246, 241, 228, 0.12);
}

.footer-brand .brand-name b {
    color: var(--c-paper-raised);
}

.footer-brand .brand-name span {
    color: rgba(246, 241, 228, 0.6);
}

.footer-brand p {
    margin-top: 1rem;
    font-size: .9rem;
    max-width: 32ch;
    color: rgba(246, 241, 228, 0.65);
}

.footer-social {
    display: flex;
    gap: .7rem;
    margin-top: 1.2rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: var(--r-block);
    border: 1px solid rgba(246, 241, 228, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .3s, border-color .3s, transform .3s var(--ease);
}

.footer-social a:hover {
    background: rgba(246, 241, 228, 0.1);
    border-color: rgba(246, 241, 228, 0.4);
    transform: translateY(-2px);
}

.footer-social svg {
    width: 16px;
    height: 16px;
}

.site-footer h4 {
    color: var(--c-paper);
    font-size: .9rem;
    margin-bottom: 1.1rem;
    font-weight: 800;
}

.site-footer ul {
    list-style: none;
    display: grid;
    gap: .65rem;
}

.site-footer ul a {
    font-size: .88rem;
    transition: color .25s;
}

.site-footer ul a:hover {
    color: var(--c-paper);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding-top: 1.75rem;
    font-size: .8rem;
    color: rgba(246, 241, 228, 0.55);
}

/* ============ هيرو الصفحات الداخلية ============ */
.page-hero {
    position: relative;
    background: var(--c-teal-900);
    color: var(--c-paper);
    padding: calc(6.5rem + 2.25rem) 0 3.5rem;
    overflow: hidden;
}

.page-hero .hero-pattern {
    position: absolute;
    inset: 0;
    opacity: .08;
    pointer-events: none;
}

.page-hero .wrap {
    position: relative;
    z-index: 1;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .82rem;
    color: rgba(246, 241, 228, 0.6);
    margin-bottom: 1.1rem;
}

.breadcrumb a {
    color: rgba(246, 241, 228, 0.85);
    transition: color .2s;
}

.breadcrumb a:hover {
    color: var(--c-paper-raised);
}

.page-hero .eyebrow {
    color: var(--amber-bright);
}

.page-hero h1 {
    color: var(--c-paper-raised);
    font-size: clamp(1.9rem, 3.6vw, 2.6rem);
    margin-top: .6rem;
    max-width: 22ch;
}

.page-hero p.lede {
    color: rgba(246, 241, 228, 0.82);
    margin-top: .9rem;
    max-width: 58ch;
    font-size: 1.05rem;
}

/* ============ صفحة الأنشطة (المركزية) ============ */
.activities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.4rem;
}

.activity-card {
    display: block;
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 2rem 1.8rem;
    box-shadow: var(--card-shadow);
    transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}

.activity-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
    border-color: transparent;
}

.activity-card .icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: var(--r-block);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
}

.activity-card .icon-wrap svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.activity-card h3 {
    font-size: 1.25rem;
    margin-bottom: .6rem;
}

.activity-card p {
    color: var(--ink-soft);
    font-size: .95rem;
    margin-bottom: 1rem;
}

.activity-card .go-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .88rem;
    font-weight: 700;
    color: var(--teal);
}

.activity-card .go-link svg {
    width: 15px;
    height: 15px;
    transition: transform .3s var(--ease);
}

.activity-card:hover .go-link svg {
    transform: translateX(-4px);
}

/* ============ صفحة تفاصيل النشاط ============ */
.feature-list {
    list-style: none;
    display: grid;
    gap: 1.1rem;
    margin-top: 1rem;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    background: var(--white);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
}

.feature-list .num {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: var(--r-cell);
    background: var(--c-teal-900);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-kufi);
    font-weight: 700;
    color: var(--c-cream);
    font-size: 1rem;
}

.feature-list h4 {
    font-size: 1.02rem;
    margin-bottom: .3rem;
    font-weight: 800;
}

.feature-list p {
    color: var(--ink-soft);
    font-size: .92rem;
}

/* ============ لوحة المعلم: الطلاب والتقارير ============ */
.teacher-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.teacher-toolbar h2 {
    font-size: 1.7rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .88rem;
    font-weight: 700;
    color: var(--teal);
    margin-bottom: .9rem;
}

.back-link svg {
    width: 15px;
    height: 15px;
}

.data-table-wrap {
    background: var(--white);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.data-table th,
.data-table td {
    padding: .9rem 1.1rem;
    text-align: right;
    border-bottom: 1px solid var(--hairline);
    font-size: .9rem;
    white-space: nowrap;
}

.data-table th {
    background: var(--c-paper);
    font-weight: 800;
    color: var(--c-ink-soft);
    font-size: .85rem;
}

.data-table td {
    font-variant-numeric: tabular-nums;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--c-teal-50);
}

.data-table .notes-cell {
    white-space: normal;
    max-width: 260px;
    color: var(--ink-soft);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .7rem;
    border-radius: var(--r-cell);
    font-size: .82rem;
    font-weight: 700;
}

.status-pill.active {
    background: rgba(14, 107, 92, 0.1);
    color: var(--teal);
}

.status-pill.inactive {
    background: rgba(75, 95, 88, 0.1);
    color: var(--ink-soft);
}

.status-pill.warn {
    background: rgba(184, 106, 44, 0.12);
    color: var(--amber);
}

.status-pill.danger {
    background: rgba(184, 54, 42, 0.1);
    color: var(--mark-madd);
}

/* ============ صفحة أداء الطلاب (التجويد) ============ */
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.4rem;
}

.performance-card {
    background: var(--white);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.performance-card-head {
    background: var(--paper);
    border-bottom: 1px solid var(--hairline);
    padding: 1.2rem 1.4rem;
}

.performance-card-head h3 {
    font-size: 1.1rem;
    margin-bottom: .2rem;
}

.performance-card-head span {
    font-size: .82rem;
    color: var(--ink-soft);
}

.performance-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .7rem;
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid var(--hairline);
}

.performance-summary .stat {
    text-align: center;
}

.performance-summary .stat strong {
    display: block;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--teal);
    font-variant-numeric: tabular-nums;
}

.performance-summary .stat span {
    font-size: .74rem;
    color: var(--ink-soft);
}

.performance-rows {
    padding: .5rem 1.4rem 1.2rem;
}

/* دقة كل حكم كشريط كوفي من 10 مربعات، بلون الحالة (وليس البرتقالي المحجوز للمكان) */
.performance-row-score {
    display: grid;
    justify-items: end;
    gap: .35rem;
    flex: none;
}

.accuracy-strip {
    display: flex;
    gap: 3px;
}

.accuracy-strip i {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--c-line);
}

.accuracy-strip.is-good i.on { background: var(--c-correct); }
.accuracy-strip.is-mid i.on { background: var(--c-hint); }
.accuracy-strip.is-low i.on { background: var(--c-wrong); }

.performance-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .8rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--hairline);
}

.performance-row:last-child {
    border-bottom: none;
}

.performance-row-title {
    font-size: .88rem;
    font-weight: 700;
}

.performance-row-sub {
    display: block;
    font-size: .76rem;
    font-weight: 400;
    color: var(--ink-soft);
    margin-top: .15rem;
}

.performance-empty {
    padding: 1.4rem;
    text-align: center;
    font-size: .88rem;
    color: var(--ink-soft);
}

.rating-stars {
    color: var(--c-hint-deep);
    letter-spacing: 0;
    font-size: .95rem;
}

.table-actions {
    display: flex;
    gap: .5rem;
}

.table-actions a {
    font-size: .8rem;
    font-weight: 700;
    padding: .4rem .75rem;
    border-radius: var(--r-cell);
    border: 1px solid var(--hairline);
    color: var(--ink-soft);
    transition: border-color .2s, color .2s;
}

.table-actions a:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.table-actions a.danger:hover {
    border-color: var(--mark-madd);
    color: var(--mark-madd);
}

.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--ink-soft);
    background: var(--white);
    border: 1px dashed var(--hairline);
    border-radius: var(--radius);
}

.empty-state p {
    margin-bottom: 1.2rem;
}

.form-card {
    background: var(--white);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: clamp(1.6rem, 4vw, 2.2rem);
    max-width: 640px;
}

.form-card .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.form-card textarea {
    width: 100%;
    padding: .78rem 1rem;
    border: 1px solid var(--hairline);
    border-radius: var(--r-block);
    font-family: inherit;
    font-size: .95rem;
    background: var(--c-white);
    color: var(--ink);
    resize: vertical;
    min-height: 100px;
}

.form-card select {
    width: 100%;
    min-height: 48px;
    padding: .78rem 1rem;
    border: 1px solid var(--hairline);
    border-radius: var(--r-block);
    font-family: inherit;
    font-size: .95rem;
    background: var(--c-white);
    color: var(--ink);
}

.form-card-actions {
    display: flex;
    gap: .8rem;
    margin-top: 1.6rem;
}

/* ============ صفحة تسجيل الدخول ============ */
.auth-section {
    background: var(--paper);
    /* the header is a solid fixed band (~84px), so the card starts below it */
    padding: calc(84px + clamp(2rem, 5vw, 3.5rem)) 0 clamp(3.5rem, 7vw, 5.5rem);
}

.auth-wrap {
    max-width: 440px;
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: clamp(1.8rem, 4vw, 2.6rem);
}

.auth-card-head {
    text-align: center;
    margin-bottom: 1.8rem;
}

.auth-card-head img {
    height: 46px;
    margin: 0 auto .9rem;
}

.auth-card-head h1 {
    font-size: 1.6rem;
}

.auth-card-head p {
    color: var(--ink-soft);
    font-size: .9rem;
    margin-top: .4rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: .88rem;
    font-weight: 700;
    margin-bottom: .5rem;
    color: var(--ink);
}

.form-group input {
    width: 100%;
    min-height: 48px;
    padding: .78rem 1rem;
    border: 1px solid var(--hairline);
    border-radius: var(--r-block);
    font-family: inherit;
    font-size: .95rem;
    background: var(--c-white);
    color: var(--ink);
    transition: border-color .25s, background .25s;
}

/* مربعات الاختيار داخل النماذج: صغيرة وبجانب نصها */
.form-group label:has(> input[type="checkbox"]),
.form-group label:has(> input[type="radio"]) {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 600;
    color: var(--c-ink-soft);
    cursor: pointer;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: 20px;
    height: 20px;
    min-height: 0;
    padding: 0;
    flex: none;
    accent-color: var(--c-teal-700);
}

.form-group input:focus,
.form-card textarea:focus,
.form-card select:focus {
    outline: none;
    border-color: var(--c-teal-700);
    background: var(--c-white);
    box-shadow: 0 0 0 3px rgba(14, 107, 92, .16);
}

.auth-remember label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
}

.auth-remember input {
    width: auto;
}

.auth-error {
    background: var(--c-wrong-100);
    border: 1px solid rgba(184, 54, 42, .28);
    border-radius: var(--r-block);
    padding: .9rem 1.1rem;
    margin-bottom: 1.4rem;
}

.auth-error p {
    color: var(--mark-madd);
    font-size: .88rem;
    margin: 0;
}

.auth-error p+p {
    margin-top: .4rem;
}

.auth-submit {
    width: 100%;
    margin-top: .4rem;
}

.auth-note {
    text-align: center;
    font-size: .84rem;
    color: var(--ink-soft);
    margin-top: 1.6rem;
    line-height: 1.9;
}

.auth-note a {
    color: var(--teal);
    font-weight: 700;
}

/* ============ الشعار: الشعار كريمي، فمكانه دائمًا على مربع أخضر عميق ============ */
.brand-mark-img,
.auth-card-head img {
    background: var(--c-teal-900);
    border-radius: var(--r-block);
    padding: 6px;
    box-sizing: content-box;
}

.brand-name {
    white-space: nowrap;
}

/* زر الدعوة في الشريط العلوي يبقى برتقاليًا بنص أخضر عميق فوق أي هيرو */
.main-nav a.btn,
.site-header .main-nav a.btn-amber {
    color: var(--c-teal-950) !important;
}

/* ============ بطاقات الأنشطة: مربع أيقونة كوفي واحد اللون ============ */
.activity-card .icon-wrap {
    background: var(--c-teal-900);
    transition: background .3s var(--ease);
}

.activity-card .icon-wrap svg {
    color: var(--c-cream);
}

.activity-card:hover .icon-wrap {
    background: var(--c-orange);
}

.activity-card:hover .icon-wrap svg {
    color: var(--c-teal-950);
}

/* ============ الاستجابة للشاشات ============ */
/* ============ الشريط العلوي: دائمًا على المسرح الأخضر، مكان الشعار الطبيعي ============ */
.site-header {
    background: var(--c-teal-900);
}

.site-header.scrolled {
    background: var(--c-teal-950);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 1px 0 rgba(240, 234, 222, .08);
}

.site-header .brand-name b {
    color: var(--c-cream);
}

.site-header .brand-name span {
    color: var(--c-on-teal-soft);
}

.site-header .main-nav a {
    color: rgba(240, 234, 222, .82);
}

.site-header .main-nav a:hover {
    color: var(--c-cream);
}

.site-header .nav-toggle {
    color: var(--c-cream);
}

@media (max-width: 1180px) {
    .site-header #mainNav a {
        color: var(--c-ink-soft);
    }

    .site-header .mobile-nav-head .brand-name b {
        color: var(--c-ink);
    }

    .site-header .mobile-nav-head .brand-name span {
        color: var(--c-ink-soft);
    }
}

/* القائمة تتحول إلى درج جانبي قبل أن تزدحم */
@media (max-width: 1180px) {
    .main-nav {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(320px, 88vw);
        height: 100vh;
        background: var(--paper-raised);
        flex-direction: column;
        align-items: flex-start;
        padding: 5.5rem 1.75rem 2rem;
        gap: 1.6rem;
        transform: translateX(-100%);
        transition: transform .4s var(--ease);
        box-shadow: none;
        z-index: 2;
        overflow-y: auto;
    }

    #mainNav a {
        color: var(--ink-soft);
    }

    .main-nav.open {
        transform: translateX(0);
        box-shadow: 20px 0 40px rgba(7, 43, 37, 0.25);
    }

    .nav-toggle {
        display: flex;
    }

    .mobile-nav-head {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding-bottom: 1.25rem;
        margin-bottom: .3rem;
        border-bottom: 1px solid var(--hairline);
    }

    .mobile-nav-head .brand-mark-img {
        height: 36px;
    }

    .mobile-nav-head .brand-name b {
        font-size: 1rem;
    }
}

@media (max-width: 980px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-art {
        order: -1;
        max-width: 280px;
        margin-inline: auto;
    }

    .about .wrap {
        grid-template-columns: 1fr;
    }

    .about-figure {
        max-width: 380px;
        margin-inline: auto;
        order: -1;
    }

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

    .activities-grid {
        grid-template-columns: 1fr;
    }

    .chain {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 2.5rem;
    }

    .chain::before {
        display: none;
    }

    .stats .wrap {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .program-grid {
        grid-template-columns: 1fr;
    }

    .form-card .form-row {
        grid-template-columns: 1fr;
    }

    .performance-grid {
        grid-template-columns: 1fr;
    }

    .performance-summary {
        grid-template-columns: repeat(3, 1fr);
        gap: .4rem;
    }

    .teacher-toolbar {
        align-items: flex-start;
    }

    .chain {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .cta-band .wrap {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-trust {
        gap: 1.2rem;
    }

    /* الجداول تتحول لكروت مكدّسة بدل التمرير الأفقي على الموبايل */
    .data-table-wrap {
        overflow-x: visible;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .data-table {
        min-width: 0;
    }

    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        background: var(--white);
        border: 1px solid var(--hairline);
        border-radius: var(--radius);
        box-shadow: var(--card-shadow);
        margin-bottom: 1rem;
        overflow: hidden;
    }

    .data-table tr:last-child {
        margin-bottom: 0;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
        padding: .7rem 1rem;
        border-bottom: 1px solid var(--hairline);
        white-space: normal;
        text-align: left;
    }

    .data-table td:last-child {
        border-bottom: none;
    }

    .data-table td::before {
        content: attr(data-label);
        flex: none;
        font-weight: 800;
        font-size: .78rem;
        color: var(--ink-soft);
    }

    .data-table td.notes-cell {
        max-width: none;
    }

    .table-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}

/* رسالة الخطأ فوق نموذج ضيق تأخذ عرضه نفسه */
.auth-error:has(+ .form-card),
.auth-error:has(+ form .form-card) {
    max-width: 640px;
}


/* رابط القسم الحالي في الشريط العلوي: القوس البرتقالي ثابت تحته */
.main-nav a.is-current {
    color: var(--c-cream);
}

.main-nav a.is-current::after {
    transform: scaleX(1);
}

@media (max-width: 1180px) {
    .site-header #mainNav a.is-current {
        color: var(--c-teal-900);
        font-weight: 800;
    }
}

.text-link {
    color: var(--c-teal-700);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* شبكة الألعاب: ثلاثة أعمدة على الشاشات الواسعة */
.activities-grid.games-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}


/* زر الدخول / الخروج في آخر الشريط العلوي */
.main-nav .nav-auth {
    margin: 0;
}

.main-nav form.nav-auth .btn {
    font: inherit;
    font-weight: 800;
    font-size: .92rem;
    min-height: 44px;
    padding-block: .5rem;
}

@media (max-width: 1180px) {
    .main-nav .nav-auth,
    .main-nav form.nav-auth .btn {
        width: 100%;
    }

    .main-nav a.btn.nav-auth {
        margin-top: .5rem;
    }

    /* داخل الدرج الفاتح: زر الخروج بحدود داكنة بدل الكريمي */
    .main-nav form.nav-auth .btn-outline-teal {
        color: var(--c-ink);
        border-color: var(--c-line);
    }
}

/* ==========================================================================
   الصفحة الرئيسية على الجوال: العنوان والدعوة في الشاشة الأولى، والأقسام أقصر
   ========================================================================== */
@media (max-width: 600px) {
    .section {
        padding: 3.25rem 0;
    }

    .section-head {
        margin-bottom: 1.75rem;
    }

    /* ---- الهيرو ---- */
    .hero {
        padding: calc(84px + 2rem) 0 2.75rem;
    }

    .hero-inner {
        gap: 0;
    }

    /* الرسمة الزخرفية تدفع العنوان تحت الشاشة الأولى؛ تبقى على الشاشات الأكبر فقط */
    .hero-art {
        display: none;
    }

    /* النقاط العائمة تقع فوق النص على الشاشة الضيقة */
    .hero .motes {
        display: none;
    }

    .hero-badge {
        margin-bottom: 1.1rem;
        font-size: .82rem;
    }

    .hero h1 {
        font-size: clamp(2rem, 9vw, 2.5rem);
        line-height: 1.3;
        margin-bottom: 1rem;
    }

    .hero .lede {
        font-size: 1.05rem;
        margin-bottom: 1.6rem;
    }

    .hero-ctas {
        display: grid;
        grid-template-columns: 1fr;
        gap: .75rem;
        margin-bottom: 2rem;
    }

    .hero-ctas .btn {
        width: 100%;
        min-height: 52px;
        font-size: 1rem;
    }

    /* نقاط الثقة: قائمة مدمجة، العنوان والشرح في سطر واحد */
    .hero-trust {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        padding-top: .5rem;
    }

    .hero-trust .t-item {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        gap: .75rem;
        padding: .7rem 0;
        border-bottom: 1px solid rgba(240, 234, 222, .1);
    }

    .hero-trust .t-item:last-child {
        border-bottom: 0;
    }

    .hero-trust .t-item strong {
        font-size: .95rem;
        white-space: nowrap;
    }

    .hero-trust .t-item span {
        font-size: .8rem;
        text-align: left;
    }

    /* ---- عن المركز: الرسمة زخرفية فقط ---- */
    .about-figure {
        display: none;
    }

    /* ---- البرامج: بطاقات أقصر، الأيقونة بجانب العنوان ---- */
    .program-grid {
        gap: .75rem;
    }

    .program-card {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: .9rem;
        align-items: start;
        padding: 1.2rem 1.1rem;
    }

    .program-card .program-mark {
        display: none;
    }

    .program-card .icon {
        grid-row: span 2;
        width: 44px;
        height: 44px;
        padding: 9px;
        margin: 0;
        border-radius: var(--r-block);
        background: var(--c-teal-100);
    }

    .program-card h3 {
        margin-bottom: .25rem;
    }

    /* ---- رحلة الطالب: خط زمني عمودي، الرقم بجانب النص ---- */
    .chain {
        grid-template-columns: 1fr;
        row-gap: 0;
        margin-top: 0;
    }

    .chain-node {
        display: grid;
        grid-template-columns: 48px 1fr;
        column-gap: 1rem;
        text-align: right;
        padding: 0 0 1.4rem;
        position: relative;
    }

    .chain-node:not(:last-child)::before {
        content: "";
        position: absolute;
        top: 52px;
        bottom: 4px;
        inset-inline-start: 23px;
        width: 3px;
        border-radius: 2px;
        background: var(--c-line);
    }

    .chain-dot {
        width: 48px;
        height: 48px;
        margin: 0;
        grid-row: span 2;
        font-size: 1.25rem;
    }

    .chain-node h3 {
        margin: .55rem 0 .2rem;
    }

    .chain-node p {
        max-width: none;
        margin: 0;
    }

    /* ---- الإحصائيات والدعوة ---- */
    .stats .wrap {
        gap: 1.5rem 1rem;
    }

    .cta-band .btn {
        width: 100%;
    }

    /* ---- الفوتر: الروابط في عمودين بدل قائمة طويلة ---- */
    .site-footer {
        padding-top: 3rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem 1.25rem;
    }

    .footer-grid > :first-child,
    .footer-grid > :last-child {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: .35rem;
    }
}
