import { LegalPage, Section, Callout, LegalContact } from "@/components/marketing/legal"
import { LEGAL } from "@/lib/legal"

export const metadata = {
  title: "Refund & Cancellation Policy",
  description: `How subscriptions, cancellations, and refunds work for the ${LEGAL.service} platform.`,
  alternates: { canonical: "/refund-policy" },
}

export default function Page() {
  return (
    <LegalPage
      title="Refund & Cancellation Policy"
      subtitle={`This policy explains how billing, cancellations, and refunds work for the ${LEGAL.service} platform. It forms part of our Terms of Service.`}
    >
      <Section heading="1. Overview">
        <p>
          This Refund &amp; Cancellation Policy (the <strong>Policy</strong>) describes how subscriptions to the{" "}
          {LEGAL.service} platform (the <strong>Service</strong>), operated by {LEGAL.entity} (<strong>we</strong>,{" "}
          <strong>us</strong>, or <strong>our</strong>), are billed, how you (the <strong>Customer</strong>) may
          cancel, and when refunds are available. This Policy forms part of our <a href="/terms">Terms of
          Service</a>. In the event of any conflict, the Terms of Service govern.
        </p>
      </Section>

      <Section heading="2. Subscription billing">
        <p>
          The Service is offered under the <strong>Starter</strong> (free), <strong>Pro</strong> ($29 per month),{" "}
          <strong>Landlord</strong> ($59 per month), and <strong>Lifetime</strong> ($199 one-time) plans. Monthly
          recurring plans are billed in advance at the start of each billing cycle through our payment processor,{" "}
          <strong>Stripe</strong>, and renew automatically until cancelled.
        </p>
      </Section>

      <Section heading="3. Cancellation">
        <p>
          You may cancel a paid subscription at any time from your billing settings or through the Stripe customer
          portal. When you cancel a monthly plan, your subscription remains active and you retain access until the end
          of the billing period you have already paid for; it will not renew for the following period.
        </p>
        <p>
          Because monthly plans are billed in advance, <strong>we do not provide partial-period refunds for the
          unused portion of a monthly billing cycle</strong> unless required by applicable law or expressly granted by
          us.
        </p>
      </Section>

      <Section heading="4. Refunds">
        <p>
          Except as expressly stated in this Policy or required by applicable law, monthly subscription fees are
          generally <strong>non-refundable</strong>. We may, at our sole discretion, grant a refund or credit in
          individual cases, for example in the event of an extended service outage or a billing error.
        </p>
        <p>
          To request a refund or raise a billing concern, contact us at{" "}
          <a href={`mailto:${LEGAL.contactEmail}`}>{LEGAL.contactEmail}</a> with your account details and a
          description of the issue, and we will review your request.
        </p>
      </Section>

      <Section heading="5. Lifetime plan">
        <p>
          The <strong>Lifetime</strong> plan is a single, one-time charge rather than a recurring subscription. The
          Lifetime plan is refundable if you request a refund within {LEGAL.lifetimeRefundDays} days of the date of
          purchase. After the {LEGAL.lifetimeRefundDays}-day window has passed, the Lifetime plan is{" "}
          <strong>non-refundable</strong>, except where a refund is required by applicable law.
        </p>
      </Section>

      <Section heading="6. Failed payments and past-due accounts">
        <p>
          If a scheduled payment fails, we and Stripe may attempt to charge your payment method again over a short
          period (a process known as dunning). If payment remains unsuccessful and your account becomes past due, we
          may downgrade your account to the free plan, suspend paid features, or ultimately suspend access to the
          Service until the outstanding amount is paid.
        </p>
      </Section>

      <Section heading="7. Price changes">
        <p>
          We may change the fees for a plan from time to time. If a price change affects your subscription, we will
          provide advance notice, and the new price will take effect on your next billing cycle. If you do not wish to
          accept a price change, you may cancel before it takes effect.
        </p>
      </Section>

      <Section heading="8. Chargebacks">
        <p>
          If you believe you have been charged in error, please contact us at{" "}
          <a href={`mailto:${LEGAL.contactEmail}`}>{LEGAL.contactEmail}</a> before initiating a chargeback with your
          bank or card issuer, so that we can resolve the matter quickly. Initiating a chargeback or payment dispute
          without first contacting us may lead to suspension or termination of your account while the dispute is
          investigated.
        </p>
      </Section>

      <Section heading="9. Statutory consumer rights">
        <p>
          If you are a consumer in the European Union, the United Kingdom, or another jurisdiction that grants a
          statutory right of withdrawal or cancellation, you may have rights that are additional to those described in
          this Policy. <strong>Nothing in this Policy limits or overrides any non-waivable statutory rights you may
          have as a consumer under applicable law.</strong>
        </p>
      </Section>

      <Callout>
        <strong>In short:</strong> you may cancel a monthly plan at any time and keep access until the end of the
        period you have paid for, monthly fees are otherwise non-refundable, and the Lifetime plan is refundable
        within {LEGAL.lifetimeRefundDays} days of purchase.
      </Callout>

      <LegalContact email={LEGAL.legalEmail} />
    </LegalPage>
  )
}
