/* الصفحة الرئيسية العامة (قبل تسجيل الدخول) — Premium Corporate / Dark */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    background: #0E0F0F;
    font-family: 'Cairo', system-ui, sans-serif;
    color: #F1EFEB;
}
a { color: #B89262; text-decoration: none; }
a:hover { color: #cfa878; }

.ph-shell {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #0E0F0F;
    position: relative;
}
.ph-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.ph-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 6, 6, .55);
    pointer-events: none;
    z-index: 0;
}

.ph-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 24px 28px 0;
    flex-shrink: 0;
}
.ph-lang-switch { display: flex; gap: 8px; }
.ph-lang-switch a {
    font-size: 11.5px;
    font-weight: 600;
    padding: 6px 13px;
    border-radius: 6px;
    color: #99958F;
    border: 1px solid rgba(184,146,98,.18);
    background: rgba(255,255,255,.02);
    transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.ph-lang-switch a:hover { color: #F1EFEB; border-color: rgba(184,146,98,.35); }
.ph-lang-switch a.active {
    color: #B89262;
    border-color: rgba(184,146,98,.55);
    background: rgba(184,146,98,.08);
}

/* Hero */
.ph-hero {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    z-index: 1;
}
.ph-hero-glow {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 55%;
    height: 70%;
    background: radial-gradient(circle, rgba(184,146,98,.06) 0%, rgba(184,146,98,0) 70%);
    pointer-events: none;
}
.ph-hero::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(184,146,98,.4), transparent);
}

.ph-hero-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 44px 26px;
}
.ph-hero-inner { max-width: 580px; display: flex; flex-direction: column; align-items: center; }

.ph-logo-zone { margin-bottom: 10px; }
.ph-hero-logo { height: 68px; width: auto; display: block; margin: 0 auto; }

.ph-hero-title {
    margin: 0 0 22px;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.2px;
    color: #F1EFEB;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
    text-wrap: balance;
}

.ph-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 30px;
    border-radius: 10px;
    background: #B89262;
    color: #171614;
    font-size: 13.5px;
    font-weight: 700;
    border: 1px solid #B89262;
    box-shadow: 0 4px 14px rgba(184,146,98,.25);
    transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
    white-space: nowrap;
}
.ph-cta:hover {
    color: #171614;
    background: #cfa878;
    border-color: #cfa878;
    box-shadow: 0 6px 18px rgba(184,146,98,.35);
    transform: translateY(-1px);
}

/* Module grid */
.ph-modules {
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 44px 30px;
    width: 100%;
    flex-shrink: 0;
}
.ph-module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.ph-module-card {
    background: #171818;
    border: 1px solid rgba(184,146,98,.25);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    color: #F1EFEB;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
    opacity: 0;
    animation: ph-card-in .55s ease forwards;
}
.ph-module-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,.24);
    transform: translateY(-3px);
    border-color: rgba(184,146,98,.45);
    color: #F1EFEB;
}
@keyframes ph-card-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ph-module-ic {
    width: 34px; height: 34px; border-radius: 9px;
    background: #1B1B1A;
    border: 1px solid rgba(184,146,98,.3);
    color: #B89262;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.ph-module-title { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; line-height: 1.3; color: #F1EFEB; }
.ph-module-desc { font-size: 11.5px; color: #ACA89F; line-height: 1.3; }

/* Footer */
.ph-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(184,146,98,.14);
    background: #0E0F0F;
    padding: 16px 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.ph-footer-links { display: flex; align-items: center; gap: 18px; font-size: 12.5px; }
.ph-footer-links a { color: #99958F; }
.ph-footer-links a:hover { color: #B89262; }
.ph-footer-copy { font-size: 12px; color: #9C9890; text-align: center; flex: 1; }
.ph-footer-brand { font-size: 12.5px; font-weight: 700; color: #B89262; white-space: nowrap; }

@media (max-width: 900px) {
    .ph-footer { justify-content: center; text-align: center; }
    .ph-footer-copy { order: 3; flex-basis: 100%; }
}
@media (max-width: 680px) {
    .ph-module-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    /* Base layout assumes everything fits one fixed-height desktop
       viewport (overflow: hidden clips anything past it). Six stacked
       cards + hero + footer genuinely don't fit a phone screen at any
       reasonable size, so mobile gets its own natural-height, scrollable
       shell instead — that's what was clipping the logo off the top. */
    .ph-shell {
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .ph-topbar {
        padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 0;
    }
    .ph-lang-switch { gap: 6px; }
    .ph-lang-switch a {
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 6px;
    }

    .ph-hero { flex: none; }
    .ph-hero-body {
        padding: 18px 16px 14px;
        justify-content: center;
    }
    .ph-logo-zone { margin-bottom: 10px; }
    .ph-hero-logo { height: 40px; }

    .ph-hero-title {
        font-size: 19px;
        line-height: 1.3;
        margin-bottom: 14px;
    }

    .ph-cta {
        padding: 9px 22px;
        font-size: 12.5px;
    }

    .ph-modules {
        flex: none;
        padding: 16px 16px 18px;
    }
    .ph-module-grid { grid-template-columns: 1fr; gap: 10px; }
    .ph-module-card {
        padding: 12px 14px;
        border-radius: 12px;
        gap: 10px;
    }
    .ph-module-ic {
        width: 28px; height: 28px;
        border-radius: 8px;
        font-size: 12px;
    }
    .ph-module-title { font-size: 12.5px; }
    .ph-module-desc { font-size: 10.5px; }

    .ph-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
    }
    .ph-footer-links { gap: 12px; font-size: 11px; justify-content: center; flex-wrap: wrap; }
    .ph-footer-copy { order: initial; font-size: 10.5px; }
    .ph-footer-brand { font-size: 11px; }
}
