{% extends "base.html" %}
{% block title %}Cookie Policy - DocuElevate{% endblock %}

{% block content %}
<div class="container mx-auto px-4 py-8 max-w-4xl">
  <h1 class="text-4xl font-bold mb-6">Cookie Policy</h1>
  <p class="text-sm text-gray-500 mb-8">Last Updated: {{ build_date|default(current_date|default('May 14, 2024')) }}</p>

  <div class="bg-white shadow rounded-lg p-6 mb-6">
    <h2 class="text-2xl font-semibold mb-4">What Are Cookies</h2>
    <p class="text-gray-700 mb-3">
      Cookies are small text files that are stored on your computer or mobile device when you visit a website. They are widely used to make websites work more efficiently and provide information to the website owners.
    </p>
  </div>

  <div class="bg-white shadow rounded-lg p-6 mb-6">
    <h2 class="text-2xl font-semibold mb-4">How We Use Cookies</h2>
    <p class="text-gray-700 mb-3">
      DocuElevate uses <strong>only strictly necessary session cookies</strong> for the following purpose:
    </p>
    <ul class="list-disc list-inside text-gray-700 ml-4 mb-3">
      <li><strong>Authentication &amp; Session Management:</strong> To identify you when you sign in and maintain your session while you use the application.</li>
    </ul>
    <p class="text-gray-700 mb-3">
      These cookies are mandatory for the proper functioning of our service. Without these cookies, you would be required to log in repeatedly during your browsing session.
    </p>
    <p class="text-gray-700">
      Because these cookies are strictly necessary for the service to function, they are exempt from prior-consent requirements under the EU ePrivacy Directive (Art. 5(3)) and equivalent national implementations. We do not set any optional, analytics, advertising, or tracking cookies.
    </p>
  </div>

  <div class="bg-white shadow rounded-lg p-6 mb-6">
    <h2 class="text-2xl font-semibold mb-4">Cookie Details</h2>
    <div class="overflow-x-auto">
      <table class="min-w-full text-sm text-gray-700 border border-gray-200 rounded">
        <thead class="bg-gray-50">
          <tr>
            <th class="px-4 py-2 text-left font-semibold border-b">Name</th>
            <th class="px-4 py-2 text-left font-semibold border-b">Type</th>
            <th class="px-4 py-2 text-left font-semibold border-b">Purpose</th>
            <th class="px-4 py-2 text-left font-semibold border-b">Duration</th>
          </tr>
        </thead>
        <tbody>
          <tr class="border-b">
            <td class="px-4 py-2 font-mono">session</td>
            <td class="px-4 py-2">Strictly Necessary</td>
            <td class="px-4 py-2">Maintains your authenticated session; required for login to function.</td>
            <td class="px-4 py-2">Session (deleted on browser close or logout)</td>
          </tr>
          <tr>
            <td class="px-4 py-2 font-mono">cookieNoticeDismissed</td>
            <td class="px-4 py-2">Strictly Necessary</td>
            <td class="px-4 py-2">Stores your acknowledgement of the cookie notice so it is not shown repeatedly (stored in localStorage, not a cookie).</td>
            <td class="px-4 py-2">Persistent (browser localStorage)</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>

  <div class="bg-white shadow rounded-lg p-6 mb-6">
    <h2 class="text-2xl font-semibold mb-4">No Third-Party Cookies</h2>
    <p class="text-gray-700 mb-3">
      DocuElevate does not use any third-party cookies, tracking cookies, advertising cookies, or analytics cookies. We respect your privacy and only implement the minimum cookies required for our service to function.
    </p>
    <p class="text-gray-700">
      For more information about how we handle your data, please see our <a href="/privacy" class="text-blue-600 hover:underline">Privacy Notice</a>.
    </p>
  </div>

  <div class="bg-white shadow rounded-lg p-6 mb-6">
    <h2 class="text-2xl font-semibold mb-4">Managing Cookies</h2>
    <p class="text-gray-700 mb-3">
      Most web browsers allow you to control cookies through their settings. However, blocking or deleting our session cookies will prevent DocuElevate from functioning, as user authentication relies on these cookies.
    </p>
    <p class="text-gray-700 mb-3">
      You may also clear the cookie notice acknowledgement stored in your browser's localStorage at any time via your browser's developer tools (Application &rarr; Local Storage).
    </p>
    <p class="text-gray-700">
      This Cookie Policy is part of and incorporated into our <a href="/terms" class="text-blue-600 hover:underline">Terms of Service</a> and <a href="/privacy" class="text-blue-600 hover:underline">Privacy Notice</a>.
    </p>
  </div>
</div>
{% endblock %}
