:root {
    --font-family-ar: 'Tajawal', sans-serif;
    --font-family-en: 'Inter', sans-serif;
    --font-family-base: 'Tajawal', sans-serif;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #0b0d11;
    --color-muted: #6b7280;
    --color-accent: #4f46ef;
    --color-accent-dark: #4338ca;
    --spacing-unit: clamp(12px, 1.5vw, 18px);
    --radius-lg: 32px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --shadow-soft: 0 18px 55px rgba(15, 23, 42, 0.12);
}

@keyframes float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -14px, 0); }
}

@keyframes orbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.55; transform: scale(0.95); }
    50% { opacity: 0.95; transform: scale(1.1); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0.4; transform: translateY(-8px); }
    50% { opacity: 1; transform: translateY(6px); }
}

[dir="ltr"] body {
    font-family: var(--font-family-en);
}

[dir="rtl"] body {
    font-family: var(--font-family-ar);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

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

a:hover {
    text-decoration: underline;
}

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

.site-header {
    background: var(--color-surface);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: calc(var(--spacing-unit) * 1.5) 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
}

.brand-link {
    display: inline-flex;
    align-items: center;
}

.brand-logo-img {
    height: 38px;
    width: auto;
    display: block;
    max-width: 180px;
    object-fit: contain;
}

.main-nav {
    display: flex;
    gap: clamp(16px, 2vw, 28px);
    margin-inline-start: auto;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--color-text);
    background: rgba(15, 23, 42, 0.05);
}

.nav-link:active {
    color: var(--color-accent);
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-inline-start: auto;
    z-index: 1001;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    position: relative;
}

.menu-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.mobile-menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile menu styles */
@media (max-width: 1023px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-surface);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 24px;
        margin: 0;
        padding: 80px 24px 24px;
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: 0 0 40px rgba(15, 23, 42, 0.1);
    }
    
    [dir="rtl"] .main-nav {
        transform: translateX(-100%);
    }
    
    .main-nav.is-open {
        transform: translateX(0);
    }
    
    .nav-link {
        font-size: 1.125rem;
        padding: 16px 24px;
        width: 100%;
        text-align: center;
        border-radius: 12px;
    }
    
    .nav-link:hover {
        background: rgba(15, 23, 42, 0.08);
        transform: translateY(-2px);
    }
    
    .header-actions {
        margin-inline-start: 12px;
    }
    
    .header-actions .btn span {
        display: none;
    }
    
    .header-actions .btn {
        padding: 12px;
        min-width: 44px;
    }
}

@media (max-width: 767px) {
    .header-bar {
        flex-wrap: wrap;
    }
    
    .brand {
        flex: 1;
    }
    
    .header-actions {
        order: 2;
        width: 100%;
        justify-content: space-between;
        margin-top: 12px;
        margin-inline-start: 0;
        flex-wrap: wrap;
    }
    
    .language-switcher {
        order: 1;
    }
    
    .btn-primary {
        order: 2;
    }
    
    .main-nav {
        padding-top: 100px;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-inline-start: clamp(12px, 1vw, 24px);
    flex-wrap: nowrap;
}

.language-switcher {
    display: inline-flex;
    border-radius: 999px;
    background: #f2f4f7;
    padding: 4px;
}

.lang-btn {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-muted);
}

.lang-btn.is-active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn i {
    color: #fff;
}

.btn-primary {
    background: var(--color-text);
    color: #fff;
    box-shadow: 0 12px 30px rgba(15, 15, 16, 0.18);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(15, 15, 16, 0.2);
}

.header-btn {
    color: #fff;
}

.header-btn--builder {
    background: linear-gradient(135deg, #ff8b45, #ff6b35);
    box-shadow: 0 16px 38px rgba(255, 107, 53, 0.35);
}

.header-btn--builder i {
    color: #fff;
}

.header-btn--cta {
    background: #0f172a;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
}

.header-btn--cta i {
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text);
}

.btn-ghost i {
    color: var(--color-text);
}

.btn-accent {
    background: var(--color-accent);
    color: #fff;
    box-shadow: 0 12px 36px rgba(79, 70, 239, 0.35);
}

.hero {
    background: var(--color-surface);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: clamp(48px, 8vw, 120px) 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(32px, 6vw, 64px);
    align-items: center;
}

.hero-tagline {
    font-weight: 700;
    font-size: 1rem;
    margin: 0 0 12px;
    color: var(--color-accent);
}

.hero h1 {
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    line-height: 1.1;
    margin: 0 0 16px;
}

.hero-intro {
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--color-text);
}

.hero-description {
    color: var(--color-muted);
    margin-bottom: 24px;
}

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

.hero-media {
    position: relative;
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    min-height: clamp(320px, 40vw, 460px);
}

.hero-visual {
    position: relative;
    width: min(420px, 70vw);
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 32px;
    background: radial-gradient(140% 140% at 50% 0%, rgba(79, 70, 239, 0.28), rgba(15, 23, 42, 0.05));
    overflow: hidden;
    box-shadow: 0 32px 65px rgba(15, 23, 42, 0.28);
    --tiltX: 0;
    --tiltY: 0;
    transform: perspective(1200px) rotateX(calc(var(--tiltY, 0) * 1deg)) rotateY(calc(var(--tiltX, 0) * 1deg));
    transition: transform 0.6s ease, box-shadow 0.6s ease;
}

