/* ===========================================================================
   KeraCRM marketing site — modern SaaS, vibrant gradients, bilingual + RTL
   =========================================================================== */
:root {
    --brand-1: #6366f1;   /* indigo  */
    --brand-2: #8b5cf6;   /* violet  */
    --brand-3: #ec4899;   /* pink    */
    --cyan:    #06b6d4;
    --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #ec4899 100%);
    --grad-soft: linear-gradient(135deg, #eef2ff 0%, #faf5ff 50%, #fdf2f8 100%);

    --ink: #0f172a;
    --body: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #ffffff;
    --surface: #f8fafc;

    --radius: 16px;
    --radius-lg: 24px;
    --shadow: 0 10px 30px -12px rgba(15, 23, 42, .18);
    --shadow-lg: 0 30px 60px -20px rgba(79, 70, 229, .35);
    --container: 1140px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-ar: 'Tajawal', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--body);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
html[lang="ar"] body { font-family: var(--font-ar); }

h1, h2, h3 { color: var(--ink); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-weight: 600; font-size: .95rem; border: 0; cursor: pointer;
    padding: .7rem 1.3rem; border-radius: 999px; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -8px rgba(124, 58, 237, .6); }
.btn--primary:hover { box-shadow: 0 16px 30px -8px rgba(124, 58, 237, .7); }
.btn--ghost { background: rgba(99, 102, 241, .08); color: var(--brand-1); }
.btn--ghost:hover { background: rgba(99, 102, 241, .15); }
.btn--light { background: #fff; color: var(--brand-1); }
.btn--lg { padding: .95rem 1.8rem; font-size: 1.02rem; }
.btn--block { display: flex; width: 100%; }

.pill {
    display: inline-block; padding: .4rem 1rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
    background: rgba(255, 255, 255, .15); color: #fff; backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.25);
}
.eyebrow { color: var(--brand-2); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Nav ---------- */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .8); backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.nav.is-scrolled { border-color: var(--line); box-shadow: 0 4px 20px -12px rgba(15,23,42,.2); }
.nav__inner { display: flex; align-items: center; gap: 1.5rem; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--grad); }
.brand__accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand--light { color: #fff; }
.nav__links { display: flex; gap: 1.6rem; margin-inline-start: auto; font-weight: 500; }
.nav__links a { color: var(--body); transition: color .15s; }
.nav__links a:hover { color: var(--brand-1); }
.nav__actions { display: flex; align-items: center; gap: .6rem; }
.lang-toggle {
    background: none; border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: .85rem;
    padding: .45rem .8rem; border-radius: 999px; cursor: pointer; transition: all .15s; font-family: inherit;
}
.lang-toggle:hover { border-color: var(--brand-2); color: var(--brand-2); }
.nav__burger { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__burger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--grad); overflow: hidden; padding: 5rem 0 6rem; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% -10%, rgba(255,255,255,.25), transparent 70%); pointer-events: none; }
.hero__blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.hero__blob--1 { width: 380px; height: 380px; background: #f472b6; top: -120px; inset-inline-end: -80px; }
.hero__blob--2 { width: 320px; height: 320px; background: #22d3ee; bottom: -120px; inset-inline-start: -80px; }
.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.hero__copy { color: #fff; }
.hero__title { color: #fff; font-size: clamp(2.2rem, 4.5vw, 3.5rem); font-weight: 900; margin: 1.1rem 0; }
.hero__sub { color: rgba(255, 255, 255, .92); font-size: 1.12rem; max-width: 33em; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.8rem 0 2rem; }
.hero__cta .btn--ghost { background: rgba(255,255,255,.16); color: #fff; }
.hero__cta .btn--ghost:hover { background: rgba(255,255,255,.26); }
.hero__stats { display: flex; gap: 2.2rem; flex-wrap: wrap; }
.hero__stats div { display: flex; flex-direction: column; }
.hero__stats strong { font-size: 1.7rem; color: #fff; font-weight: 800; }
.hero__stats span { font-size: .85rem; color: rgba(255,255,255,.8); }

/* App mockup */
.hero__visual { perspective: 1400px; }
.mock {
    background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
    transform: rotateY(-9deg) rotateX(4deg); transition: transform .4s ease;
}
html[dir="rtl"] .mock { transform: rotateY(9deg) rotateX(4deg); }
.mock:hover { transform: rotateY(0) rotateX(0); }
.mock__bar { display: flex; gap: 7px; padding: 14px 16px; background: #f1f5f9; }
.mock__bar span { width: 11px; height: 11px; border-radius: 50%; background: #cbd5e1; }
.mock__bar span:nth-child(1) { background: #fb7185; } .mock__bar span:nth-child(2) { background: #fbbf24; } .mock__bar span:nth-child(3) { background: #34d399; }
.mock__body { display: grid; grid-template-columns: 70px 1fr; min-height: 300px; }
.mock__side { background: #0f172a; padding: 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.mock__logo { height: 16px; border-radius: 5px; background: var(--grad); }
.mock__nav { height: 12px; border-radius: 5px; background: rgba(255,255,255,.12); }
.mock__nav--on { background: var(--brand-2); }
.mock__main { padding: 20px; background: #fff; }
.mock__tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.mock__tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.mock__tile b { font-size: 1.3rem; color: var(--ink); display: block; }
.mock__tile i { display: block; height: 6px; width: 60%; border-radius: 4px; background: var(--grad); margin-top: 8px; opacity: .6; }
.mock__row { height: 14px; border-radius: 6px; background: #eef2f7; margin-bottom: 12px; }
.mock__row--w { width: 70%; }

/* ---------- Sections ---------- */
.section { padding: 5.5rem 0; }
.section--alt { background: var(--surface); }
.section__head { max-width: 640px; margin: 0 auto 3rem; text-align: center; }
.section__head h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); margin: .6rem 0; }
.section__head p { color: var(--muted); font-size: 1.08rem; }

/* Features grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.card__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 1rem; }
.i-violet { background: #ede9fe; } .i-blue { background: #e0f2fe; } .i-pink { background: #fce7f3; }
.i-cyan { background: #cffafe; } .i-amber { background: #fef3c7; } .i-green { background: #dcfce7; }
.card h3 { font-size: 1.12rem; margin-bottom: .4rem; }
.card p { color: var(--muted); font-size: .95rem; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; position: relative; }
.step__n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--grad); color: #fff; font-weight: 800; font-size: 1.2rem; margin-bottom: 1rem; }
.step h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.step p { color: var(--muted); }

/* Bilingual showcase */
.showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.showcase__copy h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: .6rem 0 1rem; }
.showcase__copy p { color: var(--muted); font-size: 1.05rem; }
.ticks { list-style: none; margin-top: 1.4rem; display: grid; gap: .7rem; }
.ticks li { position: relative; padding-inline-start: 2rem; font-weight: 500; color: var(--ink); }
.ticks li::before { content: "✓"; position: absolute; inset-inline-start: 0; top: -1px; width: 22px; height: 22px; border-radius: 50%; background: var(--grad); color: #fff; font-size: .8rem; display: grid; place-items: center; }
.showcase__visual { display: grid; gap: 1.2rem; }
.flag-card { border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); display: flex; align-items: center; gap: 1.2rem; font-weight: 700; }
.flag-card span { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; color: #fff; flex: 0 0 auto; }
.flag-card p { color: var(--ink); font-weight: 600; }
.flag-card--en { background: #fff; border: 1px solid var(--line); }
.flag-card--en span { background: var(--brand-1); }
.flag-card--ar { background: #0f172a; }
.flag-card--ar span { background: var(--grad); }
.flag-card--ar p { color: #fff; direction: rtl; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; align-items: stretch; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 2rem; display: flex; flex-direction: column; position: relative; }
.plan--featured { border: 2px solid var(--brand-2); box-shadow: var(--shadow-lg); transform: translateY(-8px); }
.plan__tag { position: absolute; top: -13px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--grad); color: #fff; font-size: .78rem; font-weight: 700; padding: .3rem 1rem; border-radius: 999px; }
html[dir="rtl"] .plan__tag { transform: translateX(50%); }
.plan h3 { font-size: 1.3rem; }
.plan__price { font-size: 1.6rem; font-weight: 800; color: var(--brand-1); margin: .4rem 0 1rem; }
.plan ul { list-style: none; display: grid; gap: .6rem; margin-bottom: 1.6rem; flex: 1; }
.plan li { position: relative; padding-inline-start: 1.6rem; color: var(--body); }
.plan li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--brand-2); font-weight: 800; }

/* CTA band */
.cta-band { background: var(--grad); padding: 4.5rem 0; position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 100% at 50% 0, rgba(255,255,255,.2), transparent); }
.cta-band__inner { position: relative; text-align: center; color: #fff; }
.cta-band__inner h2 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.cta-band__inner p { color: rgba(255,255,255,.9); margin: .6rem 0 1.6rem; font-size: 1.1rem; }

/* Contact */
.contact { text-align: center; }
.contact__actions { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }

/* Footer */
.footer { background: #0b1120; color: #cbd5e1; padding-top: 3rem; }
.footer__inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-bottom: 2.5rem; }
.footer__brand .brand { font-size: 1.4rem; }
.footer__brand p { margin-top: .6rem; color: #94a3b8; max-width: 26em; }
.footer__links { display: flex; gap: 1.6rem; flex-wrap: wrap; align-items: center; }
.footer__links a { color: #cbd5e1; transition: color .15s; }
.footer__links a:hover { color: #fff; }
.footer__bar { border-top: 1px solid rgba(255,255,255,.08); padding: 1.3rem 0; font-size: .9rem; color: #94a3b8; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero__visual { order: -1; max-width: 460px; }
    .grid { grid-template-columns: repeat(2, 1fr); }
    .showcase { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .nav__links { position: fixed; inset: 72px 0 auto 0; flex-direction: column; background: #fff; padding: 1.2rem 24px; gap: 1rem; border-bottom: 1px solid var(--line); transform: translateY(-120%); transition: transform .25s ease; }
    .nav__links.is-open { transform: translateY(0); }
    .nav__burger { display: flex; }
    .nav__actions .btn--ghost { display: none; }
    .steps, .plans { grid-template-columns: 1fr; }
    .plan--featured { transform: none; }
    .hero__stats { gap: 1.4rem; }
}
@media (max-width: 480px) {
    .grid { grid-template-columns: 1fr; }
    .nav__links { margin-inline-start: 0; }
}
