:root {
    --bg-main: #0f172a;
    --bg-alt: #1e293b;
    --bg-card: #334155;
    --accent: #14b8a6;
    --accent-hover: #0d9488;
    --red: #ef4444;
    --red-soft: rgba(239, 68, 68, 0.12);
    --red-border: rgba(239, 68, 68, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --font-main: 'Inter', 'Cairo', sans-serif;
    --font-arabic: 'Cairo', 'Inter', sans-serif;
    --nav-height: 70px;
    --radius: 10px;
}

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

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); line-height: 1.08; margin-bottom: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); margin-bottom: 1.5rem; font-weight: 700; }
h3 { font-size: 1.05rem; margin-bottom: 0.6rem; color: var(--text-primary); font-weight: 600; }
p { color: var(--text-secondary); margin-bottom: 1rem; }
a { text-decoration: none; color: inherit; transition: color 0.3s ease; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.mt-2 { margin-top: 2rem; }
.max-width-p { max-width: 640px; margin: 0 auto 1.5rem; font-size: 1.05rem; line-height: 1.8; }

/* Long body paragraphs read better left-aligned (start = right in RTL) */
#about-text, #cta-text { text-align: start; }

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}
.section { padding: 6rem 0; }
.bg-alt { background-color: var(--bg-alt); }

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    border-bottom: 1px solid rgba(51, 65, 85, 0.35);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
nav.scrolled {
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
    border-bottom-color: rgba(51, 65, 85, 0.6);
}

.nav-container {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
}
.nav-container > .nav-links { margin-inline-start: auto; margin-inline-end: 1.25rem; }

.logo { color: var(--text-primary); display: inline-flex; align-items: center; gap: 0.7rem; line-height: 1; }
.logo-mark { color: var(--accent); flex-shrink: 0; }
.logo-text { display: inline-flex; flex-direction: column; justify-content: center; gap: 0.2rem; }
.logo-brand { font-size: 1.3rem; font-weight: 800; letter-spacing: 3px; line-height: 1; }
.logo-brand-suffix { color: var(--text-secondary); font-weight: 500; }
.logo-tagline { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-secondary); line-height: 1; }

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}
.nav-links a { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.01em; }
.nav-links a:hover { color: var(--text-primary); }
.btn-nav {
    border: 1px solid var(--accent) !important;
    padding: 0.45rem 1.1rem;
    border-radius: 6px;
    color: var(--accent) !important;
    font-weight: 600 !important;
}
.btn-nav:hover { background-color: var(--accent); color: white !important; }

/* Right cluster of navbar: lang toggle (always) + hamburger (mobile only) */
.nav-actions { display: flex; align-items: center; gap: 0.9rem; }

/* Language toggle */
.lang-toggle {
    background: transparent;
    border: 1px solid rgba(51, 65, 85, 0.8);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    line-height: 1.2;
}
.lang-toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}
html[dir="rtl"] .lang-toggle { letter-spacing: 0; }

/* Skip link (visible on keyboard focus) */
.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(-120%);
    background: var(--accent);
    color: white;
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 0 0 6px 0;
    z-index: 2000;
    transition: transform 0.2s ease;
}
.skip-link:focus {
    transform: translateY(0);
    outline: 2px solid white;
    outline-offset: 2px;
}
html[dir="rtl"] .skip-link { left: auto; right: 0; border-radius: 0 0 0 6px; }

/* Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 4px;
    font: inherit;
    color: inherit;
}
.hamburger span { width: 22px; height: 2px; background-color: var(--text-primary); transition: 0.3s; display: block; }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    font-family: var(--font-main);
}
.btn-primary { background-color: var(--accent); color: white; }
.btn-primary:hover { background-color: var(--accent-hover); transform: translateY(-2px); }
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(51, 65, 85, 0.8);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-secondary); transform: translateY(-2px); }
.btn-block { width: 100%; justify-content: center; }

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    padding-top: var(--nav-height);
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(13, 148, 136, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13, 148, 136, 0.035) 1px, transparent 1px);
    background-size: 60px 60px;
}

.hero-bg::before {
    content: '';
    position: absolute;
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.1) 0%, transparent 65%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orb-pulse 7s ease-in-out infinite alternate;
}

.hero-bg::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.04) 0%, transparent 65%);
    bottom: -100px;
    right: -100px;
    animation: orb-pulse 10s ease-in-out infinite alternate-reverse;
}

@keyframes orb-pulse {
    0%   { opacity: 0.6; transform: translate(-50%, -50%) scale(0.88); }
    100% { opacity: 1;   transform: translate(-50%, -50%) scale(1.12); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-supertitle {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
    padding: 0.45rem 1.1rem;
    border: 1px solid rgba(20, 184, 166, 0.4);
    border-radius: 100px;
    background: rgba(20, 184, 166, 0.07);
}

.hero-headline-accent {
    color: var(--accent);
    display: block;
}

.hero-features {
    max-width: 560px;
    margin: 2rem auto 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.hero-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    text-align: start;
}

.hero-feature-icon {
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 0.2rem;
    opacity: 0.85;
}

.hero-feature-icon svg { width: 18px; height: 18px; display: block; }

.hero-value-line,
.hero .subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Card icon */
.card-icon {
    width: 44px;
    height: 44px;
    background: rgba(13, 148, 136, 0.1);
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    color: var(--accent);
}
.card-icon svg { width: 19px; height: 19px; }

