/* ════════════════════════════════════════════════
   NEXUS LANDING PAGE — DESIGN SYSTEM
   External CSS for performance (replaces inline styles)
   Direction handled via [dir="rtl"] / [dir="ltr"] selectors
════════════════════════════════════════════════ */

/* ── ROOT VARIABLES ── */
:root {
    --primary:       #2563eb;
    --primary-dark:  #1e3a8a;
    --primary-light: #dbeafe;
    --accent:        #06b6d4;
    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --purple:        #8b5cf6;
    --bg:            #f8fafc;
    --surface:       #ffffff;
    --text:          #0f172a;
    --muted:         #64748b;
    --border:        #e2e8f0;
    --radius-sm:     8px;
    --radius:        16px;
    --radius-lg:     24px;
    --shadow-sm:     0 2px 8px rgba(0,0,0,.06);
    --shadow:        0 8px 32px rgba(0,0,0,.10);
    --shadow-lg:     0 20px 60px rgba(0,0,0,.14);
    /* Font: direction-specific font override below */
    --font:          'Inter', sans-serif;
}

/* Direction-specific font */
[dir="rtl"] { --font: 'Noto Sans Arabic', sans-serif; }
[dir="ltr"] { --font: 'Inter', sans-serif; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ── UTILITIES ── */
.container  { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 96px 0; }
.section-sm { padding: 60px 0; }
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }

.tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--primary-light); color: var(--primary);
    padding: 5px 14px; border-radius: 20px;
    font-size: 13px; font-weight: 700; letter-spacing: .3px;
    margin-bottom: 16px;
}
.section-title {
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 900; line-height: 1.2;
    margin-bottom: 14px;
}
.section-sub {
    font-size: 17px; color: var(--muted);
    max-width: 620px; margin: 0 auto 52px;
}

/* ── NAVBAR ── */
.navbar {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(226,232,240,.6);
    transition: box-shadow .3s;
}
.navbar.scrolled { box-shadow: var(--shadow); }
.nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 68px;
}
.nav-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 20px; font-weight: 900; color: var(--primary);
    text-decoration: none;
}
.nav-brand .dot { color: var(--accent); }
.nav-links {
    display: flex; align-items: center; gap: 8px;
    list-style: none;
}
.nav-links a {
    padding: 8px 14px; border-radius: var(--radius-sm);
    color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
    transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--primary); background: var(--primary-light); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn-ghost {
    padding: 9px 18px; border-radius: var(--radius-sm);
    color: var(--primary); font-size: 14px; font-weight: 600;
    text-decoration: none; border: 1.5px solid var(--primary);
    transition: all .2s;
}
.btn-ghost:hover { background: var(--primary); color: #fff; }
.btn-primary {
    padding: 10px 22px; border-radius: var(--radius-sm);
    background: var(--primary); color: #fff;
    font-size: 14px; font-weight: 700; text-decoration: none;
    border: none; cursor: pointer;
    box-shadow: 0 4px 14px rgba(37,99,235,.35);
    transition: all .2s;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,.45); }

/* Language switcher */
.lang-switch {
    display: flex; gap: 4px;
    background: var(--border); border-radius: 8px; padding: 3px;
}
.lang-switch a {
    padding: 4px 12px; border-radius: 6px;
    font-size: 12px; font-weight: 700; text-decoration: none;
    color: var(--muted); transition: all .2s;
}
.lang-switch a.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ── HERO ── */
.hero {
    padding: 160px 0 100px;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37,99,235,.15) 0%, transparent 70%),
        linear-gradient(180deg, #f0f6ff 0%, var(--bg) 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232563eb' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
    font-size: clamp(32px, 5.5vw, 60px);
    font-weight: 900; line-height: 1.15;
    letter-spacing: -1px;
    margin: 16px 0 20px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 60%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 18px; color: var(--muted);
    max-width: 660px; margin: 0 auto 36px;
    line-height: 1.8;
}
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-hero-primary {
    padding: 16px 36px; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; font-size: 16px; font-weight: 800;
    text-decoration: none; border: none; cursor: pointer;
    box-shadow: 0 8px 30px rgba(37,99,235,.4);
    transition: all .3s;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-hero-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(37,99,235,.5); }