.hero-glow {
    position: absolute;
    inset: 14%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.8), rgba(59, 130, 246, 0.25) 60%, rgba(14, 116, 144, 0) 100%);
    filter: blur(0px);
    animation: pulseGlow 12s ease-in-out infinite;
}

[data-float] {
    animation: float 7.5s ease-in-out infinite;
    animation-delay: var(--float-delay, 0s);
}

.hero-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(8px);
    min-width: 220px;
}

.hero-card__icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.2rem;
}

.hero-card--crm {
    top: 12%;
    left: 6%;
}

.hero-card--crm .hero-card__icon {
    background: linear-gradient(140deg, #34d399, #047857);
}

.hero-card--chat {
    top: 64%;
    right: 4%;
}

.hero-card--chat .hero-card__icon {
    background: linear-gradient(140deg, #6366f1, #312e81);
}

.hero-card--wallet {
    bottom: 18%;
    left: 18%;
}

.hero-card--wallet .hero-card__icon {
    background: linear-gradient(140deg, #f97316, #ea580c);
}

.hero-card p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-muted);
}

.hero-card strong {
    font-size: 1.4rem;
    color: var(--color-text);
}

.hero-orbit {
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 1px dashed rgba(148, 163, 184, 0.4);
    animation: orbit 28s linear infinite;
}

.orbit-bubble {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, rgba(99, 102, 241, 0.95), rgba(14, 165, 233, 0.8));
    color: #fff;
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.3);
    transform: rotate(calc(var(--index) * 90deg)) translateY(-160px);
    animation: sparkle 9s ease-in-out infinite;
    animation-delay: calc(var(--index) * 0.9s);
}

.feature-strip {
    margin: clamp(24px, 4vw, 48px) 0;
}

.feature-strip__inner {
    background: linear-gradient(120deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.06));
    border-radius: var(--radius-lg);
    padding: clamp(18px, 3vw, 28px);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    align-items: center;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--color-text);
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.feature-chip i {
    width: 28px;
    height: 28px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.12));
    color: var(--color-accent);
}

.services {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    margin: clamp(32px, 4vw, 48px) 0;
    padding-bottom: clamp(48px, 6vw, 72px);
    position: relative;
}

.services::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0.65;
    background: radial-gradient(circle at 30% 0%, rgba(79, 70, 229, 0.12), transparent 60%);
    pointer-events: none;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(18px, 3vw, 28px);
    position: relative;
}

.service-card {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: clamp(24px, 3vw, 32px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.service-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
}

.service-card h3 {
    margin: 18px 0 12px;
    font-size: 1.25rem;
}

.service-card p {
    color: var(--color-muted);
    margin: 0 0 24px;
}

.icon-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--color-text);
}

.icon-pill i {
    color: #fff;
    font-size: 1.2rem;
}

.tone-mint .icon-pill { background: linear-gradient(140deg, #34d399, #059669); }
.tone-lavender .icon-pill { background: linear-gradient(140deg, #a855f7, #7c3aed); }
.tone-sunshine .icon-pill { background: linear-gradient(140deg, #fcd34d, #f97316); }
.tone-aqua .icon-pill { background: linear-gradient(140deg, #22d3ee, #0ea5e9); }
.tone-peach .icon-pill { background: linear-gradient(140deg, #fbbf24, #fb7185); }
.tone-sky .icon-pill { background: linear-gradient(140deg, #60a5fa, #2563eb); }
.tone-rose .icon-pill { background: linear-gradient(140deg, #f472b6, #ec4899); }

.cta {
    background: transparent;
    padding: clamp(48px, 6vw, 72px) 0 clamp(72px, 8vw, 120px);
}

.cta-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: clamp(32px, 5vw, 48px);
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
}

.cta-card p {
    color: var(--color-muted);
    margin: 12px 0 0;
}

.site-footer {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--color-text);
    padding: clamp(32px, 5vw, 56px) 0;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.footer-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-brand img {
    height: 34px;
    width: auto;
    display: block;
    max-width: 160px;
    object-fit: contain;
}

.footer-links {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    font-weight: 600;
}

.footer-links i {
    color: var(--color-accent);
}

.footer-copy {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-muted);
}
.error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--color-bg);
    color: var(--color-text);
}

.error-wrapper {
    text-align: center;
    background: var(--color-surface);
    padding: 48px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.btn-admin {
    background: #0f172a;
    color: #fff;
}

@media (max-width: 960px) {
    .site-header {
        position: static;
    }

    .header-bar {
        flex-wrap: wrap;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .header-actions {
        margin-inline-start: 0;
    }

    .cta-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        width: min(320px, 78vw);
    }

    .hero-card {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        margin: 12px auto;
    }

    .hero-orbit {
        display: none;
    }

    .feature-strip__inner {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .feature-chip {
        white-space: normal;
        width: 100%;
        justify-content: center;
    }
}
