:root {
  --soft-blue: #005b9f;
  --soft-blue-deep: #003f6e;
  --sutra-orange: #ff6b00;
  --paper: #f8fbff;
  --surface: rgba(255, 255, 255, 0.82);
  --line: rgba(15, 23, 42, 0.1);
  --text-main: #0f172a;
          <h3>Company</h3>
          <p>SoftSutra</p>
          <p>Founder: Raman Sharma</p>
          <p>VPO Sarsa, District Kurukshetra, Haryana, India</p>
          <p><a href="mailto:softsutra@zohomail.in">softsutra@zohomail.in</a></p>
        </section>

        <section class="footer-card">
          <h3>Quick Links</h3>
          <p><a href="./">Home</a></p>
          <p><a href="privacypolicy/">Privacy Policy</a></p>
          <p><a href="termsofservice/">Terms of Service</a></p>
  --shadow-xl: 0 28px 72px rgba(15, 23, 42, 0.14);
  --shadow-lg: 0 14px 32px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shell: min(1080px, calc(100% - 2rem));
  --font-body: "Segoe UI Variable", "Trebuchet MS", Verdana, sans-serif;
  --font-display: "Bahnschrift", "Franklin Gothic Demi", sans-serif;
}


function New-LegalHtml {
  param(
    [Parameter(Mandatory = $true)] [hashtable] $Product,
    [Parameter(Mandatory = $true)] [hashtable] $Profile,
    [Parameter(Mandatory = $true)] [ValidateSet("privacy", "terms")] [string] $Kind
  )

  $pageTitle = if ($Kind -eq "privacy") { "Privacy Policy" } else { "Terms of Service" }
  $canonicalPath = if ($Kind -eq "privacy") { "privacypolicy/" } else { "termsofservice/" }
  $mailSubject = [Uri]::EscapeDataString("$($Product.Name) legal inquiry")
  $dataItems = ($Profile.DataCategories | ForEach-Object { "          <li>$_</li>" }) -join "`n"
  $permissionItems = ($Profile.Permissions | ForEach-Object { "          <li>$_</li>" }) -join "`n"
  $serviceItems = ($Profile.Services | ForEach-Object { "          <li>$_</li>" }) -join "`n"
  $useItems = ($Profile.UseCases | ForEach-Object { "          <li>$_</li>" }) -join "`n"
  $allowedItems = ($Profile.AllowedUse | ForEach-Object { "          <li>$_</li>" }) -join "`n"
  $restrictedItems = ($Profile.Restrictions | ForEach-Object { "          <li>$_</li>" }) -join "`n"

  $content = if ($Kind -eq "privacy") {
@"
      <div class="layout">
        <section class="section">
          <p class="section__eyebrow">Overview</p>
          <h2 class="section__title">How <span>$($Product.Name)</span> handles data</h2>
          <p class="section__copy">$($Profile.Summary)</p>
        </section>

        <section class="section">
          <p class="section__eyebrow">Data Categories</p>
          <p class="section__copy">These are the main information categories relevant to the current app and its related product workflows.</p>
          <ul class="detail-list">
$dataItems
          </ul>
        </section>

        <section class="section">
          <p class="section__eyebrow">Permissions And Services</p>
          <p class="section__copy">The product only uses device access and connected services that are required for the features described in its own project source.</p>
          <ul class="detail-list">
$permissionItems
$serviceItems
          </ul>
        </section>

        <section class="section">
          <p class="section__eyebrow">How The Data Is Used</p>
          <ul class="detail-list">
$useItems
          </ul>
          <p class="section__copy">$($Profile.Retention)</p>
          <p class="section__copy">$($Profile.Security)</p>
        </section>
      </div>
"@
  } else {
@"
      <div class="layout">
        <section class="section">
          <p class="section__eyebrow">Service Scope</p>
          <h2 class="section__title">Using <span>$($Product.Name)</span> responsibly</h2>
          <p class="section__copy">$($Profile.TermsSummary)</p>
        </section>

        <section class="section">
          <p class="section__eyebrow">Allowed Use</p>
          <ul class="detail-list">
$allowedItems
          </ul>
        </section>

        <section class="section">
          <p class="section__eyebrow">Restricted Conduct</p>
          <ul class="detail-list">
$restrictedItems
          </ul>
        </section>

        <section class="section">
          <p class="section__eyebrow">Release And Support</p>
          <p class="section__copy">$($Profile.Support)</p>
          <p class="section__copy">$($Profile.Liability)</p>
        </section>
      </div>
"@
  }

  return @"
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>$pageTitle | $($Product.Name) | SoftSutra</title>
  <meta name="description" content="$pageTitle for $($Product.Name) by SoftSutra.">
  <meta name="theme-color" content="#F8FBFF">
  <meta name="color-scheme" content="light">
  <meta name="referrer" content="strict-origin-when-cross-origin">
  <meta http-equiv="Content-Security-Policy" content="default-src 'self'; base-uri 'self'; form-action 'self'; object-src 'none'; script-src 'none'; style-src 'self'; img-src 'self' data:; font-src 'self'; connect-src 'none'; manifest-src 'self'; media-src 'none'; worker-src 'none'; upgrade-insecure-requests; block-all-mixed-content">
  <link rel="canonical" href="https://$($Product.Slug).softsutra.online/$canonicalPath">
  <link rel="stylesheet" href="../assets/css/styles.css">
</head>
<body>
  <main class="page">
    <div class="shell">
      <section class="hero">
        <div class="brand-row">
          <a class="brand" href="https://softsutra.online/" aria-label="SoftSutra home">
            <span class="brand__soft">Soft</span><span class="brand__sutra">Sutra</span>
          </a>
          <span class="chip">$pageTitle</span>
        </div>

        <p class="hero__eyebrow">Legal Information</p>
        <h1 class="hero__title">$($Product.Name) <span>$pageTitle</span></h1>
        <p class="hero__copy">This page applies to the official $($Product.Name) website and related SoftSutra-managed product surfaces described for this subdomain.</p>

        <div class="actions">
          <a class="button button--primary" href="../">Back to $($Product.Name)</a>
          <a class="button button--secondary" href="mailto:softsutra@zohomail.in?subject=$mailSubject">Contact SoftSutra</a>
        </div>
      </section>

$content

      <div class="footer-grid">
        <section class="footer-card">
          <h3>Company</h3>
          <p>SoftSutra</p>
          <p>Founder: Raman Sharma</p>
          <p>VPO Sarsa, District Kurukshetra, Haryana, India</p>
          <p><a href="mailto:softsutra@zohomail.in">softsutra@zohomail.in</a></p>
        </section>

        <section class="footer-card">
          <h3>Navigation</h3>
          <p><a href="../">Product Home</a></p>
          <p><a href="../privacypolicy/">Privacy Policy</a></p>
          <p><a href="../termsofservice/">Terms of Service</a></p>
          <p><a href="https://softsutra.online/">Main SoftSutra Site</a></p>
        </section>
      </div>

      <p class="legal">Copyright 2026 SoftSutra. All rights reserved.</p>
    </div>
  </main>
</body>
</html>
"@
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 10%, rgba(0, 91, 159, 0.15), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(255, 107, 0, 0.16), transparent 24%),
    linear-gradient(180deg, #fcfdff 0%, var(--paper) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: var(--shell);
  margin: 0 auto;
}

