// Full legal documents — Privacy, Terms, Cookies, Acceptable Use, Refunds, Child Safety

const LAST_UPDATED = "April 29, 2026";

const LegalShell = ({ title, eyebrow, toc, children, currentPage }) => {
  useReveal();
  return (
    <PageShell currentPage={currentPage}>
      <section style={{ paddingTop: 40, paddingBottom: 40 }}>
        <div className="container" style={{ maxWidth: 880 }}>
          <Breadcrumbs items={[{ label: 'Legal' }, { label: title }]} />
          <div className="reveal" style={{ marginBottom: 32 }}>
            {eyebrow && <div className="eyebrow-pill" style={{ marginBottom: 16 }}>{eyebrow}</div>}
            <h1 style={{ fontSize: 'clamp(36px, 5vw, 56px)', marginBottom: 12 }}>{title}</h1>
            <div style={{ color: 'var(--text-secondary)', fontSize: 14 }}>
              <strong>Last updated:</strong> {LAST_UPDATED} · Soleo Technologies (DBA ClassGenie) · Austin, Texas
            </div>
          </div>
          {toc && (
            <div className="card reveal" style={{ marginBottom: 40, background: 'var(--bg-subtle)' }}>
              <div style={{ fontSize: 12, fontWeight: 700, color: 'var(--text-secondary)', textTransform: 'uppercase', letterSpacing: '0.05em', marginBottom: 12 }}>Contents</div>
              <ol style={{ paddingLeft: 20, columns: 2, columnGap: 24, fontSize: 14, lineHeight: 1.9 }}>
                {toc.map((t, i) => <li key={i}><a href={`#s${i+1}`} style={{ color: 'var(--text-primary)', textDecoration: 'none' }}>{t}</a></li>)}
              </ol>
            </div>
          )}
          <article className="legal-body reveal" style={{ fontSize: 16, lineHeight: 1.75, color: 'var(--text-primary)' }}>
            {children}
          </article>
          <div style={{ marginTop: 60, padding: 20, background: 'var(--bg-subtle)', borderRadius: 12, fontSize: 14, color: 'var(--text-secondary)' }}>
            Questions? Email <a href="mailto:hello@homescholarapp.com" style={{ color: 'var(--primary-purple)', fontWeight: 600 }}>hello@homescholarapp.com</a>. We respond within two business days.
          </div>
        </div>
      </section>
      <style>{`
        .legal-body h2 { font-size: 26px; margin-top: 48px; margin-bottom: 12px; scroll-margin-top: 100px; }
        .legal-body h3 { font-size: 18px; margin-top: 28px; margin-bottom: 8px; font-weight: 700; }
        .legal-body p { margin-bottom: 14px; }
        .legal-body ul, .legal-body ol { padding-left: 24px; margin-bottom: 14px; }
        .legal-body li { margin-bottom: 6px; }
        .legal-body strong { color: var(--text-primary); }
        .legal-body .callout { padding: 16px 20px; background: var(--bg-lavender); border-left: 4px solid var(--primary-purple); border-radius: 8px; margin: 20px 0; }
      `}</style>
    </PageShell>
  );
};

