<!doctype html>
<html lang="fr" dir="ltr" class="light">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>QanounAlert — Veille Juridique Marocaine par IA | قانون ألرت</title>
    <meta name="description" content="Accédez à +27 000 textes de loi marocains. Recherche juridique instantanée, alertes personnalisées et rédaction assistée par IA en français et en arabe. Lois, dahirs, bulletins officiels, jurisprudence Maroc." />
    <meta name="keywords" content="droit marocain, veille juridique maroc, loi maroc, dahir, bulletin officiel maroc, jurisprudence maroc, code travail maroc, droit marocain en ligne, قانون المغرب, التشريع المغربي, القانون المغربي" />
    <meta name="author" content="QanounAlert" />
    <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1" />
    <meta name="language" content="fr,ar" />
    <meta name="geo.region" content="MA" />
    <meta name="geo.country" content="Morocco" />

    <!-- Canonical + hreflang -->
    <link rel="canonical" href="https://qanounalert.com/" />
    <link rel="alternate" hreflang="fr" href="https://qanounalert.com/" />
    <link rel="alternate" hreflang="ar" href="https://qanounalert.com/" />
    <link rel="alternate" hreflang="x-default" href="https://qanounalert.com/" />

    <!-- Open Graph / Facebook -->
    <meta property="og:type" content="website" />
    <meta property="og:url" content="https://qanounalert.com/" />
    <meta property="og:title" content="QanounAlert — Veille Juridique Marocaine par IA" />
    <meta property="og:description" content="Accédez à +27 000 textes de loi marocains. Recherche juridique, alertes personnalisées et rédaction assistée par IA en FR et AR." />
    <meta property="og:image" content="https://qanounalert.com/og-image.svg" />
    <meta property="og:image:width" content="1200" />
    <meta property="og:image:height" content="630" />
    <meta property="og:image:alt" content="QanounAlert - Plateforme de veille juridique marocaine" />
    <meta property="og:locale" content="fr_MA" />
    <meta property="og:locale:alternate" content="ar_MA" />
    <meta property="og:site_name" content="QanounAlert" />

    <!-- Twitter Card -->
    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:site" content="@QanounAlert" />
    <meta name="twitter:url" content="https://qanounalert.com/" />
    <meta name="twitter:title" content="QanounAlert — Veille Juridique Marocaine par IA" />
    <meta name="twitter:description" content="Accédez à +27 000 textes de loi marocains. Recherche, alertes et rédaction IA bilingue FR/AR." />
    <meta name="twitter:image" content="https://qanounalert.com/og-image.svg" />

    <!-- JSON-LD Structured Data — WebApplication -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "WebApplication",
      "name": "QanounAlert",
      "alternateName": "قانون ألرت",
      "url": "https://qanounalert.com",
      "description": "Plateforme de veille juridique marocaine propulsée par IA. +27 000 textes juridiques officiels (lois, dahirs, décrets, bulletins officiels, jurisprudence).",
      "applicationCategory": "LegalApplication",
      "operatingSystem": "Web, Android",
      "inLanguage": ["fr", "ar"],
      "availableLanguage": [
        { "@type": "Language", "name": "French", "alternateName": "fr" },
        { "@type": "Language", "name": "Arabic", "alternateName": "ar" }
      ],
      "offers": [
        {
          "@type": "Offer",
          "name": "Plan Gratuit",
          "description": "Accès à 27 000+ textes juridiques marocains, 5 alertes, assistant IA 3 requêtes/jour",
          "price": "0",
          "priceCurrency": "MAD"
        },
        {
          "@type": "Offer",
          "name": "Plan Starter",
          "description": "Alertes illimitées, assistant IA 20 requêtes/jour, export PDF",
          "price": "190",
          "priceCurrency": "MAD",
          "billingIncrement": "P1M"
        },
        {
          "@type": "Offer",
          "name": "Plan Pro",
          "description": "Tout Starter + 50 requêtes IA/jour, modèles de documents premium",
          "price": "290",
          "priceCurrency": "MAD",
          "billingIncrement": "P1M"
        }
      ],
      "featureList": [
        "Recherche dans 27 000+ textes juridiques marocains",
        "Assistant IA spécialisé droit marocain",
        "Alertes en temps réel sur nouvelles lois",
        "Rédaction de documents juridiques par IA",
        "Bilingue français et arabe",
        "Application Android native"
      ],
      "screenshot": "https://qanounalert.com/og-image.svg",
      "provider": {
        "@type": "Organization",
        "name": "QanounAlert",
        "url": "https://qanounalert.com",
        "logo": "https://qanounalert.com/logo.svg",
        "areaServed": {
          "@type": "Country",
          "name": "Morocco"
        },
        "sameAs": []
      }
    }
    </script>

    <!-- JSON-LD — SiteLinksSearchBox -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "WebSite",
      "name": "QanounAlert",
      "url": "https://qanounalert.com",
      "potentialAction": {
        "@type": "SearchAction",
        "target": {
          "@type": "EntryPoint",
          "urlTemplate": "https://qanounalert.com/dashboard?q={search_term_string}"
        },
        "query-input": "required name=search_term_string"
      }
    }
    </script>

    <!-- Preconnect for performance -->
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="dns-prefetch" href="https://jvjpcxhljyjorgjcznsp.supabase.co" />

    <link rel="icon" type="image/svg+xml" href="/logo.svg" />
    <link rel="manifest" href="/manifest.json" />
    <link rel="apple-touch-icon" href="/logo.svg" />
    <meta name="theme-color" content="#6366f1" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <meta name="apple-mobile-web-app-title" content="QanounAlert" />
    <script type="module" crossorigin src="/assets/index-Bf_3aM6m.js"></script>
    <link rel="modulepreload" crossorigin href="/assets/i18n-DuZm6U1s.js">
    <link rel="modulepreload" crossorigin href="/assets/tiptap-B1yBBIjE.js">
    <link rel="modulepreload" crossorigin href="/assets/ui-Bwg6X5j3.js">
    <link rel="stylesheet" crossorigin href="/assets/index-5mUcEETx.css">
  </head>
  <body>
    <div id="root"></div>
    <!-- Google OAuth callback handler — runs BEFORE React loads -->
    <script>
    (function() {
      var hash = window.location.hash;
      if (hash && hash.indexOf('id_token=') !== -1) {
        var params = new URLSearchParams(hash.substring(1));
        var idToken = params.get('id_token');
        if (idToken) {
          // Clear hash immediately
          history.replaceState(null, '', location.pathname + location.search);
          // Show loading state
          document.getElementById('root').innerHTML = '<div style="display:flex;align-items:center;justify-content:center;min-height:100vh;background:#09090b;color:#a1a1aa;font-family:system-ui"><div style="text-align:center"><div style="width:40px;height:40px;border:3px solid #27272a;border-top-color:#7c3aed;border-radius:50%;animation:spin .8s linear infinite;margin:0 auto 16px"></div><p>Connexion Google en cours...</p><style>@keyframes spin{to{transform:rotate(360deg)}}</style></div></div>';
          // Exchange token with backend
          fetch('/api/auth/google', {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify({ credential: idToken })
          })
          .then(function(r) { return r.json(); })
          .then(function(data) {
            if (data.token) {
              sessionStorage.setItem('qanoun_token', data.token);
              window.location.replace('/');
            } else {
              document.getElementById('root').innerHTML = '<div style="display:flex;align-items:center;justify-content:center;min-height:100vh;background:#09090b;color:#ef4444;font-family:system-ui"><div style="text-align:center"><p>Erreur Google Login</p><p style="font-size:13px;color:#a1a1aa">' + (data.error || 'Erreur inconnue') + '</p><a href="/" style="color:#7c3aed;margin-top:12px;display:inline-block">Retour</a></div></div>';
            }
          })
          .catch(function(err) {
            document.getElementById('root').innerHTML = '<div style="display:flex;align-items:center;justify-content:center;min-height:100vh;background:#09090b;color:#ef4444;font-family:system-ui"><div style="text-align:center"><p>Erreur réseau</p><p style="font-size:13px;color:#a1a1aa">' + err.message + '</p><a href="/" style="color:#7c3aed;margin-top:12px;display:inline-block">Retour</a></div></div>';
          });
          return; // Don't load React yet
        }
      }
    })();
    </script>
  </body>
</html>
