import type { Metadata } from "next";
import Link from "next/link";
import { COMPANY, SUPPORT_EMAIL, LAST_UPDATED } from "../legal-config";

export const metadata: Metadata = {
  title: `Terms of Service — ${COMPANY}`,
  description: `The terms governing your use of ${COMPANY}, including the SMS/text messaging program.`,
};

export default function TermsPage() {
  return (
    <main className="legal-wrap">
      <h1>Terms of Service</h1>
      <p className="updated">Last updated: {LAST_UPDATED}</p>

      <p>
        These Terms of Service (&quot;Terms&quot;) govern your access to and use of the {COMPANY}{" "}
        website, portal, and services (the &quot;Service&quot;). By using the
        Service you agree to these Terms.
      </p>

      <h2>Use of the Service</h2>
      <p>
        You must provide accurate information, keep your credentials secure, and use the
        Service only for lawful purposes and in accordance with these Terms. You are
        responsible for activity that occurs under your account.
      </p>

      <h2>Accounts and verification</h2>
      <p>
        To protect your account we may verify your identity, including by sending one-time
        codes to your email or mobile number. You agree to receive these verification
        messages as part of using the Service.
      </p>

      <h2>SMS / text messaging program</h2>
      <div className="legal-callout">
        <p>
          By opting in on our <Link href="/sms-opt-in">SMS opt-in page</Link> or by
          providing your mobile number and agreeing to receive texts, you consent to
          receive <strong>account and service text messages</strong> from {COMPANY},
          including one-time verification codes (OTP), security alerts, appointment and
          inspection updates, and estimate notifications.
        </p>
        <p>
          <strong>Message frequency varies.</strong> <strong>Message and data rates may
          apply.</strong> Reply <strong>HELP</strong> for help or <strong>STOP</strong> to
          unsubscribe at any time; after you send STOP we will send one confirmation and no
          further messages. Carriers are not liable for delayed or undelivered messages.
        </p>
        <p>
          We do not sell, rent, or share your mobile number or SMS consent with third
          parties or affiliates for marketing. See our{" "}
          <Link href="/privacy">Privacy Policy</Link> for details.
        </p>
      </div>

      <h2>Acceptable use</h2>
      <p>
        You may not misuse the Service, attempt to access accounts or data you are not
        authorized to access, interfere with the Service&apos;s operation, or use it to
        send unlawful, harmful, or infringing content.
      </p>

      <h2>Disclaimers and limitation of liability</h2>
      <p>
        The Service is provided &quot;as is&quot; without warranties of any kind. To the
        fullest extent permitted by law, {COMPANY} is not liable for any indirect,
        incidental, or consequential damages arising from your use of the Service.
      </p>

      <h2>Changes to these Terms</h2>
      <p>
        We may update these Terms from time to time. Continued use of the Service after
        changes take effect constitutes acceptance of the updated Terms.
      </p>

      <h2>Contact us</h2>
      <p>
        Questions about these Terms? Email us at{" "}
        <a href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</a>.
      </p>
    </main>
  );
}