.page {
  padding: 2rem 0 4rem;
}

.hero,
.section,
.footer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hero {
  padding: 2rem;
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.brand__soft {
  color: var(--soft-blue);
}

.brand__sutra {
  color: var(--sutra-orange);
}

.hero__eyebrow,
.section__eyebrow {
  margin: 1.25rem 0 0;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft-blue);
}

.hero__title,
.section__title {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.95;
}

.hero__title span,
.section__title span {
  color: var(--sutra-orange);
}

.hero__copy,
.section__copy,
.footer-card p,
.detail-list {
  color: var(--text-copy);
  line-height: 1.65;
}

.chip-row,
.actions,
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-pill);
  background: rgba(0, 91, 159, 0.08);
  border: 1px solid rgba(0, 91, 159, 0.12);
  color: var(--soft-blue-deep);
  font-weight: 700;
}

.actions {
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 700;
}

.button--primary {
  background: linear-gradient(135deg, var(--soft-blue) 0%, var(--soft-blue-deep) 100%);
  color: #fff;
}

.button--secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-main);
  border-color: rgba(15, 23, 42, 0.12);
}

.layout {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.section {
  padding: 1.6rem;
}

.detail-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.detail-list li + li {
  margin-top: 0.7rem;
}

.footer-grid {
  margin-top: 1.25rem;
}

.footer-card {
  flex: 1 1 280px;
  padding: 1.3rem;
  box-shadow: var(--shadow-lg);
}

.footer-card h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
}

.footer-card p {
  margin: 0;
}

.legal {
  margin: 1rem 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .page {
    padding-top: 1rem;
  }

  .hero,
  .section,
  .footer-card {
    padding: 1.25rem;
  }

  .hero__title,
  .section__title {
    font-size: clamp(2rem, 12vw, 3rem);
  }
}