// ============ PRIVACY POLICY ============
const PrivacyPage = () => (
  <LegalShell
    title="Privacy Policy"
    eyebrow={<><span>🔒</span> COPPA, GDPR & CCPA compliant</>}
    currentPage="privacy"
    toc={[
      'Introduction', 'Information We Collect', 'How We Use Your Information',
      'AI Data Processing', 'Legal Basis for Processing', 'Children\'s Privacy (COPPA)',
      'How We Share Information', 'Cookies & Tracking', 'Data Retention',
      'Data Security', 'Your Rights', 'International Transfers',
      'Changes to This Policy', 'Contact Us'
    ]}
  >
    <h2 id="s1">1. Introduction</h2>
    <p>ClassGenie is operated by <strong>Soleo Technologies</strong>, a sole proprietorship based in Austin, Texas, founded by Laura Dovalina. This policy explains what information we collect, why we collect it, and what choices you have.</p>
    <p>We take children's privacy seriously. ClassGenie is built on a parent-first model: parents create accounts, parents add student profiles, and parents control all data about their children. We never collect data from children directly, and we never use children's data for advertising or behavioral profiling.</p>
    <p>Questions? Email <strong>hello@homescholarapp.com</strong> with the subject line "Privacy Question."</p>

    <h2 id="s2">2. Information We Collect</h2>
    <h3>From parent / teacher accounts</h3>
    <ul>
      <li>Full name, email address, hashed password</li>
      <li>Optional profile photo</li>
      <li>State of residence (for state-specific legal documents)</li>
      <li>Payment information — processed and stored by Stripe; ClassGenie never sees or stores card numbers</li>
      <li>Subscription status and billing history</li>
      <li>Account preferences and settings</li>
    </ul>
    <h3>From student profiles (created and managed by parents)</h3>
    <ul>
      <li>First name and last initial or nickname (full last name optional)</li>
      <li>Age or grade level (we do <strong>not</strong> collect full date of birth)</li>
      <li>Learning style preferences</li>
      <li>Strengths, areas for growth, and accommodations / IEP notes — all parent-entered</li>
      <li>Subject enrollment, curriculum assignments, grades, and academic performance</li>
      <li>Assignment submissions and uploaded student work (for AI grading)</li>
      <li>Generated transcripts, report cards, and progress data</li>
      <li>Calendar events and schedule data</li>
      <li>Optional parent-uploaded student photo</li>
    </ul>
    <h3>From co-op features</h3>
    <ul>
      <li>Co-op name, location, description, and member roles</li>
      <li>Invite codes, join requests, and shared resources</li>
    </ul>
    <h3>Automatically collected</h3>
    <ul>
      <li>Anonymized IP address, browser type, device type</li>
      <li>Pages visited, time spent, referral source</li>
      <li>Session recordings via Microsoft Clarity (sensitive fields masked)</li>
      <li>Essential and analytics cookies — never advertising cookies</li>
    </ul>

    <h2 id="s3">3. How We Use Your Information</h2>
    <ul>
      <li>To provide the core service: planning, gradebook, assignments, transcripts, reports</li>
      <li>To generate AI-powered educational content via Google Gemini (see next section)</li>
      <li>To process payments via Stripe</li>
      <li>To send transactional emails — confirmations, password resets, billing — via GetResponse</li>
      <li>To improve the service through anonymized analytics</li>
      <li>To prevent fraud and ensure security</li>
      <li>To comply with legal obligations</li>
    </ul>
    <div className="callout">
      <strong>What we never do:</strong> We do not use children's data for advertising, behavioral profiling, or marketing. We do not sell anyone's data. We do not share children's data with third parties for their own commercial purposes.
    </div>

    <h2 id="s4">4. AI Data Processing Disclosure</h2>
    <p>ClassGenie uses Google's Gemini API to power AI features (lesson plans, worksheets, study guides, grading suggestions, etc.). When you use an AI tool, the following is sent to Gemini:</p>
    <ul>
      <li>Subject name and grade level</li>
      <li>Topic or assignment description</li>
      <li>Learning style (when relevant to the generation)</li>
      <li>Uploaded student work text (for AI grading only)</li>
    </ul>
    <p><strong>What is never sent to Gemini:</strong> student names, student photos, parent names or emails, payment information, IP addresses, or device information.</p>
    <p>Per Google's API terms, Gemini does <strong>not</strong> retain ClassGenie user data and does <strong>not</strong> use it to train its models. AI-generated content is clearly labeled as AI-generated. AI-suggested grades require parent review and approval before they become final — there is no fully automated decision-making about students.</p>
    <p>You can opt out of AI processing at any time from <strong>Account Settings → Privacy → AI Tools</strong>. AI features become unavailable; everything else continues to work.</p>

    <h2 id="s5">5. Legal Basis for Processing (GDPR)</h2>
    <ul>
      <li><strong>Consent:</strong> AI features, analytics cookies, and other optional processing</li>
      <li><strong>Contract performance:</strong> Account management and core educational features</li>
      <li><strong>Legitimate interest:</strong> Security, fraud prevention, service improvement — children's interests always override</li>
      <li><strong>Legal obligation:</strong> Tax record-keeping and lawful requests</li>
    </ul>

    <h2 id="s6">6. Children's Privacy (COPPA)</h2>
    <p>ClassGenie is designed for use by parents and teachers managing children's education. We collect information about children under 13 only with verifiable parental consent obtained during account creation.</p>
    <p>The parent-first model means:</p>
    <ul>
      <li>Children cannot create independent ClassGenie accounts</li>
      <li>Parents create student profiles and control all data</li>
      <li>Parents review and approve any AI-suggested grades or feedback</li>
    </ul>
    <p><strong>Parental rights under COPPA:</strong></p>
    <ol>
      <li>Review all personal information we have about your child</li>
      <li>Request deletion of your child's personal information</li>
      <li>Refuse further collection of your child's information</li>
      <li>Withdraw consent at any time</li>
    </ol>
    <p>Exercise these rights via Account Settings or by emailing <strong>hello@homescholarapp.com</strong> with the subject "Children's Privacy Request." If we ever discover we have collected information from a child without verified parental consent, we will delete it immediately.</p>

    <h2 id="s7">7. How We Share Information</h2>
    <p>We share data only with the processors required to run the service:</p>
    <ul>
      <li><strong>Supabase</strong> — database, authentication, file storage (operates under a Data Processing Agreement)</li>
      <li><strong>Google Gemini</strong> — AI generation, receives only the limited data above; does not retain or train</li>
      <li><strong>Stripe</strong> — payment processing (independent controller for payment data)</li>
      <li><strong>GetResponse</strong> — transactional email delivery</li>
      <li><strong>Cloudflare</strong> — hosting, CDN, DNS, SSL</li>
      <li><strong>Google Analytics 4</strong> — IP-anonymized analytics, advertising sharing disabled</li>
      <li><strong>Microsoft Clarity</strong> — session recording with sensitive field masking</li>
    </ul>
    <div className="callout">
      <strong>We do not sell personal information. We do not allow third-party advertising on ClassGenie. We do not share data with advertising or marketing companies.</strong>
    </div>
    <p>We may disclose information if required by law, court order, or to protect safety. We will notify affected users of any such disclosure unless legally prohibited.</p>

    <h2 id="s8">8. Cookies and Tracking Technologies</h2>
    <p>See our full <a href="cookies.html" style={{ color: 'var(--primary-purple)', fontWeight: 600 }}>Cookie Policy</a> for details. Summary:</p>
    <ul>
      <li><strong>Essential cookies</strong> (authentication, session) — required, no consent needed</li>
      <li><strong>Analytics cookies</strong> (Google Analytics, Microsoft Clarity) — set on every visit to understand which pages help</li>
      <li><strong>No advertising or retargeting cookies, ever</strong></li>
    </ul>

    <h2 id="s9">9. Data Retention</h2>
    <ul>
      <li>Active account data: retained while your account is active</li>
      <li>Student academic records: retained 1 year past account deletion (for transcript requests)</li>
      <li>Uploaded student work: deleted automatically 1 year after the school year ends</li>
      <li>AI-generated content: deleted after 1 year</li>
      <li>Payment records: retained 7 years (US tax law)</li>
      <li>Analytics: anonymized after 14 months</li>
      <li>Deleted accounts: purged from active systems within 30 days; from backups within 90 days</li>
    </ul>

    <h2 id="s10">10. Data Security</h2>
    <ul>
      <li>TLS / HTTPS encryption in transit</li>
      <li>AES encryption at rest (via Supabase)</li>
      <li>Row Level Security so users only access their own data</li>
      <li>bcrypt password hashing</li>
      <li>Regular security audits and access controls</li>
    </ul>
    <p>We will notify affected users within <strong>72 hours</strong> of discovering a data breach.</p>

    <h2 id="s11">11. Your Rights</h2>
    <h3>For all users</h3>
    <ul>
      <li>Access, correct, or delete your data</li>
      <li>Export everything as JSON or ZIP</li>
      <li>Withdraw consent for AI processing or analytics</li>
    </ul>
    <h3>For EU / UK users (GDPR)</h3>
    <ul>
      <li>Restrict or object to processing</li>
      <li>Lodge a complaint with your supervisory authority</li>
      <li>No automated decision-making — AI grading always includes human review</li>
    </ul>
    <h3>For California users (CCPA / CPRA)</h3>
    <ul>
      <li>Know what we collect, delete it, opt out of sale (we do not sell)</li>
      <li>Non-discrimination for exercising your rights</li>
    </ul>

    <h2 id="s12">12. International Data Transfers</h2>
    <p>Data is stored in the United States via Supabase. EU/UK transfers are protected by Standard Contractual Clauses with our processors. By using ClassGenie from outside the US, you consent to this transfer.</p>

    <h2 id="s13">13. Changes to This Policy</h2>
    <p>We notify you by email of material changes at least 30 days before they take effect. Continued use after the effective date constitutes acceptance. Previous versions are archived and available on request.</p>

    <h2 id="s14">14. Contact Us</h2>
    <p>Email: <strong>hello@homescholarapp.com</strong><br/>
    Mail: Soleo Technologies, Austin, TX<br/>
    Children's privacy requests: subject line "Children's Privacy Request"<br/>
    Response time: within 30 days (45 days for complex requests, with notice)</p>
  </LegalShell>
);

