"use client";

import { Container } from "@/components/common/Container";
import { PageHero } from "@/components/common/PageHero";
import { Reveal } from "@/components/motion/Reveal";
import { useTranslation } from "@/hooks/useTranslation";
import { SITE } from "@/constants/site";

export default function TermsPage() {
  const { t } = useTranslation();

  return (
    <>
      <PageHero
        eyebrow={t("nav.terms")}
        title="Terms of Service"
        subtitle="Last updated: January 1, 2026"
      />

      <section className="section">
        <Container>
          <article className="mx-auto max-w-3xl space-y-10 text-base leading-relaxed text-slate-700 dark:text-slate-300">
            <Block title="1. Agreement to Terms">
              <p>
                These Terms of Service (&ldquo;Terms&rdquo;) constitute a legally binding
                agreement between you and {SITE.name} regarding your use of our money transfer
                services. By creating an account or using our services, you agree to be bound by
                these Terms.
              </p>
            </Block>

            <Block title="2. Eligibility">
              <p>To use our services, you must:</p>
              <ul className="ms-5 list-disc space-y-2">
                <li>Be at least 18 years old.</li>
                <li>Be a resident of a country where our services are available.</li>
                <li>Have the legal capacity to enter into binding contracts.</li>
                <li>Pass our identity verification (KYC) checks.</li>
                <li>Not be subject to sanctions or appear on any prohibited persons list.</li>
              </ul>
            </Block>

            <Block title="3. Account Registration">
              <p>
                You agree to provide accurate, complete, and current information during
                registration and to keep it updated. You are responsible for maintaining the
                confidentiality of your account credentials and for all activities that occur
                under your account. Notify us immediately of any unauthorized use.
              </p>
            </Block>

            <Block title="4. Money Transfer Services">
              <p>
                {SITE.name} provides international money transfer services through bank transfer,
                cash pickup, and mobile money. By initiating a transfer, you authorize us to
                debit the specified amount plus fees from your chosen payment method and remit
                the converted amount to the recipient.
              </p>
              <p>
                Transfer limits, fees, and exchange rates are displayed clearly before you
                confirm any transfer. Once confirmed, transfers cannot be cancelled if funds have
                already been disbursed to the recipient.
              </p>
            </Block>

            <Block title="5. Fees & Exchange Rates">
              <p>
                We charge a service fee and a transfer fee for each transaction, and we apply a
                margin to the mid-market exchange rate. All fees and the exchange rate are
                disclosed before you confirm your transfer. No hidden charges will be applied.
              </p>
            </Block>

            <Block title="6. Prohibited Uses">
              <p>You agree not to use our services to:</p>
              <ul className="ms-5 list-disc space-y-2">
                <li>Facilitate illegal activity, including money laundering or terrorism financing.</li>
                <li>Send funds to or from sanctioned countries or individuals.</li>
                <li>Provide false or misleading information.</li>
                <li>Use the service on behalf of a third party without disclosing it.</li>
                <li>Interfere with or disrupt our services or servers.</li>
              </ul>
            </Block>

            <Block title="7. Compliance">
              <p>
                We comply with all applicable anti-money laundering, counter-terrorism financing,
                and sanctions laws. We reserve the right to refuse, delay, or reverse any
                transfer that we suspect may violate these laws or our policies, and to report
                transactions to relevant authorities as required.
              </p>
            </Block>

            <Block title="8. Limitation of Liability">
              <p>
                To the maximum extent permitted by law, {SITE.name} shall not be liable for any
                indirect, incidental, special, consequential, or punitive damages arising out of
                or related to your use of our services. Our total liability for any claim is
                limited to the amount of fees you paid us in the 12 months prior to the event
                giving rise to the claim.
              </p>
            </Block>

            <Block title="9. Account Termination">
              <p>
                You may close your account at any time by contacting support. We may suspend or
                terminate your account if you violate these Terms, if required by law, or if we
                detect fraudulent or suspicious activity. Upon termination, certain provisions of
                these Terms will survive, including those relating to liability, indemnification,
                and dispute resolution.
              </p>
            </Block>

            <Block title="10. Changes to Terms">
              <p>
                We may modify these Terms from time to time. We will notify you of material
                changes by email or in-app notice at least 30 days before they take effect. Your
                continued use of our services after changes take effect constitutes acceptance.
              </p>
            </Block>

            <Block title="11. Governing Law">
              <p>
                These Terms are governed by the laws of the State of New York, without regard to
                its conflict of law principles. Any disputes shall be resolved through binding
                arbitration in accordance with the rules of the American Arbitration Association.
              </p>
            </Block>

            <Block title="12. Contact">
              <p>
                Questions about these Terms? Contact us at{" "}
                <a
                  href={`mailto:${SITE.email}`}
                  className="font-bold text-brand-600 underline-offset-4 hover:underline dark:text-brand-400"
                >
                  {SITE.email}
                </a>
                .
              </p>
            </Block>
          </article>
        </Container>
      </section>
    </>
  );
}

function Block({ title, children }: { title: string; children: React.ReactNode }) {
  return (
    <Reveal className="space-y-4">
      <h2 className="text-xl font-bold tracking-tight text-slate-900 dark:text-white sm:text-2xl">
        {title}
      </h2>
      {children}
    </Reveal>
  );
}
