{% extends "framework_modern.html" %}
{% load static %}

{% block main_content %}
  <div class="mx-auto max-w-4xl px-4 py-8">
    <!-- Breadcrumbs -->
    <div class="breadcrumbs mb-4 text-sm">
      <ul>
        <li><a href="/">Home</a></li>
        <li>Cookie Policy</li>
      </ul>
    </div>

    <!-- Main Content -->
    <div class="bg-base-100 rounded-lg p-8 shadow-xl">
      <h1 class="mb-6 text-4xl font-bold">Cookie Policy</h1>

      <div class="prose max-w-none">
        <p class="mb-6 text-lg">
          This Cookie Policy explains how enviPath uses cookies and similar
          technologies to recognize you when you visit our platform. It explains
          what these technologies are and why we use them.
        </p>

        <h2 class="mt-8 mb-4 text-2xl font-semibold">1. What Are Cookies?</h2>
        <p class="mb-4">
          Cookies are small data files that are placed on your computer or
          mobile device when you visit a website. Cookies are widely used by
          website owners to make their websites work, or to work more
          efficiently, as well as to provide reporting information.
        </p>

        <h2 class="mt-8 mb-4 text-2xl font-semibold">2. Why We Use Cookies</h2>
        <p class="mb-4">We use cookies for several reasons:</p>
        <ul class="mb-4 list-inside list-disc space-y-2">
          <li>
            <strong>Essential Cookies:</strong> Required for the platform to
            function properly
          </li>
          <li>
            <strong>Analytics Cookies:</strong> Help us understand how visitors
            interact with our platform (where enabled)
          </li>
          <li>
            <strong>Functional Cookies:</strong> Enable enhanced functionality
            and personalization
          </li>
          <li>
            <strong>Security Cookies:</strong> Authenticate users and help
            prevent fraudulent use
          </li>
        </ul>

        <h2 class="mt-8 mb-4 text-2xl font-semibold">
          3. Legal Basis and Consent
        </h2>
        <p class="mb-4">
          Essential cookies are used because they are necessary for the Platform
          to operate securely and reliably.
        </p>
        <p class="mb-4">
          Where required by applicable law,
          <strong>non-essential cookies</strong> are only set after you provide
          your consent. You can withdraw or change your consent at any time
          using any cookie management tools provided on the Platform (if
          available) and/or through your browser settings.
        </p>

        <h2 class="mt-8 mb-4 text-2xl font-semibold">
          4. Types of Cookies We Use
        </h2>

        <div class="mb-6 overflow-x-auto">
          <table class="table-zebra table w-full">
            <thead>
              <tr>
                <th>Cookie Type</th>
                <th>Purpose</th>
                <th>Duration</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td><strong>Session Cookies</strong></td>
                <td>Maintain your login state and session data</td>
                <td>Session</td>
              </tr>
              <tr>
                <td><strong>CSRF Token</strong></td>
                <td>Security protection against cross-site request forgery</td>
                <td>Session</td>
              </tr>
              <tr>
                <td><strong>Matomo Analytics</strong></td>
                <td>Measure usage patterns and improve our services</td>
              </tr>
              <tr>
                <td><strong>OAuth Tokens</strong></td>
                <td>Authentication and authorization for API access</td>
                <td>Varies (typically session-based or time-limited)</td>
              </tr>
            </tbody>
          </table>
        </div>

        <h2 class="mt-8 mb-4 text-2xl font-semibold">5. Matomo Analytics</h2>
        <p class="mb-4">
          We use Matomo, an open-source web analytics platform, to help us
          understand how visitors use enviPath. Where enabled, Matomo may use
          cookies and similar technologies to collect standard internet log
          information and information about visitor behavior patterns.
        </p>
        <p class="mb-4">
          Where required by law, Matomo analytics cookies are only activated
          after user consent. We configure Matomo to minimise data collection
          and, where applicable, to anonymise IP addresses. Analytics data is
          used solely for internal analytics, platform improvement, and system
          monitoring.
        </p>
        <p class="mb-4">We analyze this information to:</p>
        <ul class="mb-4 list-inside list-disc space-y-2">
          <li>Understand how users interact with our platform</li>
          <li>Identify popular features and areas for improvement</li>
          <li>Detect and diagnose technical issues</li>
          <li>Generate reports on platform usage</li>
        </ul>

        <h2 class="mt-8 mb-4 text-2xl font-semibold">6. Third-Party Cookies</h2>
        <p class="mb-4">
          Some features of the Platform may integrate third-party services.
          These third parties may set their own cookies and process information
          independently in accordance with their own privacy and cookie
          policies. We do not control the operation of third-party cookies and
          recommend reviewing the relevant third-party policies for further
          information.
        </p>
        <ul class="mb-4 list-inside list-disc space-y-2">
          <li>
            <strong>Discourse Community:</strong> For our community forums at
            community.envipath.org
          </li>
          <li>
            <strong>External CDNs:</strong> For loading libraries and assets
            (for example, jQuery and Font Awesome)
          </li>
        </ul>

        <h2 class="mt-8 mb-4 text-2xl font-semibold">7. Managing Cookies</h2>
        <p class="mb-4">
          Most web browsers allow you to control cookies through their settings.
          However, if you limit the ability of websites to set cookies, you may
          worsen your overall user experience, as some features may not function
          properly.
        </p>

        <div class="alert alert-warning mb-6">
          <svg
            xmlns="http://www.w3.org/2000/svg"
            class="h-6 w-6 shrink-0 stroke-current"
            fill="none"
            viewBox="0 0 24 24"
          >
            <path
              stroke-linecap="round"
              stroke-linejoin="round"
              stroke-width="2"
              d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
            />
          </svg>
          <span
            ><strong>Note:</strong> Disabling essential cookies may prevent you
            from using certain features of enviPath.</span
          >
        </div>

        <h3 class="mt-6 mb-3 text-xl font-semibold">Browser Settings</h3>
        <p class="mb-4">You can manage cookies in your browser settings:</p>
        <ul class="mb-4 list-inside list-disc space-y-2">
          <li>
            <strong>Chrome:</strong> Settings → Privacy and security → Cookies
            and other site data
          </li>
          <li>
            <strong>Firefox:</strong> Options → Privacy & Security → Cookies and
            Site Data
          </li>
          <li>
            <strong>Safari:</strong> Preferences → Privacy → Cookies and website
            data
          </li>
          <li>
            <strong>Edge:</strong> Settings → Cookies and site permissions →
            Cookies and site data
          </li>
        </ul>

        <h2 class="mt-8 mb-4 text-2xl font-semibold">
          8. Updates to This Policy
        </h2>
        <p class="mb-4">
          We may update this Cookie Policy from time to time to reflect changes
          in technology, legislation, or our operations. Please check this page
          regularly for updates. Changes take effect when posted.
        </p>

        <h2 class="mt-8 mb-4 text-2xl font-semibold">9. Contact Us</h2>
        <p class="mb-4">
          If you have questions about our use of cookies, please
          <a href="/contact" class="link link-primary">contact us</a>.
        </p>

        <div class="alert alert-info mt-8">
          <svg
            xmlns="http://www.w3.org/2000/svg"
            fill="none"
            viewBox="0 0 24 24"
            class="h-6 w-6 shrink-0 stroke-current"
          >
            <path
              stroke-linecap="round"
              stroke-linejoin="round"
              stroke-width="2"
              d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
            ></path>
          </svg>
          <span>version: 1, Last updated: January 2026</span>
        </div>
      </div>
    </div>
  </div>
{% endblock main_content %}