// ============ TERMS OF SERVICE ============
const TermsPage = () => (
  <LegalShell
    title="Terms of Service"
    eyebrow={<><span>📜</span> The agreement between us</>}
    currentPage="terms"
    toc={[
      'Agreement to Terms', 'Description of Service', 'Account Registration',
      'Subscription & Payment', 'Acceptable Use', 'AI-Generated Content',
      'Your Content & Data', 'Intellectual Property', 'Co-op Features',
      'Third-Party Services', 'Disclaimer of Warranties', 'Limitation of Liability',
      'Indemnification', 'Termination', 'Governing Law', 'Changes to Terms',
      'Severability', 'Contact'
    ]}
  >
    <h2 id="s1">1. Agreement to Terms</h2>
    <p>By creating a ClassGenie account, you agree to these Terms. You must be 18 or older to create a parent or teacher account. Student accounts are created and managed by their parent or teacher account holder. If you do not agree, please do not use the service.</p>

    <h2 id="s2">2. Description of Service</h2>
    <p>ClassGenie is a homeschool management platform that provides curriculum planning, gradebook, assignment tracking, AI-powered content generation, transcript and report card generation, state-compliant document templates, co-op management, student progress tracking, and a calendar. Features may evolve over time; we provide reasonable notice of significant changes.</p>

    <h2 id="s3">3. Account Registration and Security</h2>
    <ul>
      <li>Provide accurate information when signing up</li>
      <li>Maintain the security of your password</li>
      <li>Notify us immediately of any unauthorized access</li>
      <li>One parent / teacher account per person; student accounts are linked to a parent</li>
      <li>You are responsible for all activity under your account and any student profiles you create</li>
    </ul>

    <h2 id="s4">4. Subscription and Payment</h2>
    <ul>
      <li><strong>Free to start</strong> — no credit card required; your first 14 days include everything in Pro, then the free plan continues with core tools and 10 AI generations a month</li>
      <li><strong>Pro: $16.99 / month or $99 / year</strong> (Founding Family annual price, locked in while your subscription stays active); processed by Stripe</li>
      <li>Auto-renews monthly until cancelled. Cancel anytime from Account Settings; cancellation takes effect at the end of the current billing period</li>
      <li><strong>30-day money-back guarantee</strong> on your first paid month — no questions asked</li>
      <li>No refunds for partial months after that</li>
      <li>If we change pricing, existing subscribers keep their current rate for 12 months from notice</li>
      <li>If payment fails, your account enters read-only mode after a 3-day grace period — no data is deleted</li>
    </ul>

    <h2 id="s5">5. Acceptable Use</h2>
    <p>ClassGenie is for personal, non-commercial educational use — homeschooling your own children or managing your co-op. See our full <a href="acceptable-use.html" style={{ color: 'var(--primary-purple)', fontWeight: 600 }}>Acceptable Use Policy</a>. You may <strong>not</strong>:</p>
    <ul>
      <li>Share your account outside your household</li>
      <li>Use the service for a commercial tutoring business without a separate license</li>
      <li>Upload illegal, harmful, or inappropriate content</li>
      <li>Reverse-engineer, hack, or compromise the service</li>
      <li>Scrape or redistribute AI-generated content at scale</li>
      <li>Create accounts for children you are not the parent or legal guardian of</li>
      <li>Impersonate another person or interfere with the service's operation</li>
    </ul>

    <h2 id="s6">6. AI-Generated Content</h2>
    <p>ClassGenie uses Google Gemini to generate educational materials. AI-generated content is a starting point and educational aid — <strong>not</strong> a substitute for parental or teacher judgment. AI-suggested grades are suggestions only and require your approval before becoming final. AI-generated legal templates (homeschool compliance forms) are based on general state requirements and are not legal advice — review them before filing.</p>
    <p>You retain ownership of content you create using AI tools. We do not guarantee AI-generated content is error-free.</p>

    <h2 id="s7">7. Your Content and Data</h2>
    <p>You retain ownership of everything you upload — student work, photos, notes, curriculum plans. You grant ClassGenie a limited license to store, process, display, and back up your content for the sole purpose of providing the service. This license ends when you delete the content or your account. You can export everything at any time.</p>

    <h2 id="s8">8. Intellectual Property</h2>
    <p>ClassGenie's platform, original content, name, logo, and mascot are owned by Soleo Technologies. You may not copy, modify, or distribute our proprietary content or code outside personal educational use within the service.</p>

    <h2 id="s9">9. Co-op Features</h2>
    <p>Co-op administrators are responsible for managing their co-op's members and data. ClassGenie provides the tooling — we do not make governance decisions. Members can leave at any time; their personal data remains under their own account.</p>

    <h2 id="s10">10. Third-Party Services and Links</h2>
    <p>ClassGenie integrates with Google Calendar, Apple Calendar, and Outlook. We are not responsible for third-party services' privacy practices, accuracy, or availability. External links are provided for convenience and do not imply endorsement.</p>

    <h2 id="s11">11. Disclaimer of Warranties</h2>
    <p>ClassGenie is provided <strong>"as is"</strong> and <strong>"as available."</strong> We do not warrant uninterrupted, error-free, or completely secure operation. We do not warrant AI-generated content is accurate or suitable for any specific purpose. Homeschool compliance documents are templates — you are responsible for verifying compliance with your state's requirements.</p>

    <h2 id="s12">12. Limitation of Liability</h2>
    <p>To the maximum extent permitted by law, Soleo Technologies is not liable for indirect, incidental, special, consequential, or punitive damages, loss of data beyond our reasonable security obligations, errors in AI-generated content, or actions taken based on generated transcripts or legal documents. Our total liability is capped at the amount you paid us in the 12 months preceding the claim. Nothing limits liability for negligence-caused personal injury, fraud, or any liability that cannot be excluded by law.</p>

    <h2 id="s13">13. Indemnification</h2>
    <p>You agree to indemnify Soleo Technologies against claims arising from your violation of these Terms, your use of the service, content you upload, or your violation of any law or third-party rights.</p>

    <h2 id="s14">14. Termination</h2>
    <p>You can cancel your subscription and delete your account anytime. We may suspend accounts for violation of these Terms with notice. We may discontinue the service with 90 days' notice and a prorated refund. Upon termination, you have 30 days to export your data before deletion.</p>

    <h2 id="s15">15. Governing Law and Disputes</h2>
    <p>These Terms are governed by Texas law. Disputes are first attempted via informal negotiation (30 days). If unresolved, disputes are resolved by binding arbitration under the American Arbitration Association rules in Austin, Texas. Class action waiver applies. Either party may bring claims in small claims court in Travis County.</p>

    <h2 id="s16">16. Changes to Terms</h2>
    <p>We notify you of material changes 30 days in advance via email. Continued use after the effective date constitutes acceptance. If you disagree, cancel for a prorated refund of the remaining subscription.</p>

    <h2 id="s17">17. Severability and Entire Agreement</h2>
    <p>If any provision is unenforceable, the rest remain in effect. These Terms plus the Privacy Policy constitute the entire agreement.</p>

    <h2 id="s18">18. Contact</h2>
    <p><strong>hello@homescholarapp.com</strong> · Soleo Technologies, Austin, TX</p>
  </LegalShell>
);

