/* =========================================================
   Nest Media — Stylesheet
   ========================================================= */
:root {
    --bg:        #0a0f1e;
    --bg-2:      #0d1426;
    --card:      #111a2e;
    --card-2:    #0f1728;
    --border:    rgba(255, 255, 255, .08);
    --border-2:  rgba(255, 255, 255, .14);
    --text:      #eef2fb;
    --muted:     #9aa8c4;
    --muted-2:   #6b7a99;
    --blue:      #3b82f6;
    --blue-2:    #2563eb;
    --purple:    #8b5cf6;
    --green:     #34d399;
    --radius:    16px;
    --radius-sm: 10px;
    --shadow:    0 20px 50px -20px rgba(0, 0, 0, .6);
    --grad:      linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
    --font:      'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-ar:   'Cairo', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    background: radial-gradient(1200px 600px at 50% -10%, #16223f 0%, var(--bg) 55%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body.rtl { font-family: var(--font-ar); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(1120px, 92%); margin-inline: auto; }
.center { text-align: center; }
.narrow { max-width: 560px; margin-inline: auto; }
.container.narrow { max-width: 720px; }

.seo-body {
    color: var(--muted);
    line-height: 1.75;
    margin: 0 0 1.25rem;
    font-size: 1.02rem;
}

.faq-list { display: grid; gap: .75rem; }
.faq-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .25rem 1.1rem;
}
.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: .85rem 0;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: inline;
}
.faq-item p {
    margin: 0 0 1rem;
    color: var(--muted);
    line-height: 1.65;
}
.muted { color: var(--muted); }
.site-main { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .7rem 1.3rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
    font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: .95rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(99, 102, 241, .8); }
.btn-primary:hover { box-shadow: 0 16px 30px -10px rgba(99, 102, 241, .9); }
.btn-outline { border-color: var(--border-2); color: var(--text); background: rgba(255,255,255,.02); }
.btn-outline:hover { border-color: var(--blue); background: rgba(59,130,246,.08); }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.05); }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(10, 15, 30, .7);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: .85rem 0;
}
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 800; font-size: 1.15rem; }
.brand-logo { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; }
.brand-mark {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.3rem;
}
.main-nav { display: flex; gap: 1.2rem; margin-inline-start: 1rem; }
.main-nav a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.main-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: .6rem; margin-inline-start: auto; }
.user-chip { color: var(--muted); font-size: .9rem; }

/* Language switch (مثل التطبيق) */
.lang-switch { display: inline-flex; gap: .25rem; background: rgba(255,255,255,.05); padding: .25rem; border-radius: 10px; }
.lang-pill { padding: .25rem .55rem; border-radius: 7px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.lang-pill:hover { color: var(--text); }
.lang-pill.active { background: var(--grad); color: #fff; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 6rem 0 4rem; overflow: hidden; }
.hero-glow {
    position: absolute; inset: 0;
    background: radial-gradient(600px 300px at 50% 0%, rgba(139,92,246,.25), transparent 70%);
    pointer-events: none;
}
.hero-inner { position: relative; text-align: center; max-width: 760px; margin-inline: auto; }
.eyebrow {
    display: inline-block; letter-spacing: .18em; text-transform: uppercase;
    font-size: .75rem; font-weight: 700; color: var(--purple); margin-bottom: 1rem;
}
.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1; margin: 0 0 1.2rem;
    font-weight: 800;
    background: linear-gradient(120deg, #fff 20%, #b7c4e6 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-subtitle { font-size: 1.15rem; color: var(--muted); margin: 0 auto 2rem; max-width: 620px; }

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,.02)); }
.section-head { text-align: center; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 .5rem; }
.section-head p { color: var(--muted); margin: 0; }

