:root {
    --primary: #392c74;
    --primary-dark: #2b2159;
    --primary-light: #f4f1ff;
    --white: #ffffff;
    --gold: #f3c969;
    --text: #222222;
    --muted: #6f6f7b;
    --border: #e8e2ff;
    --bg: #fcfbff;
    --shadow: 0 12px 35px rgba(57, 44, 116, 0.10);
    --shadow-hover: 0 18px 45px rgba(57, 44, 116, 0.18);
    --radius-lg: 24px;
    --radius-md: 18px;
    --transition: all 0.35s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(to bottom, #ffffff 0%, #faf8ff 100%);
    color: var(--text);
    line-height: 1.9;
    overflow-x: hidden;
}

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

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

.container {
    width: min(92%, 1180px);
    margin: 0 auto;
}

/* =========================
   Navbar
========================= */
.navbar {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(57, 44, 116, 0.08);
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 82px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-size: 24px;
    font-weight: 900;
}

.logo-badge {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #4f3b9a);
    color: #fff;
    box-shadow: 0 8px 20px rgba(57, 44, 116, 0.22);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
}

.nav-links > a,
.dropdown-toggle {
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    position: relative;
    transition: var(--transition);
    cursor: pointer;
}

.nav-links > a::after,
.dropdown-toggle::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links > a:hover::after,
.dropdown-toggle:hover::after {
    width: 100%;
}

.nav-links > a:hover,
.dropdown-toggle:hover {
    color: var(--primary-dark);
}

/* =========================
   Mega Dropdown
========================= */
.mega-dropdown {
    position: relative;
}

.mega-menu {
    position: absolute;
    top: calc(100% + 18px);
    inset-inline-end: 0;
    width: 760px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(57, 44, 116, 0.08);
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: var(--transition);
    z-index: 1200;
}

.mega-dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-column h4 {
    color: var(--primary);
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 14px;
}

.mega-column a {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 0;
    transition: 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mega-column a:last-child {
    border-bottom: none;
}

.mega-column a:hover {
    color: var(--primary);
    padding-right: 6px;
}

/* =========================
   Auth Buttons
========================= */
.auth-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-login,
.btn-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 700;
    transition: var(--transition);
    font-size: 14px;
}

.btn-login {
    color: var(--primary);
    border: 1px solid rgba(57, 44, 116, 0.18);
    background: transparent;
}

.btn-login:hover {
    background: rgba(57, 44, 116, 0.06);
}

.btn-register {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 25px rgba(57, 44, 116, 0.16);
}

.btn-register:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* =========================
   Hero
========================= */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.animated-hero {
    background: linear-gradient(135deg, #2b2159, #392c74);
    color: #fff;
}

.hero-stage {
    position: relative;
    min-height: 100vh;
    padding-top: 110px;
    padding-bottom: 40px;
}

/* الصورة بالبداية في الوسط */
.hero-visual {
    position: absolute;
    left: 50%;
    top: 54%;
    width: min(420px, 68vw);
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    z-index: 2;
    transition:
        left 1.2s ease,
        top 1.2s ease,
        transform 1.2s ease,
        width 1.2s ease,
        opacity 0.8s ease;
    animation: heroImageIntro 0.9s ease;
}

.hero-visual img {
    width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 20px 35px rgba(0, 0, 0, 0.18));
}

/* الكلام يكون يمين */
.hero-copy {
    position: absolute;
    right: 6%;
    top: 56%;
    width: 100%;
    max-width: 500px;
    margin: 0 !important;
    text-align: right;
    opacity: 0;
    transform: translateY(-50%) translateX(120px);
    z-index: 3;
    pointer-events: none;
    transition:
        opacity 0.9s ease 0.25s,
        transform 0.9s ease 0.25s;
}

.hero-kicker {
    display: inline-block;
    margin-bottom: 18px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 13px;
    font-weight: 700;
    opacity: 0.95;
}

.hero-copy h1 {
    margin: 0 0 18px;
    font-size: clamp(42px, 5.5vw, 66px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.hero-copy h1 span {
    display: block;
}

.hero-copy p {
    margin: 0 0 28px;
    font-size: 18px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.86);
    max-width: 460px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* الوضع النهائي مثل الصورة */
.animated-hero.hero-started .hero-visual {
    left: 22%;
    top: 56%;
    width: min(350px, 34vw);
    transform: translate(-50%, -50%) scale(1);
}

.animated-hero.hero-started .hero-copy {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

.animated-hero::before,
.animated-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    z-index: 0;
}

.animated-hero::before {
    width: 320px;
    height: 320px;
    top: -100px;
    right: -80px;
}

.animated-hero::after {
    width: 260px;
    height: 260px;
    bottom: -90px;
    left: -90px;
}

@keyframes heroImageIntro {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.86);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* =========================
   Sections
========================= */
section {
    padding: 90px 0;
    opacity: 0;
    transform: translateY(35px);
    transition: 0.9s ease;
}

header.hero {
    opacity: 1;
    transform: none;
}

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

/* =========================
   Buttons
========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 26px;
    border-radius: 999px;
    font-weight: 800;
    transition: var(--transition);
    font-size: 15px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gold);
    color: #fff;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.btn-primary:hover {
    transform: translateY(-3px);
    filter: brightness(1.03);
}

.btn-secondary {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    background: #f5f3ff;
}

/* =========================
   Footer
========================= */
footer {
    margin-top: 90px;
    background: #151124;
    color: #fff;
    padding: 55px 0 25px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 28px;
}

.footer-brand h3 {
    font-size: 28px;
    margin-bottom: 12px;
    font-weight: 900;
}

.footer-brand p,
.footer-col a,
.footer-col p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 15px;
}

.footer-col h4 {
    margin-bottom: 14px;
    font-size: 18px;
    font-weight: 800;
}

.footer-col ul {
    list-style: none;
    display: grid;
    gap: 10px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 18px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* =========================
   Floating Call
========================= */
.floating-call {
    position: fixed;
    bottom: 20px;
    inset-inline-end: 20px;
    z-index: 1200;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #4f3b9a);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 26px;
    box-shadow: 0 15px 30px rgba(57, 44, 116, 0.28);
    transition: var(--transition);
}

.floating-call:hover {
    transform: translateY(-4px) scale(1.04);
}

/* =========================
   Responsive
========================= */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .nav-links {
        gap: 16px;
    }

    .mega-menu {
        width: 680px;
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-stage {
        min-height: auto;
        padding-top: 140px;
        padding-bottom: 60px;
        display: grid;
        gap: 30px;
    }

    .hero-visual,
    .animated-hero.hero-started .hero-visual {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: min(340px, 78vw);
        margin: 0 auto;
        animation: none;
    }

    .hero-copy,
    .animated-hero.hero-started .hero-copy {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        max-width: 100%;
        margin: 0 auto !important;
        text-align: center;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .hero-copy p {
        max-width: 100%;
        margin-inline: auto;
    }

    .hero-actions {
        justify-content: center;
    }
}

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

    .nav-container {
        min-height: 74px;
    }

    .logo {
        font-size: 20px;
    }

    .btn {
        width: 100%;
    }

    .nav-right {
        gap: 14px;
    }

    .nav-links {
        display: none;
    }

    .auth-links {
        gap: 8px;
    }

    .btn-login,
    .btn-register {
        padding: 9px 14px;
        font-size: 13px;
    }

    .hero-copy h1 {
        font-size: clamp(34px, 10vw, 52px);
    }

    .hero-copy p {
        font-size: 16px;
    }

    .hero-actions {
        flex-direction: column;
    }
}