import type { Metadata } from "next";
import Link from "next/link";
import { LegalPageLayout } from "@/components/LegalPageLayout";
import { LEGAL_OPERATOR } from "@/lib/legal/constants";

export const metadata: Metadata = {
  title: "Refund Policy | Songs2YT",
  description: "Refund and cancellation policy for Songs2YT paid plans.",
};

export default function RefundPage() {
  return (
    <LegalPageLayout
      title="Refund Policy"
      description="Our policy on refunds, cancellations, and billing for paid plans."
    >
      <h2>1. Overview</h2>
      <p>
        This Refund Policy explains how refunds and cancellations work for paid Songs2YT plans. The
        free Bedroom Producer plan does not involve payments and is not subject to refunds.
      </p>

      <h2>2. Free plan</h2>
      <p>
        The free plan is provided at no charge. No payment information is required and no refunds
        apply.
      </p>

      <h2>3. Pro subscriptions</h2>
      <h3>3.1 Billing cycle</h3>
      <p>
        Pro plans are billed on a recurring monthly basis unless otherwise stated at checkout.
        Your subscription renews automatically until cancelled.
      </p>

      <h3>3.2 14-day refund window</h3>
      <p>
        If you are a new Pro subscriber, you may request a full refund within <strong>14 days</strong> of
        your initial purchase, provided you have not substantially consumed paid entitlements
        (for example, a large portion of your monthly video quota or premium-only features).
      </p>

      <h3>3.3 After the refund window</h3>
      <p>
        After 14 days, subscription fees are generally non-refundable for the current billing
        period. You may cancel at any time to prevent future renewals. Access typically continues
        until the end of the paid period.
      </p>

      <h3>3.4 Cancellation</h3>
      <p>
        You can cancel your subscription through your account billing settings or by contacting{" "}
        <a href={`mailto:${LEGAL_OPERATOR.email}`}>{LEGAL_OPERATOR.email}</a>. Cancellation stops
        future charges; it does not automatically delete your account or uploaded content history
        unless you request account deletion separately.
      </p>

      <h2>4. Enterprise and custom agreements</h2>
      <p>
        Enterprise, managed cloud, and paid self-hosted setup fees are governed by the individual
        quote or contract signed with us. Refund terms for those services are specified in your
        agreement. Contact{" "}
        <a href={`mailto:${LEGAL_OPERATOR.salesEmail}`}>{LEGAL_OPERATOR.salesEmail}</a> for
        contract-related billing questions.
      </p>

      <h2>5. Non-refundable situations</h2>
      <p>Refunds are generally not provided when:</p>
      <ul>
        <li>The refund request is made outside the applicable refund window</li>
        <li>The account was terminated for violation of our <Link href="/terms">Terms of Service</Link></li>
        <li>The issue is caused by third-party services outside our control (e.g. YouTube API outages, Google account restrictions)</li>
        <li>You simply changed your mind after substantial use of paid quota or features</li>
        <li>One-time setup or license fees after delivery of agreed setup work, unless required by law or contract</li>
      </ul>

      <h2>6. Chargebacks</h2>
      <p>
        If you believe a charge is incorrect, please contact us before initiating a chargeback so
        we can resolve the issue promptly. Unjustified chargebacks may result in account suspension.
      </p>

      <h2>7. How to request a refund</h2>
      <p>Email us at <a href={`mailto:${LEGAL_OPERATOR.email}`}>{LEGAL_OPERATOR.email}</a> with:</p>
      <ul>
        <li>Your account email address</li>
        <li>Date of purchase and invoice or transaction reference if available</li>
        <li>Reason for the refund request</li>
      </ul>
      <p>We aim to respond within 5 business days. Approved refunds are issued to the original payment method where possible.</p>

      <h2>8. Consumer rights</h2>
      <p>
        Nothing in this policy limits mandatory statutory rights you may have as a consumer under
        applicable law, including withdrawal rights where required by EU or local consumer
        protection regulations.
      </p>

      <h2>9. Changes</h2>
      <p>
        We may update this Refund Policy from time to time. The version published on this page
        applies to purchases made after the effective date shown at the top.
      </p>
    </LegalPageLayout>
  );
}
