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

:root {
    --primary: #7E57C2;
    --primary-light: #9575CD;
    --primary-dark: #512DA8;
    --primary-deeper: #4527A0;
    --gold: #F9A825;
    --gold-light: #FFD54F;
    --bg: #F6F5FA;
    --surface: #FFFFFF;
    --text: #1a1a2e;
    --text-light: #6B6B80;
    --income: #2E7D32;
    --expense: #C62828;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ==================== NAV ==================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    transition: background 0.3s, backdrop-filter 0.3s;
}

.nav.scrolled {
    background: rgba(81, 45, 168, 0.92);
    backdrop-filter: blur(20px);
}

.nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    height: 36px;
    border-radius: 9px;
}

.nav-name {
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.lang-switch {
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.25);
    cursor: pointer;
}

/* ==================== HERO ==================== */
.hero {
    background: linear-gradient(160deg, var(--primary-deeper) 0%, var(--primary) 50%, var(--primary-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249,168,37,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -15%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(171,71,188,0.12) 0%, transparent 60%);
    pointer-events: none;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 32px;
    align-items: center;
    position: relative;
    z-index: 1;
    padding-bottom: 60px;
}

.hero-content { color: white; }

.hero-app-name {
    font-size: 3.4rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    opacity: 0.9;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.hero h1 .gold { color: var(--gold); }

.hero-sub {
    font-size: 0.88rem;
    opacity: 0.65;
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 380px;
    padding-right: 80px;
}

[dir="rtl"] .hero-sub {
    padding-right: 0;
    padding-left: 80px;
}

.hero-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 14px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gold);
    color: var(--text);
}

.btn-primary:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249,168,37,0.3);
}

.btn-outline {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1.5px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.btn svg { width: 20px; height: 20px; fill: currentColor; }

/* ==================== PHONE MOCKUP ==================== */
.hero-phone-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    perspective: 1200px;
    min-height: 500px;
    overflow: visible;
    margin-right: -60px;
}

[dir="rtl"] .hero-phone-wrapper {
    margin-right: 0;
    margin-left: -60px;
}

.phone-frame {
    position: relative;
    width: 250px;
    transition: transform 0.4s ease;
    background: #1a1a1e;
    border-radius: 40px;
    padding: 12px;
    box-shadow:
        0 32px 80px rgba(0,0,0,0.35),
        0 8px 20px rgba(0,0,0,0.15),
        inset 0 0 0 1.5px rgba(255,255,255,0.1);
}

.phone-frame::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 22px;
    background: #1a1a1e;
    border-radius: 0 0 14px 14px;
    z-index: 2;
}

.phone-frame img {
    width: 100%;
    border-radius: 28px;
    display: block;
}

.phone-frame:hover {
    transform: translateY(-8px) rotateY(0deg) !important;
}

.phone-frame.secondary {
    width: 200px;
    position: absolute;
}

.phone-frame.left {
    left: -70px;
    bottom: -30px;
    transform: rotateY(30deg) rotateX(4deg) rotate(-3deg);
    box-shadow:
        25px 35px 70px rgba(0,0,0,0.45),
        8px 12px 24px rgba(0,0,0,0.2),
        inset 0 0 0 1.5px rgba(255,255,255,0.1);
}

.phone-frame.right {
    right: -70px;
    bottom: -30px;
    transform: rotateY(-30deg) rotateX(4deg) rotate(3deg);
    box-shadow:
        -25px 35px 70px rgba(0,0,0,0.45),
        -8px 12px 24px rgba(0,0,0,0.2),
        inset 0 0 0 1.5px rgba(255,255,255,0.1);
}

/* ==================== SECTION BLOCKS ==================== */
.block {
    padding: 100px 0;
}

.block-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.block-grid.reverse .block-visual { order: -1; }

.block-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--primary);
    margin-bottom: 12px;
}

.block-title {
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 16px;
}

.block-desc {
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 28px;
}

.check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-light);
}

.check-list li::before {
    content: '\2713';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(126,87,194,0.1);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.block-visual {
    display: flex;
    justify-content: center;
    position: relative;
    perspective: 1000px;
}

.block-phone-wrap {
    background: #1a1a1e;
    border-radius: 40px;
    padding: 12px;
    display: inline-block;
    position: relative;
    box-shadow:
        0 24px 64px rgba(0,0,0,0.12),
        0 8px 20px rgba(0,0,0,0.06),
        inset 0 0 0 1.5px rgba(255,255,255,0.1);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.block-phone-wrap::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 22px;
    background: #1a1a1e;
    border-radius: 0 0 14px 14px;
    z-index: 2;
}

.block-phone {
    width: 260px;
    border-radius: 28px;
    display: block;
}

.block:nth-child(odd) .block-phone-wrap {
    transform: rotateY(-14deg) rotateX(4deg);
}

.block:nth-child(even) .block-phone-wrap,
.block-purple .block-phone-wrap {
    transform: rotateY(14deg) rotateX(4deg);
}

.block-phone-wrap:hover {
    transform: rotateY(0deg) rotateX(0deg) translateY(-8px) !important;
    box-shadow:
        0 32px 80px rgba(0,0,0,0.18),
        0 12px 28px rgba(0,0,0,0.1),
        inset 0 0 0 1.5px rgba(255,255,255,0.1);
}

/* Purple background block */
.block-purple {
    background: linear-gradient(160deg, var(--primary-deeper), var(--primary));
    color: white;
    border-radius: 40px;
    margin: 0 32px;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.block-purple::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249,168,37,0.08) 0%, transparent 60%);
}

