/* Stanley Bankruptcy Law — Legal pages: Privacy Policy & Terms of Service */

function LegalPageHead({ title, subtitle }) {
  return (
    <div style={{ background: 'var(--brand)', position: 'relative', overflow: 'hidden' }}>
      <div style={{ position: 'absolute', inset: 0, background: 'radial-gradient(110% 100% at 90% 0%, rgba(200,151,47,0.14) 0%, transparent 55%)' }} />
      <div style={{ position: 'absolute', inset: 0, background: 'repeating-linear-gradient(125deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 30px)' }} />
      <div className="page-head-inner" style={{ position: 'relative', maxWidth: 'var(--container-narrow)', margin: '0 auto', padding: '70px 24px 64px', textAlign: 'center' }}>
        <Eyebrow onBrand>Stanley Bankruptcy Law</Eyebrow>
        <h1 className="page-head-h1" style={{ color: '#F7F5EE', fontSize: '44px', lineHeight: 1.08, margin: '0 auto 16px', maxWidth: '20ch' }}>{title}</h1>
        {subtitle && <p style={{ color: '#D7E3DA', fontSize: '18px', lineHeight: 1.6, margin: '0 auto', maxWidth: '58ch' }}>{subtitle}</p>}
      </div>
    </div>
  );
}

function LegalSection({ title, children }) {
  return (
    <div style={{ marginBottom: '32px' }}>
      <h2 style={{
        fontFamily: 'var(--font-display)',
        fontSize: '21px',
        fontWeight: 600,
        color: 'var(--text-strong)',
        margin: '0 0 10px',
        paddingBottom: '10px',
        borderBottom: '1px solid var(--border)'
      }}>{title}</h2>
      <div style={{ fontFamily: 'var(--font-sans)', fontSize: '16px', lineHeight: 1.75, color: 'var(--ink-700)' }}>
        {children}
      </div>
    </div>
  );
}

function PrivacyPolicyPage({ navigate }) {
  return (
    <main>
      <LegalPageHead
        title="Privacy Policy"
        subtitle="How Stanley Bankruptcy Law PLLC collects, uses, and protects your personal information."
      />
      <Section bg="paper" narrow>
        <p style={{ fontFamily: 'var(--font-sans)', fontSize: '13.5px', color: 'var(--text-muted)', margin: '0 0 40px' }}>Effective date: June 29, 2026</p>

        <LegalSection title="Introduction">
          <p style={{ margin: '0' }}>Stanley Bankruptcy Law PLLC ("we," "us," or "our") is committed to protecting your privacy. This Privacy Policy explains how we collect, use, and disclose your personal information.</p>
        </LegalSection>

        <LegalSection title="Information We Collect">
          <p style={{ margin: '0' }}>We collect information you provide directly to us, such as when you fill out a contact form, request a consultation, or provide your phone number for text notifications. This may include your name, email address, phone number, and case-related details.</p>
        </LegalSection>

        <LegalSection title="How We Use Your Information">
          <p style={{ margin: '0' }}>We use your information to provide legal services, communicate updates about your case, and respond to your inquiries.</p>
        </LegalSection>

        <LegalSection title="Sharing of Information & SMS Opt-In Data">
          <p style={{ margin: '0' }}>We do not sell, rent, or lease your personal information to third parties. No mobile information will be shared with third parties/affiliates for marketing/promotional purposes. All the above categories exclude text messaging originator opt-in data and consent; this information will not be shared with any third parties.</p>
        </LegalSection>

        <LegalSection title="Security">
          <p style={{ margin: '0' }}>We implement reasonable administrative, technical, and physical safeguards to protect your personal information against unauthorized access, disclosure, or destruction.</p>
        </LegalSection>

        <LegalSection title="Contact Us">
          <p style={{ margin: '0' }}>If you have questions about this Privacy Policy, please contact us at{' '}
            <a href="mailto:dalton@stanleybankruptcylaw.com" style={{ color: 'var(--brand)', fontWeight: 600 }}>dalton@stanleybankruptcylaw.com</a>
            {' '}or by mail at 156 Ky Oil Village, Betsy Layne, KY 41605.
          </p>
        </LegalSection>

        <div style={{ marginTop: '48px', paddingTop: '24px', borderTop: '1px solid var(--border)', display: 'flex', gap: '12px', flexWrap: 'wrap' }}>
          <a href={window.hrefFor ? window.hrefFor('terms') : '#'}
            onClick={(e) => { e.preventDefault(); navigate('terms'); }}
            style={{ fontFamily: 'var(--font-sans)', fontSize: '14px', fontWeight: 600, color: 'var(--brand)', textDecoration: 'none', display: 'inline-flex', alignItems: 'center', gap: '6px' }}>
            <Icon name="arrow-right" size={15} />View Terms of Service
          </a>
        </div>
      </Section>
      <CtaBand navigate={navigate} />
    </main>
  );
}