/* ---------- Program cards ---------- */
.cards-grid {
    display: grid; gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.program-card {
    position: relative;
    background: linear-gradient(180deg, var(--card), var(--card-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem;
    display: flex; flex-direction: column; gap: .7rem;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
    overflow: hidden;
    cursor: pointer;
}
.program-card-hit {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.program-card-actions {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin-top: .4rem;
}
.program-card-actions .btn { width: 100%; }
.program-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: var(--accent, var(--grad)); opacity: .8;
}
.program-card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow); }
.program-card-top { display: flex; align-items: center; justify-content: space-between; }
.program-icon {
    width: 52px; height: 52px; border-radius: 13px;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--accent, var(--blue)) 22%, transparent);
    font-size: 1.5rem; overflow: hidden;
}
.program-icon img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.program-icon.soon { background: rgba(255,255,255,.05); color: var(--muted); font-size: 2rem; }
.program-card h3 { margin: .2rem 0 0; font-size: 1.25rem; }
.program-tagline { color: var(--muted); margin: 0; font-size: .95rem; flex: 1; position: relative; z-index: 2; }
.program-card h3 { position: relative; z-index: 2; }
.program-card-top { position: relative; z-index: 2; }
.program-card .btn { margin-top: 0; }
.program-card-soon { border-style: dashed; align-items: flex-start; }
.program-card-soon::before { display: none; }

.badge { font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.badge-free { background: rgba(52,211,153,.15); color: var(--green); }
.badge-paid { background: rgba(139,92,246,.15); color: var(--purple); }

/* ---------- Program page ---------- */
.program-hero { position: relative; padding: 4rem 0 3rem; overflow: hidden; }
.program-hero .hero-glow {
    background: radial-gradient(600px 320px at 20% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%);
}
.program-hero-inner { position: relative; display: grid; grid-template-columns: 1.2fr .8fr; gap: 3rem; align-items: center; }
.program-hero-text h1 { font-size: clamp(2rem, 4vw, 3rem); margin: .8rem 0 .6rem; }
.program-hero-text .lead { font-size: 1.2rem; color: var(--text); margin: 0 0 .8rem; }
.program-meta { display: flex; flex-wrap: wrap; gap: 1.2rem; margin: 1.4rem 0; color: var(--muted); font-size: .9rem; }
.program-actions { margin-top: 1.5rem; }
.program-hero-art {
    aspect-ratio: 1; border-radius: 24px;
    background: color-mix(in srgb, var(--accent) 18%, var(--card));
    border: 1px solid var(--border); display: grid; place-items: center; padding: 2rem;
    box-shadow: var(--shadow);
}
.program-hero-art img {
    width: min(300px, 90%);
    height: auto;
    border-radius: 28px;
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .55);
}

.feature-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.feature-item {
    display: flex; align-items: flex-start; gap: .8rem;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
}
.feature-check {
    flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
    background: rgba(52,211,153,.18); color: var(--green);
    display: grid; place-items: center; font-size: .85rem; font-weight: 700;
}