.block-purple .block-label { color: var(--gold); }
.block-purple .block-desc { color: rgba(255,255,255,0.75); }

.block-purple .check-list li { color: rgba(255,255,255,0.8); }
.block-purple .check-list li::before {
    background: rgba(249,168,37,0.2);
    color: var(--gold);
}

.block-purple .block-phone-wrap {
    box-shadow:
        0 32px 80px rgba(0,0,0,0.4),
        0 12px 24px rgba(0,0,0,0.2),
        inset 0 0 0 1.5px rgba(255,255,255,0.15);
}

/* ==================== FEATURES GRID ==================== */
.features-section { padding: 100px 0; }

.features-title {
    font-size: 2.4rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 12px;
}

.features-sub {
    text-align: center;
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 56px;
}

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

.feat {
    background: var(--surface);
    border-radius: 20px;
    padding: 28px 20px;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform 0.25s, box-shadow 0.25s;
}

.feat:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(126,87,194,0.1);
}

.feat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 26px;
}

.feat h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.feat p { color: var(--text-light); font-size: 0.82rem; line-height: 1.6; }

/* ==================== MENA ==================== */
.mena {
    text-align: center;
    padding: 80px 0;
}

.mena-chips {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.chip {
    background: var(--surface);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(0,0,0,0.05);
}

/* ==================== CTA ==================== */
.cta {
    background: var(--text);
    color: white;
    text-align: center;
    padding: 80px 32px;
    border-radius: 32px;
    margin: 0 32px 60px;
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 30%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(126,87,194,0.15), transparent 60%);
}

.cta h2 { font-size: 2.2rem; font-weight: 900; margin-bottom: 12px; position: relative; }
.cta p { opacity: 0.6; margin-bottom: 32px; font-size: 1.05rem; position: relative; }
.cta .hero-buttons { justify-content: center; position: relative; }

/* ==================== FOOTER ==================== */
.footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.footer-links a:hover { text-decoration: underline; }

.footer-social {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 16px;
}

.footer-social a {
    color: var(--text-light);
    transition: color 0.2s;
}

.footer-social a:hover {
    color: var(--primary);
}

/* ==================== RTL ==================== */
[dir="rtl"] .hero h1 { letter-spacing: 0; }
[dir="rtl"] .block-grid.reverse .block-visual { order: unset; }
[dir="rtl"] .block-grid .block-visual { order: -1; }
[dir="rtl"] .hero-label,
[dir="rtl"] .block-label { letter-spacing: 1px; }
[dir="rtl"] .phone-frame.left { left: auto; right: -70px; transform: rotate(8deg); }
[dir="rtl"] .phone-frame.right { right: auto; left: -70px; transform: rotate(-8deg); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .hero .container,
    .block-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero { min-height: auto; padding: 120px 0 0; }
    .hero h1 { font-size: 2rem; }
    .hero-app-name { font-size: 2.6rem; }
    .hero-sub { padding-right: 0; }
    .hero-sub { margin: 0 auto 32px; }
    .hero-buttons { justify-content: center; }

    .hero-phone-wrapper { margin-top: 20px; }
    .phone-frame { width: 240px; }
    .phone-frame.secondary { display: none; }

    .block-grid.reverse .block-visual { order: unset; }
    .block-visual { order: -1 !important; }
    .block-title { font-size: 2rem; }
    .block-phone { width: 220px; }
    .block-phone-wrap { border-radius: 34px; padding: 10px; }
    .block-phone-wrap::before { width: 64px; height: 18px; top: 12px; }
    .block-purple { margin: 0 16px; border-radius: 28px; padding: 64px 0; }

    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .features-title { font-size: 1.8rem; }

    .nav-links a:not(.lang-switch) { display: none; }
    .cta { margin: 0 16px 40px; }
}

@media (max-width: 520px) {
    .hero h1 { font-size: 1.7rem; }
    .hero-app-name { font-size: 2.2rem; }
    .hero-sub { font-size: 1rem; }
    .phone-frame { width: 200px; }
    .block-title { font-size: 1.7rem; }
    .block-phone { width: 190px; }
    .block-phone-wrap { border-radius: 30px; padding: 8px; }
    .block-phone-wrap::before { width: 56px; height: 16px; top: 10px; }
    .features-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .feat { padding: 20px 14px; }
    .feat h3 { font-size: 0.85rem; }
    .container { padding: 0 20px; }
    .cta h2 { font-size: 1.7rem; }
    .btn { padding: 12px 22px; font-size: 0.88rem; }
}
