<?php
include 'auth/function.php';
$brand = htmlspecialchars($site_settings['brand_name'] ?? 'Our Platform');
$siteLink = htmlspecialchars($site_settings['site_link'] ?? '#');
$whatsapp = htmlspecialchars($site_settings['whatsapp_number'] ?? '');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Terms &amp; Conditions — <?php echo $brand; ?></title>
<style>
    :root{ --primary:#6B4EFF; --text:#1A1A24; --muted:#6B7280; --bg:#F8F6FF; }
    *{box-sizing:border-box;}
    body{margin:0;font-family:-apple-system,'Segoe UI',Roboto,sans-serif;background:var(--bg);color:var(--text);line-height:1.7;}
    header{background:#fff;padding:18px 20px;border-bottom:1px solid rgba(0,0,0,.06);position:sticky;top:0;}
    header a{color:var(--primary);text-decoration:none;font-weight:700;font-size:1.05rem;}
    main{max-width:760px;margin:0 auto;padding:32px 20px 80px;}
    h1{font-size:1.6rem;margin-bottom:4px;}
    .updated{color:var(--muted);font-size:.85rem;margin-bottom:28px;}
    h2{font-size:1.15rem;margin-top:34px;margin-bottom:10px;color:var(--primary);}
    p, li{font-size:.95rem;color:#2c2c38;}
    ul{padding-left:20px;}
    footer{text-align:center;padding:24px;color:var(--muted);font-size:.8rem;}
</style>
</head>
<body>
<header><a href="index">&larr; <?php echo $brand; ?></a></header>
<main>
    <h1>Terms &amp; Conditions</h1>
    <p class="updated">Last updated: <?php echo date('d F Y'); ?></p>

    <p>These Terms &amp; Conditions ("Terms") govern your access to and use of <?php echo $brand; ?> (the "Platform"), a UPI payment-link and QR payment-collection service for merchants. By creating an account or using the Platform, you agree to these Terms.</p>

    <h2>1. Eligibility &amp; Account</h2>
    <p>You must be at least 18 years old and legally capable of entering into a binding contract to use the Platform. You are responsible for keeping your login credentials confidential and for all activity under your account.</p>

    <h2>2. Description of Service</h2>
    <p><?php echo $brand; ?> lets merchants generate UPI payment links and QR codes, connect UPI/payment gateway accounts (such as FamPay, PhonePe, Paytm, Google Pay, BharatPe, etc.), and track payment status and collections through a dashboard.</p>

    <h2>3. Not a Bank or Payment Aggregator License Holder</h2>
    <p><?php echo $brand; ?> is a technology platform that helps merchants generate and manage UPI payment links using their own connected UPI/bank accounts. We do not hold, custody, or guarantee any funds. All payments move directly between the payer and the merchant's own connected UPI account via UPI rails; <?php echo $brand; ?> only facilitates link/QR generation and payment-status detection.</p>

    <h2>4. Merchant Responsibilities</h2>
    <ul>
        <li>Provide accurate UPI/merchant details and keep connected accounts (e.g. Gmail used for FamPay verification) valid and accessible.</li>
        <li>Use the Platform only for legitimate, lawful commerce. Fraudulent, deceptive, or illegal use of payment links is strictly prohibited.</li>
        <li>Independently verify received payments before dispatching goods/services, especially during any period of delayed automatic verification.</li>
    </ul>

    <h2>5. Prohibited Uses</h2>
    <p>You may not use the Platform to collect payments for illegal goods/services, to commit fraud, to launder money, or in any way that violates applicable law or UPI/NPCI guidelines.</p>

    <h2>6. Fees</h2>
    <p>Any applicable service or commission fees will be shown to you within the dashboard before you incur them and may change with prior notice.</p>

    <h2>7. Service Availability</h2>
    <p>We aim for high uptime but do not guarantee uninterrupted or error-free service. Payment verification depends on third-party UPI apps/banks and their notification systems, which are outside our control.</p>

    <h2>8. Limitation of Liability</h2>
    <p>To the maximum extent permitted by law, <?php echo $brand; ?> is not liable for indirect, incidental, or consequential damages, including loss of revenue arising from delayed payment verification, third-party gateway outages, or account suspension by a connected provider (e.g. Google, FamPay).</p>

    <h2>9. Termination</h2>
    <p>We may suspend or terminate accounts that violate these Terms or applicable law. You may close your account at any time by contacting us.</p>

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

    <h2>11. Governing Law</h2>
    <p>These Terms are governed by the laws of India, without regard to conflict-of-law principles.</p>

    <h2>12. Contact Us</h2>
    <ul>
        <li>Website: <a href="<?php echo $siteLink; ?>"><?php echo $siteLink; ?></a></li>
        <?php if ($whatsapp): ?><li>WhatsApp: <?php echo $whatsapp; ?></li><?php endif; ?>
    </ul>
</main>
<footer>&copy; <?php echo date('Y'); ?> <?php echo $brand; ?>. All rights reserved.</footer>
</body>
</html>
