<?php
/**
 * Terms of Service Template (Pro+ Feature)
 */
defined('ABSPATH') or exit;

$fajaedeseo_company_name = get_option('fajaedeseo_company_name', get_bloginfo('name'));
$fajaedeseo_website_url = get_option('fajaedeseo_website_url', home_url());
$fajaedeseo_company_email = get_option('fajaedeseo_company_email', get_option('admin_email'));
$fajaedeseo_company_address = get_option('fajaedeseo_company_address', '');
?>

<p><strong>Last updated: <?php echo esc_html(date_i18n(get_option('date_format'))); ?></strong></p>

<h2>1. Agreement to Terms</h2>
<p>By accessing and using <?php echo esc_url($fajaedeseo_website_url); ?> (the "Website"), you accept and agree to be bound by the terms and provision of this agreement. If you do not agree to abide by the above, please do not use this service.</p>

<h2>2. Use License</h2>
<p><?php echo esc_html($fajaedeseo_company_name); ?> grants you a limited license to access and make personal use of the Website. You may not:</p>
<ul>
    <li>Modify, copy, or distribute the content</li>
    <li>Use the Website for commercial purposes without authorization</li>
    <li>Attempt to gain unauthorized access to Website systems</li>
    <li>Transmit harmful code, viruses, or malware</li>
    <li>Harvest or collect data without permission</li>
    <li>Engage in harassment or abusive behavior</li>
</ul>

<h2>3. Fair Use & Acceptable Use Policy</h2>
<p>To ensure a high-quality experience and prevent abuse, the following Fair Use Policy applies to our software, particularly our "Agency" plan:</p>
<ul>
    <li><strong>Agency License Usage:</strong> The "Unlimited" Agency license is intended solely for the purchasing agency to use on their direct clients' websites. You may not publicly share, resell, sub-license, or distribute your license key to third parties.</li>
    <li><strong>Bring Your Own Key (BYOK):</strong> Our software connects to third-party APIs (such as OpenAI and ValueSERP). You are solely responsible for managing your own API keys, usage limits, and billing with these providers. We are not liable for any third-party API costs you incur.</li>
    <li><strong>System Abuse:</strong> You agree not to reverse-engineer our software's licensing mechanism or artificially bypass plan limitations.</li>
</ul>
<p>We reserve the right to monitor unusual license activity. Violation of this Fair Use Policy may result in the immediate suspension or termination of your license without a refund.</p>

<h2>4. Disclaimer of Warranties</h2>
<p>The Website and all content are provided on an "as-is" and "as-available" basis. <?php echo esc_html($fajaedeseo_company_name); ?> makes no warranties, expressed or implied, regarding:</p>
<ul>
    <li>The accuracy or completeness of content</li>
    <li>The functionality or availability of the Website</li>
    <li>Freedom from viruses or harmful components</li>
    <li>Fitness for a particular purpose</li>
</ul>

<h2>5. Limitation of Liability</h2>
<p><?php echo esc_html($fajaedeseo_company_name); ?> shall not be liable for any direct, indirect, incidental, special, or consequential damages arising from your use of or inability to use the Website or services, even if advised of the possibility of such damages.</p>

<h2>6. User Content & Responsibility</h2>
<p>You are solely responsible for any content you post or transmit through the Website. You agree not to post:</p>
<ul>
    <li>Content that is illegal, defamatory, or infringing</li>
    <li>Hate speech, harassment, or threatening content</li>
    <li>Spam, malware, or unsolicited commercial content</li>
    <li>Content that violates intellectual property rights</li>
</ul>

<h2>7. Intellectual Property Rights</h2>
<p>All content on the Website, including but not limited to text, graphics, logos, and software, is the property of <?php echo esc_html($fajaedeseo_company_name); ?> or its content suppliers and is protected by international copyright laws.</p>

<h2>8. Termination of Use</h2>
<p><?php echo esc_html($fajaedeseo_company_name); ?> reserves the right to terminate or restrict your access to the Website at any time, for any reason, without notice or liability.</p>

<h2>9. Third-Party Links</h2>
<p>The Website may contain links to third-party websites. <?php echo esc_html($fajaedeseo_company_name); ?> is not responsible for the content, accuracy, or practices of linked websites. Your use of third-party websites is subject to their terms and conditions.</p>

<h2>10. Indemnification</h2>
<p>You agree to indemnify and hold harmless <?php echo esc_html($fajaedeseo_company_name); ?> and its officers, directors, and employees from any claims, damages, or expenses arising from your violation of these Terms of Service or your use of the Website.</p>

<h2>11. Governing Law</h2>
<p>These Terms of Service are governed by and construed in accordance with applicable laws, and you irrevocably submit to the exclusive jurisdiction of the courts in that location.</p>

<h2>12. Modifications to Terms</h2>
<p><?php echo esc_html($fajaedeseo_company_name); ?> reserves the right to modify these Terms of Service at any time. Your continued use of the Website constitutes acceptance of any modifications.</p>

<h2>13. Contact Information</h2>
<p>For questions about these Terms of Service, please contact us:</p>
<ul>
    <li>Email: <a href="mailto:<?php echo esc_attr($fajaedeseo_company_email); ?>"><?php echo esc_html($fajaedeseo_company_email); ?></a></li>
    <?php if (!empty($fajaedeseo_company_address)) echo '<li>Address: ' . esc_html($fajaedeseo_company_address) . '</li>'; ?>
</ul>
