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

:root {
    /* Primary */
    --color-primary: #0d80f2;
    --color-primary-hover: #1c92ff;

    /* Light theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2f5;
    --text-primary: #111418;
    --text-secondary: #60758a;
    --border-primary: #eef2f6;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(17, 20, 24, 0.06);
    --shadow-md: 0 4px 16px rgba(17, 20, 24, 0.08);

    /* Gradient */
    --gradient-primary: linear-gradient(135deg, #0d80f2 0%, #1c92ff 100%);

    /* Focus ring */
    --ring-primary: rgba(13, 128, 242, 0.3);

    /* Radius */
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-primary: #334155;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-primary: #334155;
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
        --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    }
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-primary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-sun { display: none; }
    :root:not([data-theme="light"]) .icon-moon { display: block; }
}

/* Language selector */
.lang-selector {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 40px;
    padding: 0 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.lang-btn:hover {
    background: var(--bg-tertiary);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 160px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 100;
}

.lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown button {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.lang-dropdown button:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.lang-dropdown button:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.lang-dropdown button:hover {
    background: var(--bg-tertiary);
}

.lang-dropdown button.active {
    color: var(--color-primary);
    font-weight: 600;
}

/* Hero */
.hero {
    margin-bottom: 4rem;
}

.hero-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 800px) {
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .hero-content {
        text-align: center;
    }

    .phone-mockup {
        order: -1;
        justify-self: center;
    }
}

.hero-content h1 {
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 480px;
}

.cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: #fff;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-xl);
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(13, 128, 242, 0.25);
    transition: box-shadow 0.2s, transform 0.2s;
}

.cta svg {
    flex-shrink: 0;
}

.cta:hover {
    box-shadow: 0 12px 32px rgba(13, 128, 242, 0.35);
    transform: translateY(-1px);
}

.cta:active {
    transform: translateY(0);
}

/* Phone mockup */
.phone-mockup {
    display: flex;
    justify-content: center;
}

.phone-frame {
    position: relative;
    width: 320px;
    background: #0f172a;
    border-radius: 36px;
    padding: 10px;
    box-shadow:
        0 0 0 2px #334155,
        0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .phone-frame {
    box-shadow:
        0 0 0 2px #cbd5e1,
        0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .phone-frame {
        box-shadow:
            0 0 0 2px #cbd5e1,
            0 25px 50px -12px rgba(0, 0, 0, 0.25);
    }
}

.phone-notch {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 24px;
    background: #0f172a;
    border-radius: 0 0 14px 14px;
    z-index: 10;
}

.phone-carousel {
    position: relative;
    width: 100%;
    height: 430px;
    border-radius: 26px;
    overflow: hidden;
    background: #1e293b;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding-bottom: 4px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.carousel-dot:hover {
    background: #64748b;
}

.carousel-dot.active {
    background: var(--color-primary);
    transform: scale(1.2);
}

/* Steps and Features section */
.steps-and-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
    align-items: start;
}

@media (max-width: 700px) {
    .steps-and-features {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* How it works */
.how-it-works {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.step-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-primary);
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.step-content strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.step-content p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Features */
.features {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
}

.feature-item svg {
    flex-shrink: 0;
    color: var(--color-primary);
}

.feature-item:first-child {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.feature-item:last-child {
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.feature-item:not(:last-child) {
    border-bottom: none;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.feature-text strong {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.feature-text span {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Footer */
footer {
    margin-top: auto;
    padding-top: 3rem;
}

footer p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .feature {
        padding: 1rem;
    }
}

/* RTL support for Arabic */
[dir="rtl"] .step {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-dropdown button {
    text-align: right;
}

[dir="rtl"] .hero-layout {
    direction: rtl;
}
