import { Link } from "wouter";
import { ArrowLeft } from "lucide-react";
import { Button } from "@/components/ui/button";

export default function Terms() {
  return (
    <div className="min-h-screen bg-gray-50">
      <div className="bg-primary py-8">
        <div className="max-w-4xl mx-auto px-4">
          <Link href="/">
            <Button variant="ghost" className="text-white hover:bg-white/10 mb-4" data-testid="button-back-home">
              <ArrowLeft className="w-4 h-4 mr-2" />
              Back to Home
            </Button>
          </Link>
          <h1 className="text-3xl md:text-4xl font-bold text-white">Terms and Conditions</h1>
        </div>
      </div>
      
      <div className="max-w-4xl mx-auto px-4 py-12">
        <div className="bg-white rounded-lg shadow-sm p-8 prose prose-gray max-w-none">
          <p className="text-gray-600 mb-6">
            T-kash Soko is a white-label service operated on Blipply AB's technology platform. While the service is branded as T-kash Soko for Telkom Kenya Ltd, all technology, hosting, and data processing are managed by Blipply AB.
          </p>
          
          <p className="text-gray-600 mb-6">
            The following terms and conditions govern your acquisition and use of our service.
          </p>
          
          <p className="text-gray-600 mb-6">
            By accepting this agreement, either by clicking a box indicating your acceptance or by completing a payment transaction that references this agreement, you agree to the terms and conditions of this agreement.
          </p>
          
          <p className="text-gray-600 mb-6">
            If you are entering into this agreement on behalf of a company or other legal entity, you represent that you have the authority to bind such entity and its affiliates to these terms and conditions, in which case the terms "You" or "Your" shall refer to such entity and its affiliates. If you do not have such authority, or if you do not agree with these terms and conditions, you must not accept this agreement and may not use the services.
          </p>
          
          <p className="text-gray-600 mb-8">
            You may not access the Services if You are Our direct competitor, except with Our prior written consent. In addition, You may not access the Services for purposes of monitoring their availability, performance or functionality, or for any other benchmarking or competitive purposes.
          </p>

          <h2 className="text-2xl font-bold text-gray-900 mt-8 mb-4">1. Definitions</h2>
          <p className="text-gray-600 mb-4">Unless the context otherwise requires, the following terms shall have the following meanings:</p>
          <ul className="list-disc pl-6 space-y-2 text-gray-600 mb-6">
            <li><strong>Affiliate</strong> means any entity that directly or indirectly controls, is controlled by, or is under common control with the subject entity. "Control," for purposes of this definition, means direct or indirect ownership or control of more than 50% of the voting interests of the subject entity;</li>
            <li><strong>Agreement</strong> means these terms and conditions;</li>
            <li><strong>Beta Services</strong> means Our services that are not generally available to customers;</li>
            <li><strong>Content</strong> means information obtained by Us from Our content licensors or publicly available sources and provided to You pursuant to a paid transaction as more fully described in the Documentation;</li>
            <li><strong>Device</strong> means the device you use to access the Service;</li>
            <li><strong>Documentation</strong> means Our online user guides, documentation, and help and training materials, as updated from time to time;</li>
            <li><strong>End User</strong> means any third party entity or individual, outside You or Your Affiliate, that acquires access to use the Service via a recruitment invitation from You sent from the reselling function in the Service;</li>
            <li><strong>Malicious Code</strong> means code, files, scripts, agents or programs intended to do harm, including, for example, viruses, worms, time bombs and trojan horses;</li>
            <li><strong>Marketplace</strong> means Apple App store, Google Play Store, an online directory, catalogue or marketplace of applications that interoperate with the Services;</li>
            <li><strong>Non-Blipply Applications</strong> means any online or offline software application that is provided by You, Your Affiliate or a third party and interoperates with the Service;</li>
            <li><strong>Partner</strong> means any company that has an exclusive partner agreement directly with Us stating exclusivity to collect reseller commission in a certain geographical or business area;</li>
            <li><strong>Photo files</strong> means any photos You have uploaded to any object in the Service;</li>
            <li><strong>Provided Contact Content</strong> means any content to all contacts You import from either Your Device or any social media that the Service is connected to;</li>
            <li><strong>Public Content</strong> means information that is shared and can be updated by You, any User or End User on the objects contact and organisation in the Service;</li>
            <li><strong>Purchased Service</strong> means a Service that You or Your Affiliate purchase from us, as distinguished from those provided pursuant to a free trial;</li>
            <li><strong>Reward</strong> means an amount we give back to users;</li>
            <li><strong>Service</strong> means the product that is requested by You under a free trial or on payment basis and made available through Google Play store, Apples App store by Us, including any associated components;</li>
            <li><strong>User</strong> means an individual who is authorised by You to use the Service, for whom You have purchased the Service, and to whom You (or We at Your request) have supplied a user identification and password;</li>
            <li><strong>User Guide</strong> means a digital manual describing the Service provided by Us;</li>
            <li><strong>We, Us or Our</strong> means the Blipply AB company;</li>
            <li><strong>You or Your</strong> means You as an individual or the company or other legal entity for which you are accepting this Agreement, and Affiliates of that company or entity;</li>
            <li><strong>Your Data</strong> means any electronic data and personal information submitted by or for You to the Purchased Service or collected and processed by or for You using the Purchased Service;</li>
            <li><strong>Your Business Data</strong> means data about the business relationship between You and contacts and organisations listed in the Service by You a User or any other user of the Service.</li>
          </ul>

          <h2 className="text-2xl font-bold text-gray-900 mt-8 mb-4">2. Our Responsibilities</h2>
          
          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">2.1. Provision of Purchased Services</h3>
          <p className="text-gray-600 mb-4">
            We will: (a) make the Services and Content available to You pursuant to this Agreement and upon payment of the applicable fee, (b) use commercially reasonable efforts to make the online Purchased Services available, except for: (i) planned downtime, (ii) any unavailability caused by circumstances beyond Our reasonable control, including, for example, an act of God, act of government, flood, fire, earthquake, civil unrest, act of terror, strike or other labor problem, Internet service provider failure or delay, Non-Blipply Application, or denial of service attack and (iii) any downtime caused by a third party responsible for the hosting of the Service.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">2.2. Our Products</h3>
          <p className="text-gray-600 mb-4">
            We provide the products below as part of our Services under a pay as you use model. The current applicable charges for the products are set out in our pricing guide which is available on Our website.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">2.3. Protection of Your Data</h3>
          <p className="text-gray-600 mb-4">
            We will maintain reasonable administrative, physical, and technical safeguards for protection of the security, confidentiality and integrity of Your Data, as described in the Documentation and our Privacy Policy. Those safeguards will include, but will not be limited to, measures for preventing access, use, modification or disclosure of Your Data by Our personnel except (a) to provide the Purchased Service and prevent or address service or technical problems, (b) as compelled by law, or (c) as You expressly permit in writing.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">2.4. Our Personnel</h3>
          <p className="text-gray-600 mb-4">
            We will be responsible for the performance of Our personnel (limited to Our employees) and their compliance with Our obligations under this Agreement, except as otherwise specified herein.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">2.5. Beta Services</h3>
          <p className="text-gray-600 mb-4">
            From time to time, We may invite You to try Beta Services at no charge. You may accept or decline any such trial in Your sole discretion. Beta Services will be clearly designated as beta, pilot, limited release, developer preview, non-production, evaluation or by a description of similar import. Beta Services are for evaluation purposes and not for production use, are not considered "Service" under this Agreement, are not supported, and may be subject to additional terms.
          </p>

          <h2 className="text-2xl font-bold text-gray-900 mt-8 mb-4">3. Use of Services and Content</h2>
          
          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">3.1. Your Responsibilities</h3>
          <p className="text-gray-600 mb-4">
            You will: (a) be responsible for Users' compliance with this Agreement, (b) be responsible for the accuracy, quality and legality of Your Data and the means by which You acquired Your Data, (c) use commercially reasonable efforts to prevent unauthorised access to or use of the Service, and notify Us promptly of any such unauthorised access or use, (d) use the Service only in accordance with the Documentation and applicable laws and government regulations and (e) comply with terms of service of Non-Blipply Applications with which You use the Service.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">3.2. Usage Restrictions</h3>
          <p className="text-gray-600 mb-4">
            You will not: (a) make the Service or Content available to, or use the Service or Content for the benefit of, anyone other than You or Users, (b) sell, resell, license, sublicense, distribute, rent or lease the Service or Content, or include the Service or Content in a service bureau or outsourcing offering, (c) use the Service to store or transmit infringing, libelous, or otherwise unlawful or tortious material, or to store or transmit material in violation of third-party privacy rights, (d) use the Service to store or transmit Malicious Code, (e) interfere with or disrupt the integrity or performance of the Service or Content or third-party data contained therein, (f) attempt to gain unauthorised access to the Service or Content or its related systems or networks, (g) copy the Service or Content or any part, feature, function or user interface thereof, (h) copy Content except as permitted herein or in the Documentation, (i) frame or mirror any part of the Service or Content, (j) access the Service or Content in order to build a competitive product or service, or (k) reverse engineer the Service (to the extent such restriction is permitted by law).
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">3.3. Removal of Content and Non-Blipply Applications</h3>
          <p className="text-gray-600 mb-4">
            If We are required by a licensor to remove Content, or receive information that Content provided to You may violate applicable law or third-party rights, We may so notify You and in such event You will promptly remove such Content from Your systems.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">3.4. Consent to Our Use of Your Data</h3>
          <p className="text-gray-600 mb-4">
            You consent to Our use of Your data, and Your Business data in anonymous form for creating future services. If You deliberately are tampering with Public Content in a way that other users of the Service report this to Us, We have the right to exclude you from the Service without any warning and any right for You to get a Refund.
          </p>

          <h2 className="text-2xl font-bold text-gray-900 mt-8 mb-4">4. Non-Blipply Providers</h2>
          
          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">4.1. Acquisition of Non-Blipply Products and Services</h3>
          <p className="text-gray-600 mb-4">
            We or third parties may make available third-party products or services, including Non-Blipply Applications and implementation and other consulting services. Any acquisition by You of such non-Blipply products or services, and any exchange of data between You and any non-Blipply provider, is solely between You and the applicable non-Blipply provider. We do not warrant or support Non-Blipply Applications or other non-Blipply products or services, whether or not they are designated by Us as "certified" or otherwise.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">4.2. Non-Blipply Applications and Your Data</h3>
          <p className="text-gray-600 mb-4">
            If You install or enable a Non-Blipply Application for use with the Service, You grant Us permission to allow the provider of that Non-Blipply Application to access Your Data as required for the interoperation of that Non-Blipply Application with the Service. We are not responsible for any disclosure, modification or deletion of Your Data resulting from access by a Non-Blipply Application.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">4.3. Integration with Non-Blipply Applications</h3>
          <p className="text-gray-600 mb-4">
            The Service may contain features designed to interoperate with Non-Blipply Applications. To use such features, You may be required to obtain access to Non-Blipply Applications from their providers, and may be required to grant Us access to Your account(s) on the Non-Blipply Applications.
          </p>

          <h2 className="text-2xl font-bold text-gray-900 mt-8 mb-4">5. Fees and Payment for Purchased Services</h2>
          
          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">5.1. Purchase and Usage</h3>
          <p className="text-gray-600 mb-4">
            Unless otherwise provided in the terms of engagement, the Service is provided on a pay per use basis and applicable charges will be dependent on the number type of interaction completed by Users.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">5.2. Fees and Billing Information</h3>
          <p className="text-gray-600 mb-4">
            The current applicable fees for Our Services and products are set out in our pricing guide which is available in Our apps. We have the right to, at any given time, change the fees. You will provide Us with a valid and registered mobile number which has been registered for Blipply or any connected Non-Blipply wallet. You are responsible for providing complete and accurate billing and contact information to Us and notifying Us of any changes to such information.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">5.3. Taxes</h3>
          <p className="text-gray-600 mb-4">
            Our fees do not include any taxes, levies, duties or similar governmental assessments of any nature, including, for example, value-added, sales, use or withholding taxes, assessable by any jurisdiction whatsoever (collectively, "Taxes"). You are responsible for paying all Taxes associated with Your purchases hereunder.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">5.4. Functionality</h3>
          <p className="text-gray-600 mb-4">
            You agree that Your purchases are not contingent on the delivery of any future functionality or features, or dependent on any oral or written public comments made by Us regarding future functionality or features.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">5.5. Account Blocking Due to Unpaid Fees</h3>
          <p className="text-gray-600 mb-4">
            If fees cannot be collected automatically or are not paid by You, Blipply reserves the right to immediately block Your account until the outstanding payment has been fully settled by You.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">5.6. Legal Action for Unpaid Fees</h3>
          <p className="text-gray-600 mb-4">
            We reserve the right to pursue legal action, including but not limited to filing lawsuits or engaging collection agencies, to recover any unpaid fees owed to Us. By agreeing to these terms, You acknowledge and accept this right and agree to bear any additional costs, including legal fees and expenses, incurred by Us in the process of recovering unpaid amounts.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">5.7. Cash Payment Platform Fees</h3>
          <p className="text-gray-600 mb-4">
            (a) Cash sales processed through the Service incur the same one percent (1%) platform fee as all other sales.
          </p>
          <p className="text-gray-600 mb-4">
            (b) We automatically credit each new merchant account with fifty Kenyan Shillings (KES 50) of platform fee credits ("Cash Fee Credits") applied exclusively to the platform fee arising from recorded cash sales.
          </p>
          <p className="text-gray-600 mb-4">
            (c) Once the Cash Fee Credits are exhausted, any additional platform fees generated by cash sales accrue to a cash platform fee balance ("Cash Fee Balance"). You must settle the Cash Fee Balance whenever it reaches KES 50.
          </p>
          <p className="text-gray-600 mb-4">
            (d) If the Cash Fee Balance reaches or exceeds KES 50, we will immediately disable the cash sales registration until the outstanding balance is cleared.
          </p>
          <p className="text-gray-600 mb-4">
            (e) You may settle the Cash Fee Balance by making an in-app top-up or do digital sales where we can collect and deduct the cash fee balance; you may also top up in advance, in which case all future cash-sale platform fees will be deducted from that topped-up balance until depleted.
          </p>
          <p className="text-gray-600 mb-4">
            (f) We may deduct any unpaid Cash Fee Balance from any amounts otherwise payable to you under the Service, including wallet balances, settlement payouts, or rewards.
          </p>
          <p className="text-gray-600 mb-4">
            (g) Failure to settle the Cash Fee Balance constitutes a fee default under Section 5.5 and entitles us to all remedies described in Sections 5.5 and 5.6.
          </p>

          <h2 className="text-2xl font-bold text-gray-900 mt-8 mb-4">6. Proprietary Rights and Licenses</h2>
          
          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">6.1. Reservation of Rights</h3>
          <p className="text-gray-600 mb-4">
            Subject to the limited rights expressly granted hereunder, We and Our licensors reserve all of Our/their right, title and interest in and to the Service and Content, including all of Our/their related intellectual property rights. No rights are granted to You hereunder other than as expressly set forth herein.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">6.2. License by Us to Use Content</h3>
          <p className="text-gray-600 mb-4">
            We grant to You a worldwide, revocable, limited-term license, under Our applicable intellectual property rights and licenses, to use Content acquired by You pursuant to a purchased service, subject to this Agreement and the Documentation.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">6.3. License by You to Host Your Data and Applications</h3>
          <p className="text-gray-600 mb-4">
            You grant Us and Our Affiliates a worldwide, limited-term license to host, copy, transmit and display Your Data, and any Non-Blipply Applications and program code created by or for You using a Service, as necessary for Us to provide the Services in accordance with this Agreement.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">6.4. License by You to Use Feedback</h3>
          <p className="text-gray-600 mb-4">
            You grant to Us and Our Affiliates a worldwide, perpetual, irrevocable, royalty-free license to use and incorporate into the Services any suggestion, enhancement request, recommendation, correction or other feedback provided by You or Users relating to the operation of the Services.
          </p>

          <h2 className="text-2xl font-bold text-gray-900 mt-8 mb-4">7. Confidentiality</h2>
          
          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">7.1. Definition of Confidential Information</h3>
          <p className="text-gray-600 mb-4">
            "Confidential Information" means all information disclosed by a party ("Disclosing Party") to the other party ("Receiving Party"), whether orally or in writing, that is designated as confidential or that reasonably should be understood to be confidential given the nature of the information and the circumstances of disclosure.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">7.2. Protection of Confidential Information</h3>
          <p className="text-gray-600 mb-4">
            The Receiving Party will use the same degree of care that it uses to protect the confidentiality of its own confidential information of like kind (but not less than reasonable care) (i) not to use any Confidential Information of the Disclosing Party for any purpose outside the scope of this Agreement, and (ii) except as otherwise authorised by the Disclosing Party in writing, to limit access to Confidential Information of the Disclosing Party to those of its and its Affiliates' employees and contractors who need that access for purposes consistent with this Agreement.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">7.3. Compelled Disclosure</h3>
          <p className="text-gray-600 mb-4">
            The Receiving Party may disclose Confidential Information of the Disclosing Party to the extent compelled by law to do so, provided the Receiving Party gives the Disclosing Party prior notice of the compelled disclosure (to the extent legally permitted) and reasonable assistance, at the Disclosing Party's cost, if the Disclosing Party wishes to contest the disclosure.
          </p>

          <h2 className="text-2xl font-bold text-gray-900 mt-8 mb-4">8. Representations, Warranties, Exclusive Remedies and Disclaimers</h2>
          
          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">8.1. Representations</h3>
          <p className="text-gray-600 mb-4">
            Each party represents that it has validly entered into this Agreement and has the legal power to do so. We warrant that we are the owner of the Service and that we have the necessary rights to the Service for granting the rights granted to You according to this Agreement.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">8.2. Our Warranties</h3>
          <p className="text-gray-600 mb-4">
            We warrant that (a) this Agreement and the Documentation accurately describe the applicable administrative, physical, and technical safeguards for protection of the security, confidentiality and integrity of Your Data, (b) the Purchased Service will perform materially in accordance with the applicable Documentation.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">8.3. Disclaimers</h3>
          <p className="text-gray-600 mb-4">
            Except as expressly provided herein, neither party makes any warranty of any kind, whether express, implied, statutory or otherwise, and each party specifically disclaims all implied warranties, including any implied warranty of merchantability, fitness for a particular purpose or non-infringement, to the maximum extent permitted by applicable law. Content and beta services are provided "as is," exclusive of any warranty whatsoever.
          </p>

          <h2 className="text-2xl font-bold text-gray-900 mt-8 mb-4">9. Mutual Indemnification</h2>
          
          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">9.1. Indemnification by Us</h3>
          <p className="text-gray-600 mb-4">
            We will defend You against any claim, demand, suit or proceeding made or brought against You by a third party alleging that the use of a Purchased Service in accordance with this Agreement infringes or misappropriates such third party's intellectual property rights, and will indemnify You from any damages, attorney fees and costs finally awarded against You as a result of such claim.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">9.2. Indemnification by You</h3>
          <p className="text-gray-600 mb-4">
            You will defend Us against any claim, demand, suit or proceeding made or brought against Us by a third party alleging that Your Data, Provided Contact Content or Your use of the Service or Content in breach of this Agreement, infringes or misappropriates such third party's intellectual property rights or violates applicable law, and will indemnify Us from any damages, attorney fees and costs finally awarded against Us as a result of such claim.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">9.3. Exclusive Remedy</h3>
          <p className="text-gray-600 mb-4">
            This Section 9 states the indemnifying party's sole liability to, and the indemnified party's exclusive remedy against, the other party for any type of claim described in this Section 9.
          </p>

          <h2 className="text-2xl font-bold text-gray-900 mt-8 mb-4">10. Limitation of Liability</h2>
          
          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">10.1.</h3>
          <p className="text-gray-600 mb-4">
            We hold no liability towards You related to this Agreement or otherwise.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">10.2.</h3>
          <p className="text-gray-600 mb-4">
            Subject to any applicable law, any statement, condition or warranty, express or implied, as to the quality, merchantability, or suitability or fitness for any particular purpose of the Service is hereby excluded and We shall not be liable to You, User, Affiliate, the End User or to any other persons for loss or damage (whether direct or consequential) arising directly or indirectly in connection with the Service itself.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">10.3.</h3>
          <p className="text-gray-600 mb-4">
            We shall not be liable for any undertaking by You towards the End User and You shall indemnify Us in case of claims being raised towards Us by any End User.
          </p>

          <h3 className="text-xl font-semibold text-gray-800 mt-6 mb-3">10.4. Limitation of Liability</h3>
          <p className="text-gray-600 mb-4">
            Neither party's liability with respect to any single incident arising out of or related to this agreement will exceed the amount paid by customer hereunder in the 1 month preceding the incident, provided that in no event will either party's aggregate liability arising out of or related to this agreement exceed the total amount paid by customer hereunder.
          </p>

          <h2 className="text-2xl font-bold text-gray-900 mt-8 mb-4">11. Term and Termination</h2>
          <p className="text-gray-600 mb-4">
            Either party may terminate this Agreement upon written notice to the other party if the other party materially breaches this Agreement and fails to cure such breach within thirty (30) days of receiving written notice thereof.
          </p>

          <h2 className="text-2xl font-bold text-gray-900 mt-8 mb-4">12. Governing Law and Jurisdiction</h2>
          <p className="text-gray-600 mb-4">
            This Agreement shall be governed by and construed in accordance with the laws of Sweden. The courts having exclusive jurisdiction are: Sweden.
          </p>

          <div className="mt-12 pt-8 border-t border-gray-200">
            <p className="text-sm text-gray-500">
              Last updated: January 2025
            </p>
            <p className="text-sm text-gray-500 mt-2">
              T-kash Soko is a service of Telkom Kenya Ltd, powered by Blipply AB technology.
            </p>
          </div>
        </div>
      </div>
    </div>
  );
}
