import type { MarketingSlug } from "@/lib/routes";

export type LegalSlug = Extract<MarketingSlug, "privacy" | "terms" | "security">;

export type LegalSection = {
  id: string;
  title: string;
  paragraphs: string[];
  bullets?: string[];
};

export const legalPages: Record<LegalSlug, { badge: string; sections: LegalSection[] }> = {
  privacy: {
    badge: "Privacy and transparency",
    sections: [
      { id: "introduction", title: "Introduction", paragraphs: ["PureSaaS provides software for real estate teams, builders, and housing societies. This policy explains how we collect, use, protect, and retain information when you visit our website, request a demo, register, or use our services."] },
      { id: "information", title: "Information we collect", paragraphs: ["We collect information that you submit directly and limited technical information required to operate and improve the website."], bullets: ["Contact details such as name, email address, and phone number", "Account and company details submitted during registration", "Demo preferences, requested dates, and enquiry descriptions", "Basic device, browser, and website usage information"] },
      { id: "use", title: "How we use information", paragraphs: ["We use information only for legitimate product, support, security, and business purposes."], bullets: ["Respond to enquiries and schedule product demonstrations", "Create and support product accounts", "Improve workflows, reliability, and customer experience", "Prevent misuse and protect business information"] },
      { id: "forms", title: "Demo, register, and login data", paragraphs: ["Demo requests are used to arrange a relevant walkthrough. Registration details are used to create the requested product account. Login information is used only to authenticate access. Product identity is inferred from the selected product route where applicable."] },
      { id: "cookies", title: "Cookies and analytics", paragraphs: ["We may use essential cookies for language preferences, session continuity, and security. If analytics tools are added, they will be used to understand aggregate website usage and improve the experience."] },
      { id: "sharing", title: "Data sharing", paragraphs: ["We do not sell submitted personal information. We may share information with carefully selected service providers only when necessary to deliver, secure, or support the service, or when required by law."] },
      { id: "security", title: "Data security", paragraphs: ["We apply practical safeguards such as secure transport, access controls, validation, and operational monitoring. No online system can guarantee absolute security, so we review and improve controls as the platform evolves."] },
      { id: "rights", title: "Your rights", paragraphs: ["You may request access, correction, or deletion of eligible personal information. You may also ask questions about how information is handled by contacting our team."] },
      { id: "retention", title: "Data retention", paragraphs: ["We retain information only for as long as reasonably necessary for the purpose it was collected, contractual obligations, security, support, and applicable legal requirements."] },
      { id: "contact", title: "Contact information", paragraphs: ["For privacy questions or requests, contact hello@puresaas.in. We will review your request and respond within a reasonable timeframe."] },
    ],
  },
  terms: {
    badge: "Clear service expectations",
    sections: [
      { id: "acceptance", title: "Acceptance of terms", paragraphs: ["By accessing the PureSaaS website or using our services, you agree to these terms. If you use PureSaaS on behalf of an organization, you confirm that you are authorized to accept these terms for that organization."] },
      { id: "platform", title: "Use of the platform", paragraphs: ["PureSaaS provides workflow software for supported business use cases. Product scope, implementation details, and available modules may vary by product and subscription."] },
      { id: "accounts", title: "Account responsibility", paragraphs: ["You are responsible for providing accurate registration information, protecting account credentials, and ensuring that authorized users follow appropriate security practices."] },
      { id: "demo", title: "Demo and trial usage", paragraphs: ["A demo or trial is provided for evaluation. Availability, duration, and included functionality may be limited or adjusted based on the product and implementation requirements."] },
      { id: "subscriptions", title: "Product subscriptions", paragraphs: ["Subscription scope, users, modules, support levels, and implementation services are confirmed in the applicable commercial proposal or agreement."] },
      { id: "billing", title: "Payment and billing", paragraphs: ["Fees, billing cycles, taxes, renewals, and payment terms are governed by the applicable order form or commercial agreement. Certain features may remain unavailable until required payments are completed."] },
      { id: "prohibited", title: "Prohibited use", paragraphs: ["You must not misuse PureSaaS or attempt to interfere with its operation."], bullets: ["Attempt unauthorized access or security testing without written permission", "Upload malicious code or disrupt platform availability", "Use the platform for unlawful, misleading, or abusive activity", "Copy, resell, or reverse engineer protected platform functionality"] },
      { id: "ip", title: "Intellectual property", paragraphs: ["PureSaaS and its software, branding, design, and documentation remain protected by applicable intellectual property laws. Your organization retains ownership of the business data it submits."] },
      { id: "liability", title: "Limitation of liability", paragraphs: ["To the extent permitted by law, PureSaaS is not liable for indirect, incidental, or consequential losses. Any specific service commitments are governed by the applicable written agreement."] },
      { id: "termination", title: "Termination", paragraphs: ["Access may be suspended or terminated for material breach, non-payment, security risk, or unlawful use. Data handling following termination is governed by the applicable agreement and legal requirements."] },
      { id: "changes", title: "Changes to terms", paragraphs: ["We may update these terms as products, regulations, or business practices change. The latest version will be published on this page with an updated effective date."] },
      { id: "contact", title: "Contact information", paragraphs: ["For questions about these terms, contact hello@puresaas.in."] },
    ],
  },
  security: {
    badge: "Security by design",
    sections: [
      { id: "overview", title: "Security overview", paragraphs: ["PureSaaS is designed to help teams manage important operational information with practical security controls. We continually review platform, application, and process safeguards."] },
      { id: "protection", title: "Data protection", paragraphs: ["We use secure transport for information sent between supported clients and services. Data handling is designed around minimal collection, validation, and controlled access."] },
      { id: "authentication", title: "Secure authentication", paragraphs: ["Authentication workflows validate submitted credentials and support product-specific access paths. Users should choose strong passwords and never share account credentials."] },
      { id: "access", title: "Access control", paragraphs: ["Access should be granted according to business responsibilities. Organizations are responsible for reviewing user access when roles change or team members leave."] },
      { id: "infrastructure", title: "Infrastructure practices", paragraphs: ["We apply practical infrastructure safeguards, dependency reviews, response headers, monitoring, and secure configuration practices appropriate to the platform environment."] },
      { id: "recovery", title: "Backup and recovery", paragraphs: ["Operational recovery planning is reviewed as services evolve. Backup and restoration practices are aligned with service scope and business continuity requirements."] },
      { id: "responsibility", title: "User responsibility", paragraphs: ["Security is shared. Use trusted devices, keep browsers updated, protect OTPs and passwords, and report suspicious activity promptly."] },
      { id: "reporting", title: "Reporting security issues", paragraphs: ["If you believe you found a security issue, contact hello@puresaas.in with a clear description. Please avoid accessing data that does not belong to you or disrupting services."] },
      { id: "compliance", title: "Compliance mindset", paragraphs: ["We approach security as an ongoing program. Controls, documentation, and operational practices are reviewed as products, customer needs, and applicable obligations evolve."] },
      { id: "contact", title: "Contact information", paragraphs: ["For security questions or responsible disclosure, contact hello@puresaas.in."] },
    ],
  },
};

export function isLegalSlug(slug: MarketingSlug): slug is LegalSlug {
  return slug === "privacy" || slug === "terms" || slug === "security";
}