// ============ COOKIE POLICY ============
const CookiesPage = () => (
  <LegalShell
    title="Cookie Policy"
    eyebrow={<><span>🍪</span> Plain-English cookie disclosure</>}
    currentPage="cookies"
  >
    <h2>1. What Are Cookies</h2>
    <p>Cookies are small text files that websites store on your device to remember things — that you're logged in, what theme you prefer, how you used the site. Some are essential; some are optional.</p>

    <h2>2. Cookies We Use</h2>
    <h3>Essential cookies (no consent required)</h3>
    <ul>
      <li>Supabase authentication session cookies</li>
      <li>CSRF protection tokens</li>
      <li>User preference cookies (theme, sidebar state)</li>
    </ul>
    <p>These cannot be disabled — the app needs them to function.</p>

    <h3>Analytics cookies (consent required)</h3>
    <p><strong>Google Analytics 4</strong> (<code>_ga</code>, <code>_ga_*</code>, <code>_gid</code>)</p>
    <ul>
      <li>Purpose: understand how visitors use our site</li>
      <li>Data: pages, time, referral source, device, anonymized IP</li>
      <li>Retention: 14 months</li>
      <li>Opt-out: Google's opt-out add-on, or block cookies in your browser settings</li>
      <li>Privacy policy: <a href="https://policies.google.com/privacy" style={{ color: 'var(--primary-purple)' }}>policies.google.com/privacy</a></li>
    </ul>
    <p><strong>Microsoft Clarity</strong> (<code>_clck</code>, <code>_clsk</code>, <code>CLID</code>)</p>
    <ul>
      <li>Purpose: session replays and heatmaps</li>
      <li>Sensitive fields like student names and grades are masked</li>
      <li>Retention: 13 months</li>
      <li>Opt-out: block cookies in your browser settings</li>
      <li>Privacy policy: <a href="https://privacy.microsoft.com/privacystatement" style={{ color: 'var(--primary-purple)' }}>privacy.microsoft.com/privacystatement</a></li>
    </ul>

    <h3>No advertising cookies</h3>
    <div className="callout">
      ClassGenie does <strong>not</strong> use advertising, retargeting, or social-media tracking cookies. We do not allow third-party advertising on our platform.
    </div>

    <h2>3. How to Manage Cookies</h2>
    <ul>
      <li>Analytics cookies are set automatically; see the opt-out options above</li>
      <li>Change preferences anytime via the "Cookie Settings" link in the footer</li>
      <li>Block or delete cookies via your browser settings</li>
    </ul>
    <p>Note: blocking essential cookies will prevent the app from working.</p>

    <h2>4. Children and Cookies</h2>
    <p>Analytics cookies are not activated until a parent gives consent via the banner. We minimize cookie use on student-facing pages. No tracking or profiling cookies are used anywhere on ClassGenie.</p>

    <h2>5. Updates</h2>
    <p>We update this policy as our cookie usage changes. Last updated: {LAST_UPDATED}.</p>
  </LegalShell>
);