/* Cards Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}
.card {
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--bg-card);
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.card p { margin-bottom: 0; font-size: 0.925rem; line-height: 1.7; }
.bg-alt .card { background-color: var(--bg-main); }
.section:not(.bg-alt) .card { background-color: var(--bg-alt); }
.card:hover { transform: translateY(-4px); border-color: rgba(13, 148, 136, 0.35); }

/* Stagger animations */
.section.visible .grid .card:nth-child(1),
.section.visible .steps-grid .step-card:nth-child(1),
.section.visible .stats-grid .stat-card:nth-child(1) { animation: card-rise 0.5s ease 0.05s both; }
.section.visible .grid .card:nth-child(2),
.section.visible .steps-grid .step-card:nth-child(2),
.section.visible .stats-grid .stat-card:nth-child(2) { animation: card-rise 0.5s ease 0.15s both; }
.section.visible .grid .card:nth-child(3),
.section.visible .steps-grid .step-card:nth-child(3),
.section.visible .stats-grid .stat-card:nth-child(3) { animation: card-rise 0.5s ease 0.25s both; }
.section.visible .grid .card:nth-child(4),
.section.visible .steps-grid .step-card:nth-child(4) { animation: card-rise 0.5s ease 0.35s both; }

@keyframes card-rise {
    from { transform: translateY(18px); }
    to   { transform: translateY(0); }
}

/* Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
    position: relative;
}
.step-card {
    background: var(--bg-alt);
    padding: 1.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--bg-card);
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.step-card:hover { transform: translateY(-4px); border-color: rgba(13, 148, 136, 0.35); }

.step-number {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--accent);
    opacity: 0.15;
    line-height: 1;
    margin-bottom: 0.75rem;
    letter-spacing: -2px;
}
.step-icon {
    width: 42px;
    height: 42px;
    background: rgba(13, 148, 136, 0.1);
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.9rem;
    color: var(--accent);
}
.step-icon svg { width: 18px; height: 18px; }
.step-card p { font-size: 0.875rem; line-height: 1.7; margin-bottom: 0; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.stat-card {
    background: var(--bg-alt);
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--bg-card);
    text-align: center;
    border-top: 3px solid var(--accent);
    transition: transform 0.3s ease;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1;
    letter-spacing: -1px;
}
.stat-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

#testimonials-heading { margin-bottom: 0.5rem; }
#testimonials-disclaimer {
    font-style: italic;
    font-size: 0.85rem;
    margin-top: 0;
    margin-bottom: 0;
}

/* Carousel */
.carousel {
    max-width: 760px;
    margin: 3rem auto 0;
}
.carousel-wrapper {
    overflow: hidden;
    border-radius: var(--radius);
}
.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.testimonial-card {
    min-width: 100%;
    background: var(--bg-main);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--bg-card);
    position: relative;
}
.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: 1.25rem;
    left: 2rem;
    font-size: 4.5rem;
    line-height: 1;
    color: var(--accent);
    opacity: 0.2;
    font-family: Georgia, serif;
}
.testimonial-quote {
    font-size: 0.975rem;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    padding-top: 1.75rem;
}
.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.12);
    border: 2px solid rgba(13, 148, 136, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}
.author-avatar svg { width: 20px; height: 20px; }
.author-name { font-weight: 600; color: var(--text-primary); font-size: 0.9rem; }
.author-role { color: var(--text-secondary); font-size: 0.8rem; }

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}
.carousel-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-alt);
    border: 1px solid var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.carousel-btn:hover { background: var(--accent); border-color: var(--accent); color: white; }
.carousel-btn svg { width: 17px; height: 17px; }

.carousel-dots { display: flex; gap: 0.5rem; align-items: center; }
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-card);
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease, width 0.25s ease;
}
.dot.active { background: var(--accent); width: 20px; border-radius: 4px; }

/* Section CTA */
.section-cta {
    background: linear-gradient(160deg, rgba(13, 148, 136, 0.08) 0%, transparent 60%);
    border-top: 1px solid rgba(13, 148, 136, 0.12);
    border-bottom: 1px solid rgba(13, 148, 136, 0.12);
}
.section-cta .max-width-p { margin-bottom: 2rem; }

