<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Security-Policy" content="default-src &#39;self&#39;; script-src &#39;self&#39; &#39;sha256-YA2RSn2l6VE0ePcnM8yOyXmNcZ/kfc45c86+w9bFA58=&#39; &#39;sha256-tZXSt7XGY2JRWV36TlohpDdUWTjUFlQaL/s9i/JV118=&#39; https://js.stripe.com https://*.supabase.co; style-src &#39;self&#39; &#39;unsafe-inline&#39; https://fonts.googleapis.com; font-src &#39;self&#39; https://fonts.gstatic.com data:; img-src &#39;self&#39; data: blob: https:; connect-src &#39;self&#39; https://*.supabase.co wss://*.supabase.co https://api.stripe.com https://api.zippopotam.us https://vpic.nhtsa.dot.gov; frame-src https://js.stripe.com https://checkout.stripe.com; object-src &#39;none&#39;; base-uri &#39;self&#39;; form-action &#39;self&#39;; upgrade-insecure-requests">
    <meta http-equiv="X-Content-Type-Options" content="nosniff">
    <meta http-equiv="X-Frame-Options" content="DENY">
    <meta http-equiv="X-XSS-Protection" content="1; mode=block">
    <meta http-equiv="Referrer-Policy" content="strict-origin-when-cross-origin">
    <meta http-equiv="Permissions-Policy" content="camera=(), microphone=(), geolocation=(), payment=()">

    <meta charset="UTF-8" />
    
    <!-- Enhanced viewport meta for optimal mobile experience -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, minimum-scale=0.5, user-scalable=yes, viewport-fit=cover" />
    
    <!-- Mobile-specific meta tags for better UX -->
    <meta name="mobile-web-app-capable" content="yes" />
    <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="DAS Board" />

    <!-- Theme color for mobile browsers -->
    <meta name="theme-color" content="#3b82f6" />
    <meta name="msapplication-navbutton-color" content="#3b82f6" />
    
    <!-- Enhanced favicon setup for mobile -->
    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
    <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
    <!-- PWA manifest is injected dynamically based on route - see script below -->

    <!-- iOS Add to Home Screen fix: Inject appropriate manifest based on current page -->
    <!-- No manifest in HTML = Safari saves actual URL for Add to Home Screen -->
    <script>
      (function() {
        var path = window.location.pathname;
        var manifestUrl = null;

        // Dashboard routes get the main manifest (opens to /)
        if (path.startsWith('/dashboard') || path.startsWith('/dealership/') ||
            path.startsWith('/group-admin') || path.startsWith('/single-finance')) {
          manifestUrl = '/manifest.json';
        }
        // Auth page gets auth-specific manifest (opens to /auth)
        else if (path === '/auth' || path.startsWith('/auth/')) {
          manifestUrl = '/manifest-auth.json';
        }
        // Sales portal gets its own manifest
        else if (path === '/sales-portal' || path.startsWith('/sales-portal/')) {
          manifestUrl = '/manifest-sales.json';
        }
        // All other pages (marketing, signup, etc.) - NO manifest
        // This ensures Safari saves the actual URL when adding to home screen

        if (manifestUrl) {
          var link = document.createElement('link');
          link.rel = 'manifest';
          link.href = manifestUrl;
          link.id = 'pwa-manifest';
          document.head.appendChild(link);
        }
      })();
    </script>

    <!-- Preload critical fonts for mobile performance -->
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    
    <!-- DNS prefetch for better mobile loading -->
    <link rel="dns-prefetch" href="//fonts.googleapis.com" />
    <link rel="dns-prefetch" href="//fonts.gstatic.com" />
    
    <!-- Primary SEO Meta Tags -->
    <meta name="description" content="Transform your dealership with The DAS Board - Real-time analytics dashboards for sales teams, finance managers, and general managers. Track performance, boost profits, and optimize operations. 500+ dealerships trust us. Start your free 30-day trial." />
    <meta name="keywords" content="dealership management software, automotive CRM, car dealer software, sales dashboard, finance manager dashboard, dealership analytics, auto dealership performance, sales tracking software, F&I analytics, GM dashboard, sales manager tools, dealership KPIs, automotive sales software, dealer group management, vehicle sales tracking" />
    <meta name="author" content="The DAS Board" />
    <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1" />
    <meta name="googlebot" content="index, follow" />
    <meta name="bingbot" content="index, follow" />

    <!-- Canonical URL -->
    <link rel="canonical" href="https://thedasboard.com/" />

    <!-- Language and Regional -->
    <meta name="language" content="en-US" />
    <meta name="geo.region" content="US" />
    <meta name="geo.placename" content="United States" />
    <link rel="alternate" hreflang="en" href="https://thedasboard.com/" />
    <link rel="alternate" hreflang="es" href="https://thedasboard.com/?lang=es" />
    <link rel="alternate" hreflang="fr" href="https://thedasboard.com/?lang=fr" />
    <link rel="alternate" hreflang="de" href="https://thedasboard.com/?lang=de" />
    <link rel="alternate" hreflang="x-default" href="https://thedasboard.com/" />

    <!-- Open Graph / Facebook -->
    <meta property="og:type" content="website" />
    <meta property="og:url" content="https://thedasboard.com/" />
    <meta property="og:title" content="The DAS Board - Dealership Analytics & Sales Management Software" />
    <meta property="og:description" content="Transform your dealership with real-time analytics dashboards. Track sales, manage finance teams, and boost profitability. 500+ dealerships trust The DAS Board." />
    <meta property="og:image" content="https://thedasboard.com/og-image.png" />
    <meta property="og:image:width" content="1200" />
    <meta property="og:image:height" content="630" />
    <meta property="og:image:alt" content="The DAS Board - Dealership Analytics Dashboard" />
    <meta property="og:site_name" content="The DAS Board" />
    <meta property="og:locale" content="en_US" />

    <!-- Twitter Card -->
    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:url" content="https://thedasboard.com/" />
    <meta name="twitter:title" content="The DAS Board - Dealership Analytics & Sales Management Software" />
    <meta name="twitter:description" content="Transform your dealership with real-time analytics dashboards. Track sales, manage finance teams, and boost profitability. Start your free 30-day trial." />
    <meta name="twitter:image" content="https://thedasboard.com/twitter-image.png" />
    <meta name="twitter:image:alt" content="The DAS Board - Dealership Analytics Dashboard" />
    <meta name="twitter:site" content="@thedasboard" />
    <meta name="twitter:creator" content="@thedasboard" />

    <!-- Additional SEO Tags -->
    <meta name="rating" content="general" />
    <meta name="distribution" content="global" />
    <meta name="revisit-after" content="7 days" />
    <meta name="coverage" content="worldwide" />
    <meta name="target" content="all" />
    <meta name="HandheldFriendly" content="True" />
    
    <!-- Performance hints for mobile -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="date=no" />
    <meta name="format-detection" content="address=no" />
    <meta name="format-detection" content="email=no" />
    
    <!-- CSP is set via HTTP header in netlify.toml (authoritative) and injected by vite build plugin -->
    <meta http-equiv="X-Content-Type-Options" content="nosniff" />
    <!-- X-Frame-Options should be set as HTTP header, not meta tag -->
    <meta http-equiv="X-XSS-Protection" content="1; mode=block" />
    <meta http-equiv="Strict-Transport-Security" content="max-age=31536000; includeSubDomains; preload" />
    <meta http-equiv="Permissions-Policy" content="
      camera=(),
      microphone=(),
      geolocation=(),
      payment=(self),
      usb=(),
      magnetometer=(),
      gyroscope=(),
      accelerometer=()
    " />
    
    <!-- Disable automatic translation on mobile -->
    <meta name="google" content="notranslate" />
    
    <!-- Mobile browser UI customization -->
    <meta name="apple-touch-fullscreen" content="yes" />
    <meta name="apple-mobile-web-app-orientations" content="portrait landscape" />
    
    <!-- Performance optimization meta tags -->
    <meta name="referrer" content="strict-origin-when-cross-origin" />
    
    <title>The DAS Board - Dealership Analytics & Sales Management Software | Free Trial</title>
    
    <!-- Inline critical CSS for mobile performance (optional) -->
    <style>
      /* Critical CSS for mobile loading performance */
      html {
        font-family: system-ui, -apple-system, sans-serif;
        line-height: 1.6;
        -webkit-text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
        overflow-y: auto;
        height: 100%;
      }
      
      body {
        margin: 0;
        padding: 0;
        background-color: #f9fafb;
        color: #111827;
        overflow-x: hidden;
        overflow-y: auto;
        /* Use dvh (dynamic viewport height) for iOS Safari, fallback to vh */
        min-height: 100vh;
        min-height: 100dvh;
      }
      
      /* Loading spinner for mobile */
      .loading-spinner {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 40px;
        height: 40px;
        border: 3px solid #e5e7eb;
        border-top: 3px solid #3b82f6;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        z-index: 9999;
      }
      
      @keyframes spin {
        0% { transform: translate(-50%, -50%) rotate(0deg); }
        100% { transform: translate(-50%, -50%) rotate(360deg); }
      }
      
      /* Hide loading spinner when app loads */
      .app-loaded .loading-spinner {
        display: none;
      }
      
      /* Mobile-safe viewport units */
      .full-height {
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height for mobile */
        overflow-y: auto;
        overflow-x: hidden;
      }

      /* Fix Tailwind's min-h-screen on iOS Safari */
      .min-h-screen {
        min-height: 100vh;
        min-height: 100dvh;
        /* Also use JS-calculated vh for older iOS versions */
        min-height: calc(var(--vh, 1vh) * 100);
      }

      /* Bottom safe area for iOS home indicator */
      .pb-safe {
        padding-bottom: env(safe-area-inset-bottom, 0px);
      }

      .pt-safe {
        padding-top: env(safe-area-inset-top, 0px);
      }
      
      /* Prevent horizontal scroll on mobile */
      .no-scroll-x {
        overflow-x: hidden;
        max-width: 100vw;
      }

      /* PWA Standalone Mode - iOS Home Screen Launch */
      @media (display-mode: standalone) {
        html, body {
          height: 100%;
          min-height: 100vh;
          min-height: 100dvh;
          min-height: -webkit-fill-available;
          overscroll-behavior: none;
        }
        #root {
          min-height: 100%;
          min-height: 100vh;
          min-height: 100dvh;
        }
      }
      
      /* Touch-friendly tap targets - only for interactive elements in forms */
      input, select, textarea {
        min-height: 44px;
        touch-action: manipulation;
      }
      
      /* Enhanced focus visibility for mobile */
      *:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
      }
      
      @media (hover: none) and (pointer: coarse) {
        *:focus {
          outline-width: 3px;
          outline-offset: 3px;
        }
      }
    </style>
    <script type="module" crossorigin src="/assets/index.RdiA5DcM.js"></script>
    <link rel="stylesheet" crossorigin href="/assets/styles/index.Cvxln2yU.css">
  </head>
  <body class="no-scroll-x">
    <!-- Loading spinner for mobile -->
    <div class="loading-spinner" id="loading-spinner"></div>
    
    <!-- Main app container with mobile optimizations -->
    <div id="root" class="full-height"></div>
    
    <!-- Module script with mobile performance optimizations -->
    
    <!-- Mobile-specific JavaScript optimizations -->
    <script>
      // Remove loading spinner when app loads
      window.addEventListener('load', function() {
        document.body.classList.add('app-loaded');
        const spinner = document.getElementById('loading-spinner');
        if (spinner) {
          spinner.style.display = 'none';
        }
      });
      
      // Double-tap zoom prevention removed - was blocking button clicks
      
      // Mobile viewport height fix for iOS
      function setMobileVH() {
        let vh = window.innerHeight * 0.01;
        document.documentElement.style.setProperty('--vh', `${vh}px`);
      }
      
      // Set initial mobile viewport height
      setMobileVH();
      
      // Update on resize and orientation change
      window.addEventListener('resize', setMobileVH);
      window.addEventListener('orientationchange', function() {
        setTimeout(setMobileVH, 100);
      });
      
      // Performance optimization: Preload critical resources
      if ('connection' in navigator) {
        const connection = navigator.connection;
        // Only preload on fast connections
        if (connection.effectiveType === '4g') {
          // Add preload logic here if needed
        }
      }
      
      // Mobile-specific error handling
      window.addEventListener('error', function(e) {
        console.error('Mobile app error:', e.error);
        // Add mobile-specific error reporting here
      });
      
      // Service Worker registration disabled until sw.js is created
      // if ('serviceWorker' in navigator) {
      //   window.addEventListener('load', function() {
      //     navigator.serviceWorker.register('/sw.js')
      //       .then(function(registration) {
      //         console.log('SW registered: ', registration);
      //       })
      //       .catch(function(registrationError) {
      //         console.log('SW registration failed: ', registrationError);
      //       });
      //   });
      // }
      
      // Mobile app install prompt handling
      let deferredPrompt;
      window.addEventListener('beforeinstallprompt', (e) => {
        e.preventDefault();
        deferredPrompt = e;
        // Show install button or banner
      });
      
      // Handle app install
      window.addEventListener('appinstalled', (evt) => {
        console.log('App was installed.');
      });
      
      // Mobile keyboard handling
      if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
        // Handle virtual keyboard on mobile
        const viewport = document.querySelector('meta[name="viewport"]');
        
        function handleViewportChange() {
          if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') {
            viewport.setAttribute('content', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0');
          } else {
            viewport.setAttribute('content', 'width=device-width, initial-scale=1.0, maximum-scale=5.0, minimum-scale=0.5, user-scalable=yes, viewport-fit=cover');
          }
        }
        
        document.addEventListener('focusin', handleViewportChange);
        document.addEventListener('focusout', handleViewportChange);
      }
    </script>
  </body>
</html>