/* ستايل بوابة المقاصد — الألوان والخطوط والمكوّنات هنا منقولة حرفيًا من ملف
   الهوية البصرية الرسمي (Figma: Almaqased Digital Brand Identity):
   - صفحة 03 — Colors: قيم الألوان أدناه
   - صفحة 04 — Typography: Cairo للعربي / Inter للإنجليزي
   - صفحة 07 — Components: مواصفات Card/Default (خلفية، حدود، انحناء، حشوة، خط) */

:root {
    /* Brand / Primary Palette */
    --navy-dark: #0B1327;
    --navy: #1A2657;
    --blue-primary: #2B4BAA;
    --blue-medium: #4472C4;

    /* Brand / Neutrals & Backgrounds */
    --gray-cool: #8B96B0;
    --gray: #6B7280;
    --white: #FFFFFF;
    --gray-light: #F8F9FB;
    --gray-border: #C3C3C4;

    /* استخدام دلالي (Semantic mapping) */
    --bg: #EEF2FA;
    --surface: var(--white);
    --border: var(--gray-border);
    --text: var(--navy-dark);
    --muted: var(--gray);
    --accent: var(--blue-primary);
    --shadow: 0 18px 45px rgba(11, 19, 39, 0.10);
    --shadow-soft: 0 10px 25px rgba(11, 19, 39, 0.06);
    --radius-card: 20px;
    --radius-button: 15px;
}

* {
    box-sizing: border-box;
    font-family: 'Cairo', 'Inter', Tahoma, Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    direction: rtl;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

.portal-header {
    background: var(--navy-dark);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--blue-primary), var(--blue-medium)) 1;
    padding: 16px 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    width: 84px;
    height: 84px;
    object-fit: contain;
}

.portal-header h2 {
    margin: 0;
    color: var(--white);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
}

.portal-header p {
    margin: 5px 0 0;
    color: var(--gray-cool);
    font-size: 14px;
}

.portal-container {
    width: 100%;
    max-width: 82.5rem;
    margin: 0 auto;
    padding: 34px 42px 60px;
}

.welcome-section {
    padding: 14px 34px;
    margin-bottom: 26px;
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--blue-primary);
    border-radius: 3px;
}

.welcome-section h1 {
    margin: 0 0 10px;
    color: var(--navy-dark);
    font-size: 28px;
    font-weight: 700;
}

.welcome-section p {
    margin: 0;
    color: var(--muted);
    line-height: 1.9;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Card/Default (Figma 07 — Components): خلفية بيضاء، حدود Border Gray بسماكة
   1px، انحناء 8px، حشوة 24px، عنوان Cairo 600/18px بلون Dark Navy، ونص
   Cairo 400/14px بلون Gray. الأيقونة والحجم الإضافي هنا امتداد محلي فقط
   لعرض شعار التطبيق فوق نفس بطاقة الهوية الرسمية. */
.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: 24px;
    color: var(--text);
    transition: 0.22s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 300px;
}

/* شريط علوي بتدرّج Primary Blue → Medium Blue (ألوان الهوية الرسمية) للبطاقات
   الفعّالة فقط - يعطي حضور لوني للعلامة التجارية بدل صفحة أبيض/رمادي بالكامل. */
.active-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--blue-primary), var(--blue-medium));
}

.app-card h3 {
    margin: 0 0 8px;
    color: var(--navy-dark);
    font-size: 18px;
    font-weight: 600;
}

.app-card p {
    font-size: 14px;
    margin: 0 0 16px;
    color: var(--muted);
    line-height: 1.7;
    min-height: 64px;
}

.app-card-icon {
    margin: 0 auto 24px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-card-icon img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    display: block;
}

.active-card {
    cursor: pointer;
}

.active-card:hover {
    transform: translateY(-4px);
    border-color: var(--blue-medium);
    box-shadow: var(--shadow);
}

.placeholder-card {
    background: var(--gray-light);
    border: 1.5px dashed var(--border);
    box-shadow: none;
    cursor: default;
}

.placeholder-card h3,
.placeholder-card p {
    color: var(--muted);
}

.placeholder-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--gray-cool);
    font-size: 34px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
