<?php
// public/home.php
// الصفحة الرئيسية - Vehicle Verify
require_once __DIR__.'/../config/app.php';

$dir  = (lang() === 'ar') ? 'rtl' : 'ltr';
$thm  = theme();
$user = currentUser();

// إذا كان المستخدم مسجّل الدخول، وجّهه إلى لوحته
if ($user) {
    redirect(BASE_URL.'/'.$user['role'].'/dashboard.php');
}
?>
<!DOCTYPE html>
<html lang="<?= e(lang()) ?>" dir="<?= $dir ?>" data-theme="<?= $thm ?>">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vehicle Verify — نظام التحقق من المركبات</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&family=Sora:wght@300;400;600;700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="<?= BASE_URL ?>/css/main.css">
<style>
  /* ── Home-page exclusive styles ── */
  :root {
    --navy: #0f2140;
    --navy-deep: #08111d;
    --gold: #f5a623;
    --gold-light: #fff4e0;
  }

  /* Reset page background for home */
  body { background: var(--bg-primary); overflow-x: hidden; }

  /* ── NAV ── */
  .home-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 48px; height: 72px;
    background: rgba(15,33,64,0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    transition: all 0.3s;
  }
  .home-nav.scrolled { box-shadow: 0 4px 32px rgba(0,0,0,0.3); }
  .nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
  .nav-brand-icon {
    width: 40px; height: 40px; background: var(--accent);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: 20px; box-shadow: 0 4px 14px rgba(26,86,219,0.4);
  }
  .nav-brand-text { color: #fff; font-size: 16px; font-weight: 800; font-family: 'Cairo', sans-serif; }
  .nav-brand-sub { color: rgba(255,255,255,0.4); font-size: 10px; display: block; font-weight: 400; }
  .nav-links { display: flex; align-items: center; gap: 8px; }
  .nav-links a {
    color: rgba(255,255,255,0.7); font-size: 13.5px; font-weight: 600;
    padding: 8px 16px; border-radius: 8px; text-decoration: none;
    transition: all 0.2s; font-family: 'Cairo', sans-serif;
  }
  .nav-links a:hover { color: #fff; background: rgba(255,255,255,0.08); }
  .nav-cta {
    background: var(--accent) !important; color: #fff !important;
    box-shadow: 0 4px 14px rgba(26,86,219,0.35) !important;
  }
  .nav-cta:hover { background: var(--accent-hover) !important; transform: translateY(-1px); }
  .nav-controls { display: flex; align-items: center; gap: 10px; }
  .lang-switcher { display: flex; gap: 4px; }
  .lang-btn {
    padding: 5px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2);
    background: transparent; color: rgba(255,255,255,0.6); font-size: 11px;
    font-weight: 700; cursor: pointer; text-decoration: none; transition: all 0.2s;
    font-family: 'Cairo', sans-serif;
  }
  .lang-btn.active, .lang-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
  .theme-btn-nav {
    width: 34px; height: 34px; border-radius: 8px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7); font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: all 0.2s;
  }
  .theme-btn-nav:hover { background: rgba(255,255,255,0.15); color: #fff; }

  /* ── HERO ── */
  .hero {
    min-height: 100vh; display: flex; align-items: center;
    position: relative; overflow: hidden;
    background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 50%, #112060 100%);
    padding-top: 72px;
  }
  .hero-bg-grid {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
      linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 20s linear infinite;
  }
  @keyframes gridMove { from { transform: translateY(0); } to { transform: translateY(60px); } }

  .hero-glow {
    position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none;
  }
  .hero-glow-1 {
    width: 500px; height: 500px; background: rgba(26,86,219,0.25);
    top: -100px; right: -100px;
    animation: glowPulse 6s ease-in-out infinite alternate;
  }
  .hero-glow-2 {
    width: 300px; height: 300px; background: rgba(245,166,35,0.15);
    bottom: 0px; left: 10%;
    animation: glowPulse 8s ease-in-out infinite alternate-reverse;
  }
  @keyframes glowPulse { from { opacity: 0.6; transform: scale(1); } to { opacity: 1; transform: scale(1.1); } }

  .hero-inner {
    position: relative; z-index: 2; max-width: 1200px;
    margin: 0 auto; padding: 60px 48px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center;
  }
  .hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(245,166,35,0.15); border: 1px solid rgba(245,166,35,0.3);
    color: var(--gold); padding: 6px 16px; border-radius: 50px;
    font-size: 12px; font-weight: 700; font-family: 'Cairo', sans-serif;
    margin-bottom: 24px; animation: fadeSlideUp 0.6s ease both;
  }
  .hero-badge span { width: 6px; height: 6px; background: var(--gold); border-radius: 50%; animation: blink 2s infinite; }
  @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

  .hero-title {
    font-family: 'Cairo', sans-serif; font-size: clamp(32px, 4vw, 52px);
    font-weight: 900; color: #fff; line-height: 1.2; margin-bottom: 20px;
    animation: fadeSlideUp 0.7s ease 0.1s both;
  }
  .hero-title .accent-word {
    color: var(--gold);
    text-shadow: 0 0 40px rgba(245,166,35,0.4);
  }
  .hero-desc {
    font-size: 16px; color: rgba(255,255,255,0.65); line-height: 1.8;
    font-family: 'Cairo', sans-serif; margin-bottom: 36px;
    animation: fadeSlideUp 0.7s ease 0.2s both;
  }
  .hero-actions {
    display: flex; gap: 14px; flex-wrap: wrap;
    animation: fadeSlideUp 0.7s ease 0.3s both;
  }
  .btn-hero-primary {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--accent); color: #fff;
    padding: 14px 32px; border-radius: 10px; font-size: 15px;
    font-weight: 700; text-decoration: none; font-family: 'Cairo', sans-serif;
    transition: all 0.25s; box-shadow: 0 6px 24px rgba(26,86,219,0.4);
  }
  .btn-hero-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 10px 32px rgba(26,86,219,0.55); color: #fff; }
  .btn-hero-ghost {
    display: inline-flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85);
    border: 1.5px solid rgba(255,255,255,0.2);
    padding: 14px 32px; border-radius: 10px; font-size: 15px;
    font-weight: 700; text-decoration: none; font-family: 'Cairo', sans-serif;
    transition: all 0.25s;
  }
  .btn-hero-ghost:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.4); color: #fff; }

  /* Hero stats */
  .hero-stats {
    display: flex; gap: 32px; margin-top: 48px;
    padding-top: 32px; border-top: 1px solid rgba(255,255,255,0.1);
    animation: fadeSlideUp 0.7s ease 0.4s both;
  }
  .hero-stat { text-align: center; }
  .hero-stat-num { font-size: 28px; font-weight: 900; color: #fff; font-family: 'Cairo', sans-serif; line-height: 1; }
  .hero-stat-label { font-size: 12px; color: rgba(255,255,255,0.45); font-family: 'Cairo', sans-serif; margin-top: 4px; }

  /* Hero visual card */
  .hero-visual { animation: fadeSlideUp 0.8s ease 0.2s both; }
  .hero-phone-mockup {
    background: linear-gradient(145deg, #1e3a6e, #112060);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px; padding: 28px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    position: relative; overflow: hidden;
  }
  .hero-phone-mockup::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
  }
  .mockup-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .mockup-title { color: #fff; font-size: 14px; font-weight: 700; font-family: 'Cairo', sans-serif; }
  .mockup-badge {
    background: rgba(16,185,129,0.2); color: #34d399;
    padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
    font-family: 'Cairo', sans-serif; border: 1px solid rgba(16,185,129,0.3);
  }
  .mockup-plate {
    background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.15);
    border-radius: 12px; padding: 16px 24px; text-align: center;
    font-size: 28px; font-weight: 900; color: #fff; letter-spacing: 0.12em;
    font-family: 'Sora', sans-serif; margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255,255,255,0.3);
  }
  .mockup-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .mockup-info-row:last-of-type { border-bottom: none; }
  .mockup-key { font-size: 12px; color: rgba(255,255,255,0.45); font-family: 'Cairo', sans-serif; }
  .mockup-val { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.9); font-family: 'Cairo', sans-serif; }
  .status-dot { display: inline-flex; align-items: center; gap: 6px; }
  .status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
  .status-dot.valid::before { background: #34d399; box-shadow: 0 0 6px #34d399; }
  .status-dot.expired::before { background: #f87171; box-shadow: 0 0 6px #f87171; }
  .status-dot.expiring::before { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }

  .mockup-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
  .mockup-doc {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 12px;
  }
  .mockup-doc-icon { font-size: 18px; margin-bottom: 6px; }
  .mockup-doc-name { font-size: 11px; color: rgba(255,255,255,0.6); font-family: 'Cairo', sans-serif; }
  .mockup-doc-status { font-size: 10px; font-weight: 700; margin-top: 4px; }
  .mockup-doc-status.valid { color: #34d399; }
  .mockup-doc-status.expired { color: #f87171; }
  .mockup-doc-status.expiring { color: #fbbf24; }

  /* floating scan button */
  .scan-float {
    position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
    background: var(--gold); color: var(--navy-deep);
    padding: 10px 28px; border-radius: 50px; font-size: 13px; font-weight: 800;
    font-family: 'Cairo', sans-serif; box-shadow: 0 8px 24px rgba(245,166,35,0.5);
    display: flex; align-items: center; gap: 8px;
    animation: floatBounce 3s ease-in-out infinite;
    white-space: nowrap;
  }
  @keyframes floatBounce { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(-6px)} }

  /* ── SECTION SHARED ── */
  .section { padding: 100px 0; }
  .section-inner { max-width: 1200px; margin: 0 auto; padding: 0 48px; }
  .section-label {
    display: inline-block; font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--accent); margin-bottom: 14px;
    font-family: 'Sora', sans-serif;
  }
  .section-title {
    font-size: clamp(26px, 3vw, 40px); font-weight: 900;
    color: var(--text-primary); font-family: 'Cairo', sans-serif;
    line-height: 1.25; margin-bottom: 16px;
  }
  .section-desc { font-size: 16px; color: var(--text-muted); font-family: 'Cairo', sans-serif; max-width: 540px; line-height: 1.8; }

  /* ── FEATURES ── */
  .features-bg { background: var(--bg-secondary); }
  .features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 60px; }
  .feature-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 20px; padding: 32px 28px;
    transition: all 0.3s; position: relative; overflow: hidden;
  }
  .feature-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(26,86,219,0.04));
    pointer-events: none;
  }
  .feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
  .feature-icon-wrap {
    width: 56px; height: 56px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; margin-bottom: 20px; position: relative;
  }
  .feature-icon-wrap.blue { background: var(--accent-light); }
  .feature-icon-wrap.green { background: var(--success-bg); }
  .feature-icon-wrap.gold { background: var(--gold-light); }
  .feature-icon-wrap.red { background: var(--danger-bg); }
  .feature-icon-wrap.teal { background: #e0f7fa; }
  .feature-icon-wrap.purple { background: #ede9fe; }
  .feature-title { font-size: 17px; font-weight: 800; margin-bottom: 10px; font-family: 'Cairo', sans-serif; color: var(--text-primary); }
  .feature-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.75; font-family: 'Cairo', sans-serif; }

  /* ── ROLES ── */
  .roles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 60px; }
  .role-card {
    border-radius: 24px; padding: 40px 32px;
    position: relative; overflow: hidden; transition: all 0.3s;
  }
  .role-card:hover { transform: translateY(-6px); box-shadow: 0 24px 64px rgba(0,0,0,0.15); }
  .role-card.owner { background: linear-gradient(145deg, #0f2140, #1a3a70); }
  .role-card.driver { background: linear-gradient(145deg, #064e3b, #0d7c5e); }
  .role-card.officer { background: linear-gradient(145deg, #78350f, #c26f1a); }
  .role-card::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 160px; height: 160px; border-radius: 50%;
    background: rgba(255,255,255,0.05); pointer-events: none;
  }
  .role-emoji { font-size: 44px; margin-bottom: 20px; display: block; }
  .role-title { font-size: 22px; font-weight: 900; color: #fff; font-family: 'Cairo', sans-serif; margin-bottom: 12px; }
  .role-desc { font-size: 14px; color: rgba(255,255,255,0.7); font-family: 'Cairo', sans-serif; line-height: 1.75; margin-bottom: 24px; }
  .role-features { list-style: none; display: flex; flex-direction: column; gap: 8px; }
  .role-features li {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: rgba(255,255,255,0.85); font-family: 'Cairo', sans-serif;
  }
  .role-features li::before { content: '✓'; font-weight: 900; font-size: 12px; color: rgba(255,255,255,0.5); }

  /* ── HOW IT WORKS ── */
  .how-bg { background: var(--bg-secondary); }
  .steps-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 60px; position: relative; }
  .steps-row::before {
    content: ''; position: absolute;
    top: 36px; left: 15%; right: 15%;
    height: 2px; background: linear-gradient(90deg, var(--accent), rgba(26,86,219,0.2));
    z-index: 0;
  }
  [dir="rtl"] .steps-row::before { background: linear-gradient(270deg, var(--accent), rgba(26,86,219,0.2)); }
  .step { text-align: center; padding: 0 20px; position: relative; z-index: 1; }
  .step-num {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 900; font-family: 'Sora', sans-serif;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(26,86,219,0.35);
    border: 4px solid var(--bg-secondary);
    transition: all 0.3s;
  }
  .step:hover .step-num { transform: scale(1.1); box-shadow: 0 12px 32px rgba(26,86,219,0.45); }
  .step-title { font-size: 15px; font-weight: 800; color: var(--text-primary); font-family: 'Cairo', sans-serif; margin-bottom: 8px; }
  .step-desc { font-size: 13px; color: var(--text-muted); font-family: 'Cairo', sans-serif; line-height: 1.6; }

  /* ── CTA ── */
  .cta-section {
    background: linear-gradient(145deg, var(--navy-deep), var(--navy), #112060);
    padding: 100px 0; text-align: center; position: relative; overflow: hidden;
  }
  .cta-section::before {
    content: ''; position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
  }
  .cta-inner { position: relative; z-index: 1; }
  .cta-title { font-size: clamp(28px, 3.5vw, 48px); font-weight: 900; color: #fff; font-family: 'Cairo', sans-serif; margin-bottom: 16px; }
  .cta-desc { font-size: 16px; color: rgba(255,255,255,0.6); font-family: 'Cairo', sans-serif; max-width: 480px; margin: 0 auto 40px; line-height: 1.8; }
  .cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

  /* ── FOOTER ── */
  .home-footer {
    background: var(--navy-deep); padding: 40px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .footer-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 48px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .footer-brand { display: flex; align-items: center; gap: 12px; }
  .footer-brand-text { color: rgba(255,255,255,0.6); font-size: 13px; font-family: 'Cairo', sans-serif; }
  .footer-copy { font-size: 12px; color: rgba(255,255,255,0.35); font-family: 'Cairo', sans-serif; }

  /* ── RESPONSIVE ── */
  @media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; gap: 40px; padding: 40px 24px; text-align: center; }
    .hero-actions { justify-content: center; }
    .hero-stats { justify-content: center; }
    .hero-visual { order: -1; }
    .features-grid, .roles-grid { grid-template-columns: 1fr; }
    .steps-row { grid-template-columns: 1fr 1fr; gap: 32px; }
    .steps-row::before { display: none; }
    .home-nav { padding: 0 20px; }
    .section-inner { padding: 0 24px; }
    .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
    .nav-links { display: none; }
  }
  @media (max-width: 560px) {
    .steps-row { grid-template-columns: 1fr; }
  }

  /* Dark mode adjustments */
  [data-theme="dark"] .features-bg,
  [data-theme="dark"] .how-bg { background: var(--bg-secondary); }
  [data-theme="dark"] .feature-icon-wrap.teal { background: #0d3038; }
  [data-theme="dark"] .feature-icon-wrap.purple { background: #2e1b5e; }
  [data-theme="dark"] .feature-icon-wrap.gold { background: #3d2200; }
</style>
</head>
<body>

<!-- ═══════════════════════════════ NAV ═══════════════════════════════ -->
<nav class="home-nav" id="mainNav">
  <a class="nav-brand" href="<?= BASE_URL ?>/home.php">
    <div class="nav-brand-icon">🚗</div>
    <div>
      <span class="nav-brand-text">Vehicle Verify</span>
      <span class="nav-brand-sub">نظام التحقق الذكي</span>
    </div>
  </a>

  <div class="nav-links">
    <a href="#features">المزايا</a>
    <a href="#roles">الأدوار</a>
    <a href="#how">كيف يعمل</a>
    <a href="<?= BASE_URL ?>/index.php?tab=login" class="nav-cta">تسجيل الدخول</a>
  </div>

  <div class="nav-controls">
    <div class="lang-switcher">
      <?php foreach(['ar','en','fr'] as $l): ?>
      <a href="<?= BASE_URL ?>/lang.php?set=<?= $l ?>&back=<?= urlencode($_SERVER['REQUEST_URI']) ?>"
         class="lang-btn <?= lang()===$l?'active':'' ?>">
        <?= $l==='ar'?'ع':strtoupper($l) ?>
      </a>
      <?php endforeach; ?>
    </div>
    <?php $thm=theme(); ?>
    <a href="<?= BASE_URL ?>/theme.php?set=<?= $thm==='dark'?'light':'dark' ?>&back=<?= urlencode($_SERVER['REQUEST_URI']) ?>"
       class="theme-btn-nav">
      <?= $thm==='dark'?'☀️':'🌙' ?>
    </a>
  </div>
</nav>

<!-- ═══════════════════════════════ HERO ═══════════════════════════════ -->
<section class="hero">
  <div class="hero-bg-grid"></div>
  <div class="hero-glow hero-glow-1"></div>
  <div class="hero-glow hero-glow-2"></div>

  <div class="hero-inner">
    <!-- Text -->
    <div class="hero-text">
      <div class="hero-badge">
        <span></span>
        النظام الأول للتحقق من المركبات في الجزائر
      </div>
      <h1 class="hero-title">
        تحقق من أي مركبة<br>
        في <span class="accent-word">ثوانٍ معدودة</span>
      </h1>
      <p class="hero-desc">
        منصة متكاملة تتيح لأصحاب المركبات إدارة وثائقهم، وللسائقين متابعة تراخيصهم،
        وللضباط التحقق السريع عبر مسح QR أو البحث برقم اللوحة.
      </p>
      <div class="hero-actions">
        <a href="<?= BASE_URL ?>/index.php?tab=register" class="btn-hero-primary">
          ابدأ مجاناً ←
        </a>
        <a href="<?= BASE_URL ?>/index.php?tab=login" class="btn-hero-ghost">
          تسجيل الدخول
        </a>
      </div>

      <div class="hero-stats">
        <div class="hero-stat">
          <div class="hero-stat-num">3</div>
          <div class="hero-stat-label">أدوار مختلفة</div>
        </div>
        <div class="hero-stat">
          <div class="hero-stat-num">4</div>
          <div class="hero-stat-label">أنواع وثائق</div>
        </div>
        <div class="hero-stat">
          <div class="hero-stat-num">QR</div>
          <div class="hero-stat-label">تحقق فوري</div>
        </div>
        <div class="hero-stat">
          <div class="hero-stat-num">3x</div>
          <div class="hero-stat-label">لغات مدعومة</div>
        </div>
      </div>
    </div>

    <!-- Mockup -->
    <div class="hero-visual">
      <div style="position:relative;padding-bottom:24px">
        <div class="hero-phone-mockup">
          <div class="mockup-header">
            <span class="mockup-title">🔍 نتيجة التحقق</span>
            <span class="mockup-badge">✓ موثّق</span>
          </div>
          <div class="mockup-plate">16 - ABC - 01</div>
          <div class="mockup-info-row">
            <span class="mockup-key">المالك</span>
            <span class="mockup-val">Ahmed Ben Ali</span>
          </div>
          <div class="mockup-info-row">
            <span class="mockup-key">المركبة</span>
            <span class="mockup-val">Toyota Corolla 2020</span>
          </div>
          <div class="mockup-info-row">
            <span class="mockup-key">السائق الحالي</span>
            <span class="mockup-val">Mohammed Saidi</span>
          </div>
          <div class="mockup-docs">
            <div class="mockup-doc">
              <div class="mockup-doc-icon">📄</div>
              <div class="mockup-doc-name">التأمين</div>
              <div class="mockup-doc-status valid status-dot valid">ساري</div>
            </div>
            <div class="mockup-doc">
              <div class="mockup-doc-icon">🪪</div>
              <div class="mockup-doc-name">البطاقة الرمادية</div>
              <div class="mockup-doc-status valid status-dot valid">ساري</div>
            </div>
            <div class="mockup-doc">
              <div class="mockup-doc-icon">🔧</div>
              <div class="mockup-doc-name">الفحص التقني</div>
              <div class="mockup-doc-status expired status-dot expired">منتهي</div>
            </div>
            <div class="mockup-doc">
              <div class="mockup-doc-icon">📋</div>
              <div class="mockup-doc-name">رخصة السياقة</div>
              <div class="mockup-doc-status valid status-dot valid">ساري</div>
            </div>
          </div>
        </div>
        <div class="scan-float">📷 امسح QR للتحقق</div>
      </div>
    </div>
  </div>
</section>

<!-- ═══════════════════════════════ FEATURES ═══════════════════════════════ -->
<section class="section features-bg" id="features">
  <div class="section-inner">
    <span class="section-label">المزايا الرئيسية</span>
    <h2 class="section-title">كل ما تحتاجه في مكان واحد</h2>
    <p class="section-desc">نظام شامل يغطي جميع احتياجات إدارة وثائق المركبات بسهولة وأمان.</p>

    <div class="features-grid">
      <div class="feature-card">
        <div class="feature-icon-wrap blue">📱</div>
        <h3 class="feature-title">مسح QR فوري</h3>
        <p class="feature-desc">كل مركبة تحصل على رمز QR فريد. يكفي مسحه للحصول على كامل المعلومات في ثوانٍ دون الحاجة لاتصال بالإنترنت.</p>
      </div>
      <div class="feature-card">
        <div class="feature-icon-wrap green">📄</div>
        <h3 class="feature-title">إدارة الوثائق</h3>
        <p class="feature-desc">رفع وتتبع جميع وثائق المركبة (التأمين، البطاقة الرمادية، الفحص التقني، رخصة السياقة) مع تنبيهات الانتهاء.</p>
      </div>
      <div class="feature-card">
        <div class="feature-icon-wrap gold">⚠️</div>
        <h3 class="feature-title">تنبيهات الانتهاء</h3>
        <p class="feature-desc">يتلقى أصحاب المركبات تنبيهات تلقائية قبل انتهاء صلاحية أي وثيقة بـ 30 يوماً لتجنب المخالفات.</p>
      </div>
      <div class="feature-card">
        <div class="feature-icon-wrap teal">🔍</div>
        <h3 class="feature-title">بحث برقم اللوحة</h3>
        <p class="feature-desc">يستطيع الضباط البحث عن أي مركبة برقم لوحتها والاطلاع فوراً على حالة جميع وثائقها ومعلومات السائق.</p>
      </div>
      <div class="feature-card">
        <div class="feature-icon-wrap purple">👥</div>
        <h3 class="feature-title">إدارة السائقين</h3>
        <p class="feature-desc">يمكن لصاحب المركبة ربط عدة سائقين بمركباته وتعيين سائق حالي وإدارة صلاحياتهم بكل سهولة.</p>
      </div>
      <div class="feature-card">
        <div class="feature-icon-wrap red">🔐</div>
        <h3 class="feature-title">أمان وموثوقية</h3>
        <p class="feature-desc">حماية CSRF، تشفير bcrypt للكلمات السرية، جلسات آمنة، وسجل كامل لعمليات البحث للمراجعة والمساءلة.</p>
      </div>
    </div>
  </div>
</section>

<!-- ═══════════════════════════════ ROLES ═══════════════════════════════ -->
<section class="section" id="roles">
  <div class="section-inner">
    <span class="section-label">الأدوار</span>
    <h2 class="section-title">ثلاثة أدوار، منصة واحدة</h2>
    <p class="section-desc">كل مستخدم يحصل على لوحة تحكم مخصصة حسب دوره وصلاحياته.</p>

    <div class="roles-grid">
      <div class="role-card owner">
        <span class="role-emoji">👤</span>
        <h3 class="role-title">صاحب المركبة</h3>
        <p class="role-desc">يدير مركباته ووثائقها وسائقيه من مكان واحد بواجهة سهلة الاستخدام.</p>
        <ul class="role-features">
          <li>إضافة وإدارة المركبات</li>
          <li>رفع وتتبع الوثائق</li>
          <li>ربط السائقين بالمركبات</li>
          <li>توليد رمز QR لكل مركبة</li>
          <li>عرض حالة جميع الوثائق</li>
        </ul>
      </div>
      <div class="role-card driver">
        <span class="role-emoji">🚗</span>
        <h3 class="role-title">السائق</h3>
        <p class="role-desc">يتابع رخصة قيادته، ويطّلع على المركبات المرتبطة به وحالة وثائقها.</p>
        <ul class="role-features">
          <li>عرض رخصة القيادة</li>
          <li>متابعة المركبات المرتبطة</li>
          <li>تعديل الملف الشخصي</li>
          <li>الاطلاع على حالة الوثائق</li>
        </ul>
      </div>
      <div class="role-card officer">
        <span class="role-emoji">👮</span>
        <h3 class="role-title">ضابط المرور</h3>
        <p class="role-desc">يتحقق من المركبات ميدانياً عبر مسح QR أو البحث برقم اللوحة بسرعة وفعالية.</p>
        <ul class="role-features">
          <li>مسح رمز QR للمركبة</li>
          <li>البحث برقم اللوحة</li>
          <li>عرض كامل الوثائق فوراً</li>
          <li>سجل عمليات البحث</li>
        </ul>
      </div>
    </div>
  </div>
</section>

<!-- ═══════════════════════════════ HOW IT WORKS ═══════════════════════════════ -->
<section class="section how-bg" id="how">
  <div class="section-inner">
    <span class="section-label">كيف يعمل</span>
    <h2 class="section-title">أربع خطوات فقط</h2>
    <p class="section-desc">البدء بسيط ولا يستغرق أكثر من دقيقتين.</p>

    <div class="steps-row">
      <div class="step">
        <div class="step-num">1</div>
        <h4 class="step-title">إنشاء حساب</h4>
        <p class="step-desc">سجّل بياناتك واختر دورك (مالك، سائق، أو ضابط)</p>
      </div>
      <div class="step">
        <div class="step-num">2</div>
        <h4 class="step-title">أضف مركبتك</h4>
        <p class="step-desc">أدخل معلومات المركبة ورقم اللوحة وارفع الوثائق المطلوبة</p>
      </div>
      <div class="step">
        <div class="step-num">3</div>
        <h4 class="step-title">ولّد رمز QR</h4>
        <p class="step-desc">احصل على رمز QR فريد لكل مركبة واطبعه أو احتفظ به رقمياً</p>
      </div>
      <div class="step">
        <div class="step-num">4</div>
        <h4 class="step-title">تحقق فورياً</h4>
        <p class="step-desc">يمسح الضابط الرمز ويرى كامل المعلومات والوثائق في ثوانٍ</p>
      </div>
    </div>
  </div>
</section>

<!-- ═══════════════════════════════ CTA ═══════════════════════════════ -->
<section class="cta-section">
  <div class="section-inner cta-inner">
    <h2 class="cta-title">جاهز للبدء؟</h2>
    <p class="cta-desc">انضم الآن وابدأ إدارة وثائق مركباتك بذكاء. مجاني، سريع، وآمن.</p>
    <div class="cta-buttons">
      <a href="<?= BASE_URL ?>/index.php?tab=register" class="btn-hero-primary">
        أنشئ حسابك الآن ←
      </a>
      <a href="<?= BASE_URL ?>/index.php?tab=login" class="btn-hero-ghost">
        🔐 تجربة Demo
      </a>
    </div>
  </div>
</section>

<!-- ═══════════════════════════════ FOOTER ═══════════════════════════════ -->
<footer class="home-footer">
  <div class="footer-inner">
    <div class="footer-brand">
      <div class="nav-brand-icon" style="width:32px;height:32px;font-size:16px">🚗</div>
      <span class="footer-brand-text">Vehicle Verify — نظام التحقق الذكي من المركبات</span>
    </div>
    <span class="footer-copy">© <?= date('Y') ?> Vehicle Verify. جميع الحقوق محفوظة.</span>
  </div>
</footer>

<script>
// Nav scroll effect
const nav = document.getElementById('mainNav');
window.addEventListener('scroll', () => {
  nav.classList.toggle('scrolled', window.scrollY > 20);
});

// Smooth scroll for anchor links
document.querySelectorAll('a[href^="#"]').forEach(a => {
  a.addEventListener('click', e => {
    e.preventDefault();
    const target = document.querySelector(a.getAttribute('href'));
    if (target) target.scrollIntoView({ behavior: 'smooth', block: 'start' });
  });
});

// Intersection Observer for fade-in animations
const observer = new IntersectionObserver((entries) => {
  entries.forEach(e => {
    if (e.isIntersecting) {
      e.target.style.opacity = '1';
      e.target.style.transform = 'translateY(0)';
    }
  });
}, { threshold: 0.1 });

document.querySelectorAll('.feature-card, .role-card, .step').forEach(el => {
  el.style.opacity = '0';
  el.style.transform = 'translateY(24px)';
  el.style.transition = 'opacity 0.5s ease, transform 0.5s ease';
  observer.observe(el);
});
</script>
</body>
</html>