// ============ ACCEPTABLE USE POLICY ============
const AcceptableUsePage = () => (
  <LegalShell
    title="Acceptable Use Policy"
    eyebrow={<><span>✅</span> What you can and can't do</>}
    currentPage="acceptable-use"
  >
    <h2>Permitted uses</h2>
    <ul>
      <li>Managing your family's homeschool education</li>
      <li>Creating curriculum plans, assignments, and educational materials</li>
      <li>Tracking grades and progress for your own children</li>
      <li>Generating transcripts and educational documents</li>
      <li>Participating in homeschool co-ops</li>
      <li>Using AI tools to generate educational content for your students</li>
    </ul>

    <h2>Prohibited uses</h2>
    <ul>
      <li>Using ClassGenie for commercial tutoring or paid educational services without a commercial license</li>
      <li>Creating accounts for children you are not the parent or legal guardian of</li>
      <li>Uploading content that is illegal, harmful, abusive, or inappropriate for an educational setting</li>
      <li>Uploading content that infringes copyright or intellectual property rights</li>
      <li>Attempting to access other users' data or accounts</li>
      <li>Reverse-engineering, decompiling, or extracting source code</li>
      <li>Using automated scripts or bots to access the service</li>
      <li>Reselling or redistributing the service or AI-generated content at scale</li>
      <li>Using AI tools to generate non-educational content</li>
      <li>Circumventing security features or access controls</li>
      <li>Using the service while subject to sanctions or in a sanctioned country</li>
    </ul>

    <h2>Enforcement</h2>
    <ul>
      <li>Violations may result in a warning, suspension, or termination</li>
      <li>Serious violations (unauthorized access, illegal content) cause immediate termination</li>
      <li>We may report illegal activity to law enforcement</li>
      <li>Terminated users may request data export within 30 days</li>
    </ul>
    <p>Questions? <strong>hello@homescholarapp.com</strong></p>
  </LegalShell>
);

// ============ REFUND POLICY ============
const RefundPage = () => (
  <LegalShell
    title="Refund Policy"
    eyebrow={<><span>💸</span> Money-back guarantee · cancel anytime</>}
    currentPage="refunds"
  >
    <h2>The short version</h2>
    <ul>
      <li><strong>Free to start</strong> — no credit card required, no charges until you upgrade</li>
      <li><strong>Pro: $16.99 / month or $99 / year</strong> — cancel anytime, takes effect at end of billing period</li>
      <li><strong>30-day money-back guarantee</strong> — unsatisfied in your first 30 days? Email us for a full refund. No questions.</li>
      <li><strong>After 30 days</strong> — no refunds for remaining subscription time. Cancel anytime to prevent future charges.</li>
    </ul>

    <h2>How to cancel</h2>
    <p>Account Settings → Subscription → Cancel Subscription. Or email <strong>hello@homescholarapp.com</strong>.</p>

    <h2>What happens when you cancel</h2>
    <p>Your data stays accessible in read-only mode through the end of your billing period. After that, you have 30 days to export everything before your account and data are permanently deleted.</p>

    <h2>Price changes</h2>
    <p>If we ever raise prices, existing subscribers keep their current rate for 12 months from the change notice. We notify you 30 days before any new rate applies.</p>
  </LegalShell>
);

// ============ CHILD SAFETY PAGE ============
const ChildSafetyPage = () => (
  <LegalShell
    title="Child Safety & Trust"
    eyebrow={<><span>🛡️</span> How we protect your kids</>}
    currentPage="safety"
  >
    <p>We built ClassGenie around a single belief: a child's data is sacred. Here's exactly how we live that out.</p>

    <h2>Parent-first by design</h2>
    <ul>
      <li>Children cannot create independent accounts on ClassGenie</li>
      <li>Every student profile is created and controlled by a verified parent or legal guardian</li>
      <li>Parents review and approve any AI-suggested grades before they become final</li>
      <li>Parents can review, export, or delete their child's data at any time</li>
    </ul>

    <h2>What we collect about children — and what we don't</h2>
    <p>We collect first name and last initial (or nickname), grade level (not full date of birth), parent-entered notes about learning style, and the academic work parents choose to track. We <strong>do not</strong> collect a child's full date of birth, location data, contacts, browsing history outside ClassGenie, or biometrics.</p>

    <h2>No advertising. No profiling. No selling.</h2>
    <div className="callout">
      We do not use children's data for advertising. We do not build behavioral profiles. We do not sell or rent children's data to anyone, ever. We do not allow third-party advertising on ClassGenie.
    </div>

    <h2>AI safety</h2>
    <ul>
      <li>Children's names and photos are <strong>never</strong> sent to our AI provider</li>
      <li>Google Gemini does not retain or train on ClassGenie data (per their API terms)</li>
      <li>AI-generated grades are suggestions only — a human parent must approve them</li>
      <li>You can disable AI processing entirely in Account Settings</li>
    </ul>

    <h2>Security</h2>
    <ul>
      <li>TLS encryption in transit, AES encryption at rest</li>
      <li>Row Level Security so data is isolated per family</li>
      <li>bcrypt password hashing</li>
      <li>72-hour breach notification commitment</li>
    </ul>

    <h2>Compliance</h2>
    <p>ClassGenie is designed to comply with COPPA (including the April 2025 amendments enforceable April 22, 2026), GDPR, the UK Children's Code, CCPA / CPRA, and US state student-privacy laws.</p>

    <h2>Reporting concerns</h2>
    <p>If you're worried about how a child's data is being handled — yours, your co-op's, anyone's — email <strong>hello@homescholarapp.com</strong> with the subject "Safety Concern." We respond within one business day.</p>

    <h2>Talk to us</h2>
    <p>Laura Dovalina, the founder, reads every safety email personally. She's a homeschool mom of three. She built this for her kids first.</p>
  </LegalShell>
);

Object.assign(window, { PrivacyPage, TermsPage, CookiesPage, AcceptableUsePage, RefundPage, ChildSafetyPage });
