/* global React, LegalPage */

// DUMMY CONTENT: sample terms for layout only. Replace with solicitor-reviewed terms before launch.
// Facts used (prices, trial, scheduling, Guardians, Stripe) match the Pricing page.
const TERMS_UPDATED = '30 October 2026';

const TERMS_SECTIONS = [
  { id: 'about', title: 'About these terms', body: [
    'These terms set out the agreement between you and Everlasting Memory when you use our website and app. By creating an account, you agree to them.',
    "We've tried to write them in plain English. If anything is unclear, write to us and we'll explain.",
  ] },
  { id: 'who-we-are', title: 'Who we are', body: [
    'Everlasting Memory is run by [PLACEHOLDER: company name], a company registered in England and Wales under company number [PLACEHOLDER: number]. Our registered address is [PLACEHOLDER: address].',
  ] },
  { id: 'account', title: 'Your account', body: [
    'You must be 18 or over to create an account. Please keep your sign-in details private; you are responsible for anything done with your account.',
    "If you think someone else has used your account, tell us straight away and we'll help you secure it.",
  ] },
  { id: 'trial', title: 'Your free trial', body: [
    "Every new account starts with a 7-day free trial. You don't need a card to start it.",
    "No messages are saved or sent during the trial. Subscribe before it ends and everything you've set up, like your family tree and profile, stays as it is. If you don't subscribe, your trial account is deleted when the 7 days are up.",
  ] },
  { id: 'plans', title: 'Plans and payment', body: [
    'Monthly costs £7 a month and Yearly costs £60 a year. Both are paid in advance and renew automatically until you cancel.',
    'Legacy is an add-on to a monthly or yearly plan. It costs £150, paid once.',
    'Prices include VAT where it applies. Payments are handled by Stripe; we never see or store your card details. If we change our prices, we will tell you at least 30 days before the change affects you.',
  ] },
  { id: 'cancelling', title: 'Cancelling', body: [
    'You can cancel any time from your account. Your plan stays active until the end of the period you have paid for, and you won’t be charged again.',
    'If you are in the UK, you have 14 days from your first payment to change your mind and receive a full refund. [PLACEHOLDER: confirm refund policy for Yearly and Legacy]',
  ] },
  { id: 'messages', title: 'Scheduling and delivering messages', body: [
    'On a monthly or yearly plan, you can schedule messages up to 12 months ahead. With Legacy, you can schedule messages for any date.',
    "If your subscription ends, messages you've already scheduled are still sent, exactly as you planned. On a monthly or yearly plan, that's everything in the next 12 months; with Legacy, it's every date. You won't be able to add, edit or remove messages until you subscribe again.",
    'We take great care to deliver every message on the day you choose, but we rely on email and other services we don’t control. If a message can’t be delivered, we will keep trying and let you know.',
  ] },
  { id: 'guardians', title: 'Guardians and Legacy delivery', body: [
    'With Legacy, you can choose messages to be delivered after you pass. You name two Guardians, and these messages are released once both of them confirm.',
    'Please choose Guardians you trust and tell them about their role. We act on their confirmation and are not responsible for a Guardian’s decision.',
  ] },
  { id: 'content', title: 'Your content', body: [
    'Everything you record and upload stays yours. You give us permission to store it, process it and deliver it to the people you choose, and nothing more.',
    'Only upload content you have the right to share, and don’t upload anything unlawful, harmful or that infringes someone else’s rights.',
  ] },
  { id: 'recipients', title: 'The people you send messages to', body: [
    'The people who receive your messages never pay. They can watch and keep the messages you send them, and they agree to these terms when they create an account to do so.',
  ] },
  { id: 'liability', title: 'Our responsibility to you', body: [
    'We are responsible for loss or damage you suffer that is a foreseeable result of us breaking these terms or failing to use reasonable care. We are not responsible for loss that was not foreseeable.',
    'Nothing in these terms limits our liability where it would be unlawful to do so, including for death or personal injury caused by our negligence. [PLACEHOLDER: liability cap to be confirmed]',
  ] },
  { id: 'ending', title: 'Ending your account', body: [
    'You can close your account at any time from your settings. We may suspend or close an account that breaks these terms; where we can, we will warn you first and explain why.',
  ] },
  { id: 'changes', title: 'Changes to these terms', body: [
    'We may update these terms from time to time. If a change affects you in a meaningful way, we will email you at least 30 days before it takes effect.',
  ] },
  { id: 'law', title: 'Law and disputes', body: [
    'These terms are governed by the law of England and Wales. If you live in Scotland or Northern Ireland, you can also bring proceedings in your local courts.',
  ] },
  { id: 'contact', title: 'Contact us', body: [
    'Questions about these terms? Write to us at hello@everlasting-memory.com.',
  ] },
];

function TermsPage() {
  return (
    <LegalPage
      title="Terms and conditions"
      lede="The agreement between you and Everlasting Memory, in plain English."
      path="/terms/"
      updated={TERMS_UPDATED}
      notice={<><strong>Placeholder text.</strong> These terms are sample content for layout only and are not legally binding. They will be replaced with reviewed terms before launch.</>}
      sections={TERMS_SECTIONS}
    />
  );
}

window.TermsPage = TermsPage;