.gallery { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.shot { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.shot img { width: 100%; }

.notice-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 3rem 2rem; }
.notice-emoji { font-size: 3rem; margin-bottom: 1rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 2.5rem 0; margin-top: 2rem; background: var(--bg-2); }
.footer-inner { text-align: center; display: flex; flex-direction: column; gap: .4rem; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.footer-tag { color: var(--muted); margin: .2rem 0; }
.footer-copy { color: var(--muted-2); font-size: .85rem; margin: 0; }

/* =========================================================
   Auth page — sky + hanging wooden board
   ========================================================= */
body.auth-page {
    background: linear-gradient(180deg, #6ea8e0 0%, #93c4ec 45%, #cfe6f7 100%);
}
.auth-page .site-header { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.auth-page .brand, .auth-page .main-nav a, .auth-page .user-chip { color: #0f2440; }
.auth-page .main-nav a:hover { color: #000; }
.auth-page .btn-ghost { color: #10335c; }

.sky { position: relative; min-height: calc(100vh - 220px); overflow: hidden; display: flex; justify-content: center; }

/* Clouds */
.cloud {
    position: absolute; background: #fff; border-radius: 100px; opacity: .9;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,.08));
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud-1 { width: 120px; height: 40px; top: 12%; left: -140px; animation: drift 38s linear infinite; }
.cloud-1::before { width: 55px; height: 55px; top: -24px; left: 18px; }
.cloud-1::after  { width: 40px; height: 40px; top: -16px; left: 62px; }
.cloud-2 { width: 90px; height: 32px; top: 26%; left: -120px; animation: drift 52s linear infinite; animation-delay: -10s; transform: scale(1.3); }
.cloud-2::before { width: 44px; height: 44px; top: -20px; left: 14px; }
.cloud-2::after  { width: 32px; height: 32px; top: -12px; left: 50px; }
.cloud-3 { width: 70px; height: 26px; top: 44%; left: -100px; animation: drift 64s linear infinite; animation-delay: -28s; }
.cloud-3::before { width: 34px; height: 34px; top: -16px; left: 10px; }
.cloud-3::after  { width: 26px; height: 26px; top: -10px; left: 38px; }
@keyframes drift { to { left: 115%; } }

/* Hanging board */
.hanging { position: relative; margin-top: 1.5rem; padding-top: 46px; }
.beam {
    position: absolute; top: 34px; left: 50%; transform: translateX(-50%);
    width: 340px; height: 10px; border-radius: 6px;
    background: linear-gradient(180deg, #7a5230, #4d2f16);
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
.swing {
    position: relative;
    transform-origin: 50% 0;
    animation: sway 5s ease-in-out infinite;
    padding-top: 60px;
}
@keyframes sway {
    0%, 100% { transform: rotate(-2.6deg); }
    50%      { transform: rotate(2.6deg); }
}
.rope {
    position: absolute; top: 0; width: 6px; height: 78px;
    background: repeating-linear-gradient(180deg, #b98a4e 0 6px, #9c7038 6px 12px);
    border-radius: 3px; z-index: 1;
}
.rope-l { left: 48px; transform: rotate(3deg); }
.rope-r { right: 48px; transform: rotate(-3deg); }

.board {
    position: relative; z-index: 2;
    width: min(380px, 90vw);
    background: linear-gradient(180deg, #8a5a30 0%, #6f4522 100%);
    border: 3px solid #5a3818;
    border-radius: 18px;
    padding: 2rem 1.8rem;
    box-shadow: 0 30px 50px -20px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.12);
    color: #fff8ec;
}
.board-grain {
    position: absolute; inset: 6px; border-radius: 12px; pointer-events: none;
    background:
        repeating-linear-gradient(180deg, rgba(0,0,0,.06) 0 3px, transparent 3px 22px),
        repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 2px, transparent 2px 40px);
    opacity: .5;
}
.board-title { text-align: center; margin: 0 0 .3rem; font-size: 1.6rem; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.4); }
.board-sub { text-align: center; color: #f0e0c8; margin: 0 0 1.4rem; font-size: .92rem; }

.auth-form { display: flex; flex-direction: column; gap: .9rem; position: relative; z-index: 2; }
.auth-form label { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; font-weight: 600; color: #ffedd0; }
.auth-form input {
    padding: .7rem .85rem; border-radius: 10px;
    border: 1px solid rgba(0,0,0,.25);
    background: rgba(255,250,240,.95); color: #2a1a0c; font-size: .95rem; font-family: inherit;
}
.auth-form input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.auth-form .btn { margin-top: .4rem; }

.auth-switch { text-align: center; margin: 1.1rem 0 0; font-size: .9rem; color: #f0e0c8; position: relative; z-index: 2; }
.auth-switch a { color: #ffd88a; font-weight: 700; }

.form-error {
    background: rgba(220,38,38,.9); color: #fff; padding: .6rem .9rem;
    border-radius: 10px; font-size: .88rem; margin-bottom: 1rem; text-align: center;
    position: relative; z-index: 2;
}

/* ---------- RTL tweaks ---------- */
body.rtl .header-actions { margin-inline-start: auto; }
body.rtl .rope-l { left: auto; right: 48px; }
body.rtl .rope-r { right: auto; left: 48px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .program-hero-inner { grid-template-columns: 1fr; }
    .program-hero-art { max-width: 340px; }
    .main-nav { display: none; }
}
@media (max-width: 560px) {
    .header-inner { flex-wrap: wrap; }
    .lang-switch { order: 3; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .swing { animation: none; }
    .cloud { animation: none; }
}
