/* ===== معهد الرواد — تصميم الموقع العام ===== */
:root {
    --primary: #3F3592;
    --secondary: #5B2EA6;
    --accent: #6690C8;
    --ink: #24222e;
    --muted: #6c6a7a;
    --line: #e3e1ec;
    --soft: #f4f3f8;
    --soft2: #faf9fd;
    --white: #fff;
    --radius: 18px;
    --shadow: 0 10px 30px rgba(40, 30, 100, .08);
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
    color: var(--ink);
    background: var(--white);
    line-height: 1.8;
    font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .5em; color: var(--ink); }
p { margin: 0 0 1em; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* أزرار */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 26px; border-radius: 999px; font-weight: 700; font-size: 15px;
    border: 2px solid transparent; cursor: pointer; transition: .2s; font-family: inherit;
}
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 8px 20px rgba(63, 53, 146, .25); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-light { background: #fff; color: var(--primary); }
.btn-ghost { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-block { width: 100%; }

/* الهيدر */
.topbar { background: var(--primary); color: #dcd8f5; font-size: 13px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 7px 0; flex-wrap: wrap; }
.topbar a { color: #fff; }
.topbar .items { display: flex; gap: 18px; flex-wrap: wrap; }

.header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 78px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 54px; width: auto; }
.brand .name { font-weight: 800; color: var(--primary); font-size: 15px; line-height: 1.3; }
.brand .name small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 15px; }
.nav a:hover, .nav a.active { color: var(--primary); background: var(--soft); }
.nav .btn { margin-inline-start: 8px; color: #fff; }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--primary); }

/* الواجهة */
.hero { position: relative; overflow: hidden; background: var(--gradient); color: #fff; padding: 80px 0 110px; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.hero::before { width: 520px; height: 520px; left: -160px; bottom: -260px; }
.hero::after { width: 380px; height: 380px; right: -120px; top: -160px; }
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 50px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(30px, 4.6vw, 50px); font-weight: 800; }
.hero p { color: #e4e0fa; font-size: 18px; max-width: 600px; }
.badge { display: inline-block; padding: 6px 16px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.journey { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; align-items: center; color: #c9d6f2; font-weight: 700; }
.journey span + span::before { content: "|"; margin-inline-end: 8px; opacity: .5; }
.hero-card { background: #fff; border-radius: 28px; padding: 34px; box-shadow: 0 30px 60px rgba(10, 5, 50, .3); }
.hero-card img { margin-inline: auto; max-height: 300px; object-fit: contain; }
.hero-card.photo { padding: 0; overflow: hidden; }
.hero-card.photo img { width: 100%; max-height: none; height: 380px; object-fit: cover; }

/* الإحصائيات */
.stats { margin-top: -60px; position: relative; z-index: 2; }
.stats .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { background: #fff; border-radius: var(--radius); padding: 26px 20px; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--line); }
.stat b { display: block; font-size: 38px; color: var(--primary); font-weight: 800; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 14px; }

/* الأقسام */
.section { padding: 90px 0; }
.section.alt { background: var(--soft2); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 46px; }
.section-head .eyebrow { color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .5px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); color: var(--primary); }
.divider { height: 4px; width: 80px; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--primary)); margin: 12px auto 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* بطاقة برنامج */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .25s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .thumb { aspect-ratio: 16/9; background: var(--gradient); position: relative; display: flex; align-items: center; justify-content: center; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .placeholder { color: #fff; font-size: 24px; font-weight: 800; padding: 20px; text-align: center; }
.card .thumb .tag { position: absolute; top: 14px; right: 14px; background: #fff; color: var(--primary); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.card .body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.card h3 { font-size: 20px; color: var(--primary); margin-bottom: 6px; }
.card p { color: var(--muted); font-size: 15px; flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.chip { background: var(--soft); color: var(--primary); font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.chip.free { background: #e6f6ee; color: #16794a; }
.card .more { font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }

/* الرحلة */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px; counter-reset: s; position: relative; }
.step { text-align: center; padding: 10px; }
.step .num { width: 56px; height: 56px; border-radius: 50%; background: var(--gradient); color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; box-shadow: 0 8px 18px rgba(63, 53, 146, .25); }
.step h4 { color: var(--primary); font-size: 18px; margin-bottom: 4px; }
.step p { color: var(--muted); font-size: 14px; margin: 0; }

/* من نحن */
.about-img { border-radius: 26px; background: var(--soft); padding: 40px; display: flex; justify-content: center; }
.about-img.photo { padding: 0; overflow: hidden; }
.about-img.photo img { width: 100%; height: 100%; object-fit: cover; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { padding-inline-start: 32px; position: relative; }
.check-list li::before { content: "✓"; position: absolute; right: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--soft); color: var(--primary); font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.vm { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.vm .icon { width: 50px; height: 50px; border-radius: 14px; background: var(--gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 14px; }
.vm h3 { color: var(--primary); }

/* الشركاء */
.partners { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
.partner { background: #fff; border: 1px solid var(--line); border-radius: 16px; min-height: 110px; padding: 18px; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 700; color: var(--primary); font-size: 15px; }
.partner img { max-height: 70px; width: auto; filter: grayscale(.2); }

/* الأسئلة */
.faq { max-width: 860px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px 22px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); padding-bottom: 12px; margin: 0; }

/* شريط الدعوة */
.cta { background: var(--gradient); border-radius: 28px; color: #fff; padding: 50px; display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; position: relative; overflow: hidden; }
.cta h2 { color: #fff; font-size: 30px; }
.cta p { color: #e4e0fa; margin: 0; }

/* رأس الصفحات الداخلية */
.page-head { background: var(--gradient); color: #fff; padding: 56px 0; position: relative; overflow: hidden; }
.page-head::after { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; background: rgba(255, 255, 255, .06); left: -100px; top: -140px; }
.page-head h1 { color: #fff; font-size: clamp(26px, 4vw, 40px); margin: 0; }
.page-head p { color: #e4e0fa; margin: 8px 0 0; }
.crumbs { font-size: 14px; color: #c9c3f0; margin-bottom: 8px; }
.crumbs a { color: #fff; }

/* فلاتر */
.filters { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 30px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs a { padding: 8px 18px; border-radius: 999px; background: var(--soft); color: var(--ink); font-weight: 600; font-size: 14px; }
.tabs a.active { background: var(--primary); color: #fff; }
.search { display: flex; gap: 8px; }
.search input { min-width: 240px; }

/* تفاصيل البرنامج */
.detail { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.info-boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 30px; }
.info-box { background: var(--soft); border-radius: 16px; padding: 18px; }
.info-box small { color: var(--muted); display: block; font-size: 13px; }
.info-box b { color: var(--primary); font-size: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-bottom: 24px; background: #fff; }
.panel h2, .panel h3 { color: var(--primary); font-size: 20px; }
.pill-title { display: inline-block; background: var(--primary); color: #fff; padding: 6px 20px; border-radius: 999px; font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.sidebar { position: sticky; top: 100px; }
.sidebar .panel { background: var(--soft2); }
.sidebar dl { margin: 0 0 18px; display: grid; gap: 10px; }
.sidebar dl div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; font-size: 14.5px; }
.sidebar dt { color: var(--muted); }
.sidebar dd { margin: 0; font-weight: 700; text-align: left; }
.timeline { display: grid; gap: 0; }
.timeline .row { display: flex; gap: 16px; padding-bottom: 20px; position: relative; }
.timeline .row:not(:last-child)::before { content: ""; position: absolute; right: 21px; top: 44px; bottom: 0; width: 2px; background: var(--line); }
.timeline .num { flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.timeline h4 { margin: 8px 0 2px; color: var(--primary); }
.timeline p { margin: 0; color: var(--muted); font-size: 15px; }
.prose { white-space: pre-line; }

/* النماذج */
.form { display: grid; gap: 18px; }
.form .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { font-weight: 600; font-size: 14.5px; display: block; margin-bottom: 6px; }
label .req { color: #d33; }
input[type=text], input[type=email], input[type=tel], input[type=search], input[type=password], input[type=number], input[type=file], select, textarea {
    width: 100%; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px;
    font: inherit; font-size: 15px; background: #fff; color: var(--ink); transition: .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(102, 144, 200, .15); }
textarea { min-height: 130px; resize: vertical; }
.radio-row { display: flex; gap: 20px; padding-top: 6px; }
.radio-row label { font-weight: 500; display: flex; gap: 6px; align-items: center; margin: 0; }
.error { color: #c62828; font-size: 13px; margin-top: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 16px 20px; border-radius: 14px; margin-bottom: 20px; }
.alert-success { background: #e6f6ee; color: #16794a; border: 1px solid #bfe6d1; }
.alert-error { background: #fdecec; color: #b42318; border: 1px solid #f6c9c9; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 34px; box-shadow: var(--shadow); }

/* التواصل */
.contact-items { display: grid; gap: 14px; }
.contact-item { display: flex; gap: 14px; align-items: center; background: var(--soft2); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.contact-item .ic { flex: 0 0 46px; height: 46px; border-radius: 12px; background: var(--gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.contact-item small { display: block; color: var(--muted); }
.contact-item b { color: var(--ink); direction: ltr; unicode-bidi: plaintext; }
.map { border: 0; width: 100%; height: 340px; border-radius: 20px; margin-top: 40px; }

/* الأخبار */
.post-card .thumb { aspect-ratio: 16/10; }
.date { color: var(--accent); font-size: 13px; font-weight: 700; }
.article { max-width: 820px; margin: 0 auto; }
.article .cover { border-radius: 22px; margin-bottom: 30px; width: 100%; }
.article .prose { font-size: 17.5px; }

/* الترقيم */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line); font-weight: 600; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { opacity: .4; }

/* الفوتر */
.footer { background: #1d1846; color: #bdb8de; padding: 70px 0 0; margin-top: 0; }
.footer .cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; }
.footer h4 { color: #fff; font-size: 17px; margin-bottom: 16px; }
.footer a { color: #bdb8de; }
.footer a:hover { color: #fff; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer .logo-box { background: #fff; border-radius: 16px; padding: 12px 16px; display: inline-block; margin-bottom: 16px; }
.footer .logo-box img { height: 56px; }
.socials { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.socials a { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .08); display: flex; align-items: center; justify-content: center; }
.socials a:hover { background: var(--accent); }
.socials a i { color: #fff; font-size: 17px; }
.footer .bottom { border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 50px; padding: 20px 0; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }

.whatsapp-float { position: fixed; bottom: 22px; left: 22px; z-index: 60; width: 58px; height: 58px; border-radius: 50%; background: #25d366; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(0, 0, 0, .2); }
.whatsapp-float i { color: #fff; font-size: 32px; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); background: var(--soft2); border-radius: var(--radius); }

/* الجوال */
@media (max-width: 1000px) {
    .hero .container, .grid-2, .detail { grid-template-columns: 1fr; }
    .hero-card { max-width: 420px; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .grid-4, .stats .grid { grid-template-columns: 1fr 1fr; }
    .footer .cols { grid-template-columns: 1fr 1fr; }
    .sidebar { position: static; }
    .menu-toggle { display: block; }
    .nav { display: none; position: absolute; top: 100%; right: 0; left: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 12px 16px 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
    .nav.open { display: flex; }
    .nav .btn { margin: 8px 0 0; }
    .header .container { position: relative; }
}
@media (max-width: 640px) {
    .section { padding: 60px 0; }
    .hero { padding: 50px 0 100px; }
    .grid-3, .footer .cols, .form .row-2, .info-boxes { grid-template-columns: 1fr; }
    .stat b { font-size: 30px; }
    .cta { padding: 34px 24px; }
    .search, .search input { width: 100%; min-width: 0; }
    .brand .name { display: none; }
    .topbar .hide-sm { display: none; }
    .form-card { padding: 22px; }
}