/* FAQ */
.faq-list {
    max-width: 760px;
    margin: 3rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.faq-item {
    background: var(--bg-main);
    border: 1px solid var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.25s ease;
}
.faq-item.open { border-color: rgba(13, 148, 136, 0.35); }

.faq-question {
    width: 100%;
    padding: 1.1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    text-align: start;
    gap: 1rem;
    transition: color 0.2s ease;
}
.faq-question:hover { color: var(--accent); }

.faq-icon {
    color: var(--accent);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
.faq-icon svg { width: 17px; height: 17px; display: block; }
.faq-item.open .faq-icon { transform: rotate(180deg); }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.faq-answer p {
    padding: 0 1.5rem 1.25rem;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.8;
}
.faq-item.open .faq-answer { max-height: 250px; }

/* Form */
.contact-form {
    max-width: 640px;
    margin: 0 auto;
    background-color: var(--bg-alt);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--bg-card);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-group { margin-bottom: 1.1rem; text-align: start; }
.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background-color: var(--bg-main);
    border: 1px solid var(--bg-card);
    color: var(--text-primary);
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.form-group textarea { resize: vertical; }
.required { color: var(--red); }
.field-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    opacity: 0.7;
}
.form-error {
    color: var(--red);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}
.form-warning {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.55;
    margin-bottom: 1rem;
    text-align: start;
}
.form-success {
    text-align: center;
    padding: 1.5rem;
    margin-top: 1.25rem;
    background: rgba(13, 148, 136, 0.08);
    border: 1px solid rgba(13, 148, 136, 0.25);
    border-radius: var(--radius);
    color: var(--text-primary);
}
.form-success svg { color: var(--accent); width: 28px; height: 28px; margin-bottom: 0.5rem; }
.form-success strong { display: block; font-size: 1rem; margin-bottom: 0.4rem; }
.form-success p { font-size: 0.875rem; margin: 0; color: var(--text-secondary); line-height: 1.6; }
.fallback-text { font-size: 0.85rem; color: var(--text-secondary); }

/* Footer */
footer {
    padding: 1.75rem 0;
    background-color: var(--bg-main);
    border-top: 1px solid var(--bg-card);
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
footer p { margin: 0; font-size: 0.8rem; color: var(--text-secondary); }
footer .logo { font-size: 1.1rem; }

/* Fade-in */
.fade-in {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .fade-in { opacity: 1; transform: none; }
}

/* Mobile */
@media (max-width: 1024px) {
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }

    .nav-container > .nav-actions { margin-inline-start: auto; }
    .nav-container > .nav-links { margin-inline-end: 0; }

    .nav-links {
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background-color: rgba(30, 41, 59, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        border-bottom: 1px solid transparent;
    }
    .nav-links.active { max-height: 380px; border-bottom-color: var(--bg-card); }
    .nav-links li { width: 100%; text-align: center; }
    .nav-links a { display: block; padding: 0.9rem; color: var(--text-secondary); }
    .btn-nav { border: none !important; }

    .section { padding: 4rem 0; }
    .card, .step-card { padding: 1.5rem; }

    .hero-actions { flex-direction: column; align-items: center; }

    .grid, .steps-grid, .stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }

    .testimonial-card { padding: 2rem 1.5rem; }
    .testimonial-card::before { font-size: 3.5rem; top: 1rem; inset-inline-start: 1.25rem; }

    .footer-inner { justify-content: center; text-align: center; }
}

/* RTL (Arabic) overrides */
html[dir="rtl"] .testimonial-card::before {
    left: auto;
    right: 2rem;
}
html[dir="rtl"] .testimonial-card {
    direction: rtl;
    text-align: right;
}
html[dir="rtl"] .hero-supertitle { letter-spacing: 0.05em; }
html[dir="rtl"] .form-group label {
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.85rem;
}
html[dir="rtl"] .form-group { text-align: right; }
html[dir="rtl"] .field-hint { opacity: 0.85; }
html[dir="rtl"] .logo-tagline { letter-spacing: 0; text-transform: none; font-size: 0.7rem; }
/* Keep brand wordmark LTR */
.logo-brand { direction: ltr; unicode-bidi: isolate; }
/* Keep numeric stats LTR for clean rendering */
html[dir="rtl"] .stat-value { direction: ltr; unicode-bidi: isolate; display: inline-block; }
/* Carousel direction in RTL: keep track LTR so translateX still advances forward */
html[dir="rtl"] .carousel-track { direction: ltr; }

@media (max-width: 768px) {
    html[dir="rtl"] .testimonial-card::before { right: 1.25rem; }
}
