@model PublicPageViewModel
@{
    ViewData["Title"] = "Privacy Policy";
    ViewData["ShellClass"] = "marketing-shell";
}

<article class="marketing-home public-info-page">
    <section class="public-hero">
        <div class="marketing-container public-hero__inner">
            <p class="marketing-eyebrow">Privacy</p>
            <h1>Privacy Policy</h1>
            <p class="marketing-lead">Your stories remain yours. We collect only what we need to run PlotDirector.</p>
            <p class="public-updated">Last updated: @Model.LastUpdated</p>
        </div>
    </section>

    <section class="public-content-section">
        <div class="marketing-container public-policy">

            <section>
                <h2>1. Introduction</h2>
                <p>PlotDirector respects your privacy and is committed to protecting your personal information.</p>
                <p>This Privacy Policy explains what information we collect, how we use it, how long we keep it, and what rights you have.</p>
            </section>

            <section>
                <h2>2. Information We Collect</h2>
                <p>We collect only the information needed to provide, secure, and manage the PlotDirector service.</p>
                <p>This may include:</p>
                <ul>
                    <li>Your email address, used for login, account security, service messages, and subscription communication</li>
                    <li>Your display name, which you choose and may change</li>
                    <li>Account authentication information, such as password hashes, security tokens, two-factor authentication settings, and recovery information</li>
                    <li>Subscription status information, such as your current plan, renewal status, trial status, and payment status</li>
                    <li>Content you choose to create, upload, or store within PlotDirector, including projects, books, chapters, scenes, characters, locations, timelines, notes, images, and related writing material</li>
                    <li>Basic technical information required to operate and secure the service, such as IP addresses, login activity, browser information, error logs, and security logs</li>
                </ul>
                <p>We do not intentionally collect phone numbers, postal addresses, dates of birth, demographic information, or unnecessary personal information.</p>
            </section>

            <section>
                <h2>3. Information We Do Not Collect</h2>
                <p>We do not use Google Analytics or third-party advertising trackers.</p>
                <p>We do not sell your personal information.</p>
                <p>We do not track you across other websites.</p>
                <p>We do not store your full payment card details, billing address, or payment method information on our servers. Payment information is handled by Stripe.</p>
            </section>

            <section>
                <h2>4. How We Use Your Information</h2>
                <p>We use your information to:</p>
                <ul>
                    <li>Create and manage your account</li>
                    <li>Allow you to log in securely</li>
                    <li>Provide and maintain the PlotDirector service</li>
                    <li>Store and display the content you create within your account</li>
                    <li>Manage subscriptions, trials, account limits, and billing status</li>
                    <li>Send important service, account, security, and subscription messages</li>
                    <li>Respond to support requests</li>
                    <li>Protect the service from abuse, unauthorised access, fraud, scraping, and security threats</li>
                    <li>Diagnose faults, investigate errors, and improve reliability</li>
                    <li>Comply with legal obligations</li>
                </ul>
            </section>

            <section>
                <h2>5. Lawful Bases for Processing</h2>
                <p>We process personal information only where we have a lawful basis to do so.</p>
                <p>Depending on the context, this may include:</p>
                <ul>
                    <li><strong>Contract:</strong> to provide the PlotDirector service you have requested</li>
                    <li><strong>Legitimate interests:</strong> to secure, maintain, support, and improve the service</li>
                    <li><strong>Legal obligation:</strong> where we need to keep or disclose information to comply with the law</li>
                    <li><strong>Consent:</strong> where we specifically ask for your permission</li>
                </ul>
            </section>

            <section>
                <h2>6. Your Content</h2>
                <p>You retain ownership of all stories, manuscripts, notes, characters, locations, timelines, images, and other creative content you create or store in PlotDirector.</p>
                <p>We do not claim ownership of your creative work.</p>
                <p>We access user content only where necessary to provide the service, maintain security, investigate technical issues, respond to support requests, comply with legal obligations, or where you have asked us to help with a specific issue.</p>
            </section>

            <section>
                <h2>7. Payments</h2>
                <p>Payments are processed securely by Stripe.</p>
                <p>PlotDirector does not store your full card number, payment card security code, billing address, or full payment method details on our servers.</p>
                <p>Stripe may provide us with limited subscription and payment status information so that we can manage your account, such as whether a payment succeeded, failed, or whether a subscription is active, cancelled, or past due.</p>
                <p>Your use of Stripe may be subject to Stripe's own terms and privacy policy.</p>
            </section>

            <section>
                <h2>8. Cookies and Local Storage</h2>
                <p>PlotDirector uses essential cookies required for login, authentication, security, and account access.</p>
                <p>These cookies are necessary for the service to work and are not used for advertising or tracking.</p>
                <p>PlotDirector may also use browser local storage or similar browser storage to remember functional preferences, such as dismissed alerts, interface settings, or other choices that improve the user experience.</p>
                <p>We do not use advertising cookies, analytics cookies, or third-party tracking cookies.</p>
            </section>

            <section>
                <h2>9. Data Sharing</h2>
                <p>We do not sell your personal information.</p>
                <p>We share information only where necessary to operate the service, manage payments, comply with the law, protect the service, or respond to your requests.</p>
                <p>This may include sharing limited information with:</p>
                <ul>
                    <li>Payment providers, such as Stripe</li>
                    <li>Email delivery providers used to send account, security, or service messages</li>
                    <li>Hosting, infrastructure, or security providers used to operate the service</li>
                    <li>Professional advisers, regulators, or authorities where required by law</li>
                </ul>
            </section>

            <section>
                <h2>10. Data Retention</h2>
                <p>We keep personal information only for as long as needed to provide the service, manage your account, comply with legal obligations, resolve disputes, and maintain security.</p>
                <p>If your subscription ends, is cancelled, expires, or your account becomes inactive, we may retain your account and content for a limited period to allow for possible reactivation or administration.</p>
                <p>However, we are not obliged to retain inactive or expired account data indefinitely. We may delete account data at our discretion, and in any event may delete it after three months from the date your subscription ends or your account becomes inactive.</p>
                <p>Some limited records may be retained for longer where required for legal, accounting, fraud prevention, security, or dispute resolution purposes.</p>
            </section>

            <section>
                <h2>11. Backups</h2>
                <p>We may maintain system backups for disaster recovery, service continuity, and security purposes.</p>
                <p>These backups are intended to help recover the service in the event of serious technical failure. They are not intended as a user-level restore service for accidental deletion or individual mistakes.</p>
                <p>You are responsible for exporting and maintaining your own independent backups of important work.</p>
            </section>

            <section>
                <h2>12. Security</h2>
                <p>We use reasonable technical and organisational measures to protect personal information and user content.</p>
                <p>However, no online service can guarantee complete security. You are responsible for keeping your password, email account, and two-factor authentication details secure.</p>
                <p>If you believe your account has been compromised, please contact us as soon as possible.</p>
            </section>

            <section>
                <h2>13. Your Rights</h2>
                <p>Depending on your location and applicable law, you may have rights over your personal information, including the right to:</p>
                <ul>
                    <li>Access the personal information we hold about you</li>
                    <li>Ask us to correct inaccurate information</li>
                    <li>Ask us to delete your personal information</li>
                    <li>Ask us to restrict how we use your information</li>
                    <li>Object to certain uses of your information</li>
                    <li>Request a copy of your information in a portable format</li>
                    <li>Withdraw consent where processing is based on consent</li>
                </ul>
                <p>To exercise these rights, please contact us using the details below.</p>
            </section>

            <section>
                <h2>14. Account Deletion</h2>
                <p>You may request deletion of your account and associated personal information.</p>
                <p>Account deletion may permanently remove your projects, books, chapters, scenes, characters, locations, timelines, notes, images, and other stored content.</p>
                <p>Some limited information may be retained where required for legal, accounting, fraud prevention, security, or dispute resolution purposes.</p>
            </section>

            <section>
                <h2>15. Children's Privacy</h2>
                <p>PlotDirector is not intended for children.</p>
                <p>You must not create an account if you are under 18 unless you have permission from a parent or guardian.</p>
                <p>If we become aware that an account has been created by a child without appropriate permission, we may delete the account.</p>
            </section>

            <section>
                <h2>16. International Access</h2>
                <p>PlotDirector is operated from the United Kingdom.</p>
                <p>If you access the service from outside the United Kingdom, your information may be processed in the United Kingdom or by service providers in other countries where necessary to provide the service.</p>
            </section>

            <section>
                <h2>17. Changes to This Policy</h2>
                <p>We may update this Privacy Policy from time to time.</p>
                <p>When we make changes, we will update the "Last updated" date shown on this page.</p>
                <p>Where changes are significant, we may provide additional notice by email, account notification, or another reasonable method.</p>
            </section>

            <section>
                <h2>18. Complaints</h2>
                <p>If you have concerns about how we use your personal information, please contact us first so that we can try to resolve the issue.</p>
                <p>You may also have the right to complain to your local data protection authority. In the United Kingdom, this is the Information Commissioner's Office.</p>
            </section>

            <section>
                <h2>19. Contact</h2>
                <p>For privacy-related enquiries, please contact:</p>
                <p><a href="mailto:@Model.SupportEmail">@Model.SupportEmail</a></p>
            </section>

        </div>
    </section>
</article>
