/* Landing page. Hand-written (no build step); logical properties so RTL (Arabic) works. */

:root {
    --bg: #fbfcfb;
    --bg-alt: #f1f5f3;
    --surface: #ffffff;
    --text: #0f1a16;
    --text-2: #42504a;
    --muted: #66746e;
    --border: #dfe6e2;
    --primary: #047857;
    --primary-hover: #065f46;
    --primary-soft: #d9f2e7;
    --primary-ink: #ffffff;
    --accent: #10b981;
    --code-bg: #0d1714;
    --code-text: #d5e7df;
    --code-muted: #7f9a8f;
    --bubble-in: #ffffff;
    --bubble-out: #d9fdd3;
    --chat-bg: #efeae2;
    --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 8px 24px rgba(16, 24, 20, .06);
    --radius: 14px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b100e;
        --bg-alt: #101814;
        --surface: #141d19;
        --text: #e8efeb;
        --text-2: #b6c4bd;
        --muted: #8a9a93;
        --border: #24312b;
        --primary: #10b981;
        --primary-hover: #34d399;
        --primary-soft: #0f2a20;
        --primary-ink: #04140d;
        --accent: #34d399;
        --code-bg: #070b09;
        --bubble-in: #1f2c33;
        --bubble-out: #005c4b;
        --chat-bg: #0b141a;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; }
p { margin: 0; }
a { color: inherit; }
img, svg { display: block; }

.container { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 820px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--primary); color: var(--primary-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.icon { width: 24px; height: 24px; }
.icon-sm { width: 18px; height: 18px; flex: none; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: .9375rem; line-height: 1.3;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { color: var(--text); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-light { background: #ffffff; color: #065f46; }
.btn-light:hover { background: #ecfdf5; }
.btn-ghost-light { color: #ffffff; border-color: rgba(255, 255, 255, .45); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .1); }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 24px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.125rem; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: var(--primary-ink); }
.brand-mark svg { width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 22px; margin-inline-start: auto; font-size: .9375rem; }
.nav-links > a { text-decoration: none; color: var(--text-2); }
.nav-links > a:hover { color: var(--text); }
.nav-links .lang { display: inline-flex; align-items: center; gap: 6px; }
.nav-actions { display: inline-flex; gap: 8px; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger { display: none; margin-inline-start: auto; padding: 8px; border-radius: 8px; cursor: pointer; }
.nav-burger svg { width: 24px; height: 24px; }

@media (max-width: 920px) {
    .nav-burger { display: block; }
    .nav-links {
        display: none; position: absolute; inset-inline: 0; top: 66px;
        flex-direction: column; align-items: stretch; gap: 4px;
        padding: 12px 20px 20px; background: var(--bg); border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    .nav-links > a { padding: 10px 4px; }
    .nav-actions { flex-direction: column; margin-top: 8px; }
    .nav-toggle:checked ~ .nav-links { display: flex; }
    .nav-toggle:focus-visible + .nav-burger { outline: 2px solid var(--accent); }
}

/* Hero */
.hero { padding-block: 72px 40px; background: radial-gradient(1000px 420px at 85% -10%, var(--primary-soft), transparent 70%); }
[dir="rtl"] .hero { background: radial-gradient(1000px 420px at 15% -10%, var(--primary-soft), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-block; font-size: .8125rem; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 700; }
.lead { margin-top: 18px; font-size: 1.125rem; color: var(--text-2); max-width: 36em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.note { margin-top: 14px; font-size: .875rem; color: var(--muted); }

.hero-visual { position: relative; display: grid; gap: 18px; }
.phone { background: var(--chat-bg); border: 1px solid var(--border); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 10px; max-width: 420px; justify-self: end; width: 100%; }
[dir="rtl"] .phone { justify-self: start; }
.phone-bar { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .875rem; color: var(--text-2); padding-bottom: 6px; }
.phone-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 12px; font-size: .9375rem; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.bubble.in { background: var(--bubble-in); justify-self: start; border-start-start-radius: 4px; }
.bubble.out { background: var(--bubble-out); justify-self: end; border-start-end-radius: 4px; }
.ticks { margin-inline-start: 8px; font-size: .75rem; color: #53bdeb; letter-spacing: -3px; }
.code-card { background: var(--code-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-align: left; }
.code-head { padding: 10px 16px; font: 500 .8125rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--code-muted); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.code-head span { color: #34d399; font-weight: 700; margin-right: 6px; }
pre { margin: 0; padding: 16px; overflow-x: auto; color: var(--code-text); font: .8125rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; }

.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
.point { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.point strong { display: block; }
.point span:not(.point-icon) { color: var(--muted); font-size: .9375rem; }
.point-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }

/* Sections */
.section { padding-block: 84px; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-head p { margin-top: 12px; color: var(--text-2); font-size: 1.0625rem; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: none; }
.step { position: relative; padding: 28px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step-num { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-weight: 700; margin-bottom: 16px; }
.step h3 { font-size: 1.125rem; }
.step p { margin-top: 8px; color: var(--text-2); }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.feature-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); margin-bottom: 16px; }
.feature h3 { font-size: 1.0625rem; }
.feature p { margin-top: 8px; color: var(--text-2); font-size: .9375rem; }

.protect { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: center; }
.protect-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); margin-bottom: 18px; }
.protect-icon .icon { width: 28px; height: 28px; }
.protect h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.protect-copy p { margin-top: 12px; color: var(--text-2); font-size: 1.0625rem; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.protect .checklist li { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.check { color: var(--primary); margin-top: 4px; }

.tabs { max-width: 860px; margin: 0 auto; background: var(--code-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-align: left; }
.tab-list { display: flex; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.tab-list button { font: inherit; font-size: .875rem; font-weight: 600; color: var(--code-muted); background: none; border: 0; padding: 10px 14px; border-radius: 8px 8px 0 0; cursor: pointer; }
.tab-list button[aria-selected="true"] { color: #ffffff; background: rgba(255, 255, 255, .07); }
.tabs pre { padding: 20px; min-height: 300px; }
.dev .center { margin-top: 28px; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; max-width: 1200px; margin: 0 auto; }
.plan { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 28px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.plan-popular { border: 2px solid var(--primary); box-shadow: var(--shadow); }
.plan h3 { font-size: 1.125rem; }
.plan .checklist { flex: 1; font-size: .9375rem; color: var(--text-2); }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.amount { font-size: 2.25rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.currency { color: var(--muted); font-size: .9375rem; white-space: nowrap; }
.badge { position: absolute; top: -12px; inset-inline-start: 24px; background: var(--primary); color: var(--primary-ink); font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
#pricing .plans + .center { margin-top: 24px; }
.amount-text { font-size: 1.75rem; }
.sar { display: block; width: 100%; color: var(--muted); font-size: .8125rem; }
.region-switch { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; width: fit-content; max-width: 100%; margin: 0 auto 28px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.region-switch button { font: inherit; font-size: .875rem; font-weight: 600; color: var(--text-2); background: none; border: 0; padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.region-switch button[aria-pressed="true"] { color: var(--primary-ink); background: var(--primary); }
.annual-note { font-weight: 600; color: var(--primary); }
.addons { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 1040px; margin: 32px auto 0; }
.addon-card { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.addon-card h3 { font-size: 1.0625rem; margin-bottom: 12px; }
.addon-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.addon-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; color: var(--text-2); font-size: .9375rem; }
.addon-price .amount { font-size: 1.125rem; }
.addon-price .sar { display: inline; width: auto; margin-inline-start: 6px; }
.addon-note { margin-top: 12px; font-size: .8125rem; }

.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 18px; color: var(--text-2); }

.cta { text-align: center; padding: 56px 24px; border-radius: 20px; color: #ffffff; background: linear-gradient(135deg, #047857, #065f46 60%, #064e3b); }
.cta h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.cta p { margin-top: 12px; color: #d1fae5; font-size: 1.0625rem; }
.center-actions { justify-content: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding-block: 40px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.footer-grid .brand { margin-bottom: 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: flex-end; font-size: .9375rem; }
.footer-links a { text-decoration: none; color: var(--text-2); }
.footer-links a:hover { color: var(--text); }
.copyright { margin-top: 24px; }

/* Responsive */
@media (max-width: 1024px) {
    .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .hero { padding-top: 44px; }
    .hero-grid, .protect { grid-template-columns: 1fr; gap: 36px; }
    .phone, [dir="rtl"] .phone { justify-self: stretch; max-width: none; }
    .points, .steps { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-links { justify-content: flex-start; }
    .section { padding-block: 60px; }
}
@media (max-width: 560px) {
    .features { grid-template-columns: 1fr; }
    .actions .btn { width: 100%; }
    .tabs pre { min-height: 0; }
}

/* Legal pages */
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-inline-start: auto; font-size: .9375rem; }
.legal-nav a { text-decoration: none; color: var(--text-2); }
.legal-nav a.current { color: var(--primary); font-weight: 600; }
.legal { font-size: 1rem; }
.legal h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin-bottom: 6px; }
.legal h2 { font-size: 1.25rem; margin: 36px 0 10px; }
.legal h3 { font-size: 1.05rem; margin: 22px 0 8px; }
.legal p, .legal li { color: var(--text-2); }
.legal p { margin: 0 0 12px; }
.legal ul, .legal ol { margin: 0 0 14px; padding-inline-start: 22px; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--text); }
.legal table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: .9375rem; }
.legal th, .legal td { text-align: start; padding: 10px 12px; border: 1px solid var(--border); vertical-align: top; color: var(--text-2); }
.legal th { background: var(--bg-alt); color: var(--text); }
.legal-draft { padding: 12px 16px; border-radius: 10px; background: #fff4d6; color: #7a4b00 !important; border: 1px solid #f3d38a; margin-bottom: 24px !important; }
.legal mark { background: #fff1b8; color: #6b4400; padding: 0 4px; border-radius: 4px; }
.legal .toc { padding: 16px 20px; background: var(--bg-alt); border-radius: 12px; }
@media (prefers-color-scheme: dark) {
    .legal-draft { background: #3a2c08; color: #f5d27a !important; border-color: #6b520f; }
    .legal mark { background: #5a4507; color: #ffe6a0; }
}
.brand { white-space: nowrap; }
@media (max-width: 600px) {
    .site-header .nav:has(.legal-nav) { flex-wrap: wrap; gap: 6px 16px; padding-block: 10px; }
    .legal-nav { width: 100%; margin-inline-start: 0; }
}
[hidden] { display: none !important; }
#pricing .addons + .center { margin-top: 24px; }