function TermsPage({ navigate }) {
  return (
    <main>
      <LegalPageHead
        title="Terms of Service"
        subtitle="Terms governing use of the Stanley Bankruptcy Law website and text messaging services."
      />
      <Section bg="paper" narrow>
        <p style={{ fontFamily: 'var(--font-sans)', fontSize: '13.5px', color: 'var(--text-muted)', margin: '0 0 40px' }}>Effective date: June 29, 2026</p>

        <LegalSection title="Introduction">
          <p style={{ margin: '0' }}>Welcome to the website of Stanley Bankruptcy Law PLLC. By accessing our website or opting into our text notification services, you agree to these Terms of Service.</p>
        </LegalSection>

        <LegalSection title="NextMessage / SMS Notifications">
          <p style={{ margin: '0' }}>By providing your phone number and opting in, you consent to receive text notifications, case updates, and reminders from Stanley Bankruptcy Law PLLC.</p>
        </LegalSection>

        <LegalSection title="Message Frequency">
          <p style={{ margin: '0' }}>Message frequency varies based on your active case updates and requests.</p>
        </LegalSection>

        <LegalSection title="Fees">
          <p style={{ margin: '0' }}>Message and data rates may apply depending on your mobile carrier plan.</p>
        </LegalSection>

        <LegalSection title="How to Opt-Out">
          <p style={{ margin: '0' }}>You can cancel the SMS service at any time. Just text <strong>"STOP"</strong> to any message you receive. After you send the SMS message "STOP" to us, we will send you an SMS message to confirm that you have been unsubscribed. After this, you will no longer receive SMS messages from us.</p>
        </LegalSection>

        <LegalSection title="How to Get Help">
          <p style={{ margin: '0' }}>If you are experiencing issues with the messaging program you can reply with the keyword <strong>"HELP"</strong> for more assistance, or you can get help directly by emailing{' '}
            <a href="mailto:dalton@stanleybankruptcylaw.com" style={{ color: 'var(--brand)', fontWeight: 600 }}>dalton@stanleybankruptcylaw.com</a>.
          </p>
        </LegalSection>

        <LegalSection title="Disclaimers">
          <p style={{ margin: '0' }}>Mobile carriers are not liable for delayed or undelivered messages. Information sent via text message does not inherently constitute or establish an attorney-client relationship outside of a formal, signed retainer agreement.</p>
        </LegalSection>

        <LegalSection title="Contact Us">
          <p style={{ margin: '0' }}>If you have questions about these Terms, please contact us at{' '}
            <a href="mailto:dalton@stanleybankruptcylaw.com" style={{ color: 'var(--brand)', fontWeight: 600 }}>dalton@stanleybankruptcylaw.com</a>
            {' '}or by mail at 156 Ky Oil Village, Betsy Layne, KY 41605.
          </p>
        </LegalSection>

        <div style={{ marginTop: '48px', paddingTop: '24px', borderTop: '1px solid var(--border)', display: 'flex', gap: '12px', flexWrap: 'wrap' }}>
          <a href={window.hrefFor ? window.hrefFor('privacy-policy') : '#'}
            onClick={(e) => { e.preventDefault(); navigate('privacy-policy'); }}
            style={{ fontFamily: 'var(--font-sans)', fontSize: '14px', fontWeight: 600, color: 'var(--brand)', textDecoration: 'none', display: 'inline-flex', alignItems: 'center', gap: '6px' }}>
            <Icon name="arrow-right" size={15} />View Privacy Policy
          </a>
        </div>
      </Section>
      <CtaBand navigate={navigate} />
    </main>
  );
}

Object.assign(window, { PrivacyPolicyPage, TermsPage });