.btn-hero-secondary {
    padding: 16px 30px; border-radius: var(--radius);
    background: var(--surface); color: var(--text);
    font-size: 16px; font-weight: 700; text-decoration: none;
    border: 2px solid var(--border); cursor: pointer;
    transition: all .2s;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-hero-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* Stats strip */
.hero-stats {
    display: flex; justify-content: center; gap: 48px;
    margin-top: 64px; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 32px; font-weight: 900; color: var(--primary); }
.hero-stat .lbl { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Mock report preview */
.hero-mockup {
    margin: 60px auto 0;
    max-width: 900px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}
.mockup-bar {
    background: #1e293b;
    padding: 10px 16px;
    display: flex; align-items: center; gap: 8px;
}
.mockup-dot { width: 12px; height: 12px; border-radius: 50%; }
.mockup-url { background: rgba(255,255,255,.08); color: #94a3b8; font-size: 12px; padding: 4px 12px; border-radius: 6px; flex: 1; text-align: center; }
.mockup-body {
    display: grid; grid-template-columns: 1fr 1fr;
    min-height: 240px;
}
.mockup-pdf {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.mockup-pdf-icon { font-size: 60px; color: #ef4444; opacity: .6; }
.mockup-analysis { padding: 20px; background: var(--bg); }
.mock-risk {
    background: var(--surface); border-radius: 10px; padding: 12px 14px;
    margin-bottom: 10px; border-right: 4px solid;
    font-size: 13px;
}
[dir="ltr"] .mock-risk { border-right: none; border-left: 4px solid; }
.mock-risk.red   { border-color: #ef4444; }
.mock-risk.amber { border-color: #f59e0b; }
.mock-risk.blue  { border-color: #3b82f6; }
.mock-risk.purple{ border-color: #8b5cf6; }
.mock-risk .r-label { font-weight: 700; margin-bottom: 4px; }
.mock-risk .r-text  { color: var(--muted); font-size: 12px; }

/* ── FEATURES GRID ── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}
.feature-card {
    background: var(--surface); border-radius: var(--radius);
    padding: 32px 28px; border: 1px solid var(--border);
    transition: all .3s;
    position: relative; overflow: hidden;
}
/* RTL: accent bar from right */
[dir="rtl"] .feature-card::before {
    content: ''; position: absolute;
    top: 0; right: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0); transform-origin: right;
    transition: transform .3s;
}
/* LTR: accent bar from left */
[dir="ltr"] .feature-card::before {
    content: ''; position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0); transform-origin: left;
    transition: transform .3s;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.feature-card:hover::before { transform: scaleX(1); }
.feature-icon {
    width: 56px; height: 56px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; margin-bottom: 18px;
}
.feature-card h3 { font-size: 17px; font-weight: 800; margin-bottom: 10px; }
.feature-card p  { font-size: 14px; color: var(--muted); line-height: 1.7; }

/* ── HOW IT WORKS ── */
.how-section { background: linear-gradient(135deg, var(--primary-dark) 0%, #1d4ed8 100%); color: #fff; }
.steps-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 40px; margin-top: 20px;
    position: relative;
}
/* RTL: line from right */
[dir="rtl"] .steps-grid::before {
    content: '';
    position: absolute; top: 36px;
    right: 16.66%; width: 66.66%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,.2), rgba(255,255,255,.6), rgba(255,255,255,.2));
}
/* LTR: line from left */
[dir="ltr"] .steps-grid::before {
    content: '';
    position: absolute; top: 36px;
    left: 16.66%; width: 66.66%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,.2), rgba(255,255,255,.6), rgba(255,255,255,.2));
}
.step-card { text-align: center; position: relative; z-index: 1; }
.step-num-wrap {
    width: 72px; height: 72px; margin: 0 auto 20px;
    background: rgba(255,255,255,.15); border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 900;
    backdrop-filter: blur(10px);
}
.step-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.step-card p  { font-size: 14px; opacity: .8; line-height: 1.7; }

/* ── PRICING ── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px; align-items: start;
}
.plan-card {
    background: var(--surface); border-radius: var(--radius-lg);
    padding: 36px 30px; border: 2px solid var(--border);
    transition: all .3s; position: relative;
}
.plan-card.popular {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,.1), var(--shadow);
    transform: scale(1.03);
}
.plan-badge {
    position: absolute; top: -14px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    color: #fff; padding: 5px 18px; border-radius: 20px;
    font-size: 12px; font-weight: 800; white-space: nowrap;
}
/* RTL badge centring */
[dir="rtl"] .plan-badge { right: 50%; transform: translateX(50%); }
/* LTR badge centring */
[dir="ltr"] .plan-badge { left: 50%; transform: translateX(-50%); }

.plan-name { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.plan-price {
    display: flex; align-items: baseline; gap: 4px;
    margin: 20px 0;
}
.plan-price .amount { font-size: 48px; font-weight: 900; color: var(--primary); }
.plan-price .period { font-size: 15px; color: var(--muted); }
.plan-features { list-style: none; margin: 20px 0 28px; }
.plan-features li {
    padding: 8px 0; font-size: 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.plan-features li:last-child { border-bottom: none; }
.plan-features li i { color: var(--success); width: 16px; }
.btn-plan {
    width: 100%; padding: 14px; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 800; cursor: pointer;
    border: none; text-decoration: none; display: block; text-align: center;
    transition: all .2s;
}
.btn-plan-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; box-shadow: 0 4px 16px rgba(37,99,235,.4);
}
.btn-plan-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,.5); }
.btn-plan-outline {
    background: transparent; color: var(--primary);
    border: 2px solid var(--primary) !important;
}
.btn-plan-outline:hover { background: var(--primary); color: #fff; }

/* ── REGISTER SECTION ── */
.register-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #fff;
}
.register-card {
    background: rgba(255,255,255,.06);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius-lg);
    padding: 48px;
    max-width: 580px; margin: 0 auto;
}
.register-card h2 { font-size: 28px; font-weight: 900; margin-bottom: 8px; }
.register-card p  { opacity: .7; font-size: 15px; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    margin-bottom: 6px; opacity: .8;
}
.form-control {
    width: 100%; padding: 13px 16px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius-sm);
    color: #fff; font-size: 15px;
    font-family: var(--font);
    transition: border-color .2s;
    outline: none;
}
.form-control::placeholder { opacity: .4; color: #fff; }
.form-control:focus { border-color: var(--accent); background: rgba(255,255,255,.12); }
.form-control option { background: #1e293b; color: #ffffff; }
.btn-register {
    width: 100%; padding: 16px;
    background: linear-gradient(135deg, var(--accent), #0284c7);
    color: #fff; font-size: 16px; font-weight: 800;
    border: none; border-radius: var(--radius-sm);
    cursor: pointer; margin-top: 8px;
    box-shadow: 0 6px 24px rgba(6,182,212,.4);
    transition: all .2s; font-family: var(--font);
}
.btn-register:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(6,182,212,.5); }
.reg-login-link {
    text-align: center; margin-top: 18px;
    font-size: 14px; opacity: .6;
}
.reg-login-link a { color: #fff; opacity: .8; text-decoration: underline; }

/* ── FAQ ── */
.faq-grid { max-width: 780px; margin: 0 auto; }
.faq-item {
    background: var(--surface); border-radius: var(--radius-sm);
    border: 1px solid var(--border); margin-bottom: 12px;
    overflow: hidden;
}
.faq-question {
    padding: 18px 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 700; font-size: 15px; gap: 10px;
    user-select: none;
}
.faq-question:hover { background: var(--bg); }
.faq-icon { font-size: 16px; color: var(--primary); flex-shrink: 0; transition: transform .3s; }
.faq-answer { display: none; padding: 0 20px 18px; font-size: 14px; color: var(--muted); line-height: 1.8; }
.faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-icon { transform: rotate(45deg); }

/* ── FOOTER ── */
.footer {
    background: #0f172a; color: #94a3b8;
    padding: 60px 0 24px;
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr;
    gap: 48px; margin-bottom: 40px;
}
.footer-brand { font-size: 22px; font-weight: 900; color: #fff; margin-bottom: 12px; }
.footer-brand .dot { color: var(--accent); }
.footer-desc { font-size: 14px; line-height: 1.8; }
.footer h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 8px; }
.footer ul a { color: #94a3b8; text-decoration: none; font-size: 14px; transition: color .2s; }
.footer ul a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 20px; display: flex;
    justify-content: space-between; align-items: center;
    font-size: 13px; flex-wrap: wrap; gap: 8px;
}

/* ── TOAST ── */
.toast-wrap {
    position: fixed; bottom: 24px;
    z-index: 9999; display: flex; flex-direction: column; gap: 10px;
}
[dir="rtl"] .toast-wrap { left: 24px; }
[dir="ltr"] .toast-wrap { right: 24px; }
.toast {
    background: var(--surface); color: var(--text);
    padding: 14px 20px; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600;
    border-right: 4px solid var(--success);
    animation: slideIn .3s ease;
    max-width: 320px;
}
[dir="ltr"] .toast { border-right: none; border-left: 4px solid var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .steps-grid { grid-template-columns: 1fr; }
    .steps-grid::before { display: none; }
    .mockup-body { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .register-card { padding: 28px 20px; }
    .hero { padding: 120px 0 60px; }
}
@media (max-width: 480px) {
    .hero-stats { gap: 24px; }
    .hero-ctas { flex-direction: column; align-items: center; }
}
