Calm Care Companion™ - Meds

<section id="ppp-uploader-bridge" style="--gold:#D4AF37; --ink:#222; --bg:#F7F5FB;">
  <div style="max-width:540px;margin:0 auto;padding:40px 20px;text-align:center;background:var(--bg);border-radius:16px;">
    <!-- Logo (swap src to your theme asset if needed) -->
    <img src="{{ 'logo.png' | asset_url }}" alt="Petit Papillon Papier" style="height:44px;width:auto;margin-bottom:14px;">

    <h1 style="font-family:Merriweather,Georgia,serif;font-size:22px;line-height:1.25;margin:0 0 12px;color:var(--ink);">
      Petit Papillon Archive™
    </h1>

    <p style="margin:0 0 18px;color:rgba(0,0,0,.7);font-size:14px;">
      Scan to your Google Drive
    </p>

    <a id="ppp-go"
       href="#"
       style="display:inline-block;background:var(--gold);color:#000;text-decoration:none;
              padding:14px 18px;border-radius:14px;font-weight:700;min-width:260px;">
      Continue to Uploader
    </a>

    <p id="ppp-note" style="margin-top:10px;font-size:12px;color:rgba(0,0,0,.6);">
      If nothing happens automatically, tap the button.
    </p>
  </div>

  <script>
    (function () {
      // --- Configure your app start URL (Next.js route that begins the QR upload intent) ---
      var APP_START = "YOUR_APP_START_URL"; // e.g., https://app.petit-papillon-papier.com/start

      // Carry through any ?qr=LETTER from the Shopify URL so the app knows which flow this came from.
      var params = new URLSearchParams(location.search);
      var qr = params.get("qr");
      var dest = APP_START + (qr ? ("?qr=" + encodeURIComponent(qr)) : "");

      var btn = document.getElementById("ppp-go");
      btn.href = dest;

      // Auto-forward quickly to minimise time on this page
      var redirected = false;
      function go() { if (!redirected) { redirected = true; location.href = dest; } }

      // 1) Try near-immediate redirect for snappy UX
      setTimeout(go, 800);

      // 2) Ensure tapping the button always works
      btn.addEventListener("click", function (e) {
        e.preventDefault(); go();
      }, false);
    })();
  </script>
</section>