diff --git a/web/wwwroot/legal/cookies-en.html b/web/wwwroot/legal/cookies-en.html
index eb8d57c..3df8089 100644
--- a/web/wwwroot/legal/cookies-en.html
+++ b/web/wwwroot/legal/cookies-en.html
@@ -9,24 +9,6 @@
-
Cookies
@@ -71,16 +53,6 @@
-
-
-
diff --git a/web/wwwroot/legal/cookies-ro.html b/web/wwwroot/legal/cookies-ro.html
index d884615..7a7d41d 100644
--- a/web/wwwroot/legal/cookies-ro.html
+++ b/web/wwwroot/legal/cookies-ro.html
@@ -9,24 +9,6 @@
-
Cookies
@@ -71,16 +53,6 @@
-
-
-
diff --git a/web/wwwroot/legal/js/legal.js b/web/wwwroot/legal/js/legal.js
index aeeee68..b72e16f 100644
--- a/web/wwwroot/legal/js/legal.js
+++ b/web/wwwroot/legal/js/legal.js
@@ -1,23 +1,134 @@
-
+/**
+ * Legal Pages Helper
+ *
+ * Dynamically injects a common header (topbar) and language-aware footer
+ * into all 6 legal pages to eliminate HTML duplication.
+ *
+ * Footer content depends on page language (EN vs RO).
+ * Language links use event delegation so they work on injected elements.
+ */
(function(){
- function browserLang(){
- var lang = (navigator.language || navigator.userLanguage || 'en').toLowerCase();
- return lang.indexOf('ro') === 0 ? 'ro' : 'en';
- }
- function targetPage(current, lang){
- if(current.indexOf('-ro.html') !== -1) return current.replace('-ro.html', '-' + lang + '.html');
- if(current.indexOf('-en.html') !== -1) return current.replace('-en.html', '-' + lang + '.html');
- return current;
- }
- var links = document.querySelectorAll('.lang-link');
- for(var i=0;i' +
+ '
' +
+ '' + (lang === 'ro' ? 'Înapoi' : 'Back') + '' +
+ '' +
+ '' +
+ '';
+ $('.wrap').prepend(html);
+ }
+
+ /**
+ * Inject language-aware footer.
+ * EN: "©2026 myAi. All rights reserved."
+ * RO: "©2026 myAi. Toate drepturile sunt rezervate."
+ */
+ function injectFooter(){
+ var lang = pageLang();
+ var base = basePage();
+ var copyrightText = lang === 'ro' ? '©2026 myAi. Toate drepturile sunt rezervate.' : '©2026 myAi. All rights reserved.';
+ var linksHtml = '';
+ if(lang === 'ro'){
+ linksHtml = 'Termeni și condiții' +
+ 'Politica de confidențialitate' +
+ 'Politica de COOKIES';
+ } else {
+ linksHtml = 'Terms and Conditions' +
+ 'Privacy Policy' +
+ 'Cookies Policy';
+ }
+ var html = '';
+ $('.wrap').append(html);
+ }
+
+ /**
+ * Initialize language persistence and topbar injection.
+ */
+ function init(){
+ localStorage.setItem(LANG_KEY, pageLang());
+ injectTopbar();
+ injectFooter();
+ }
+
+ /**
+ * Handle language link clicks with event delegation.
+ * Works on both static and injected links.
+ */
+ document.addEventListener('click', function(e){
+ var link = e.target.closest('.lang-link');
+ if(!link) return;
+ e.preventDefault();
+ localStorage.setItem(LANG_KEY, link.getAttribute('data-lang'));
+ window.location.href = targetPage(window.location.pathname, link.getAttribute('data-lang'));
+ });
+
+ // Run on page load
+ if(document.readyState === 'loading'){
+ document.addEventListener('DOMContentLoaded', init);
+ } else {
+ init();
+ }
})();
diff --git a/web/wwwroot/legal/privacy-en.html b/web/wwwroot/legal/privacy-en.html
index 2e2c29e..64a6a6a 100644
--- a/web/wwwroot/legal/privacy-en.html
+++ b/web/wwwroot/legal/privacy-en.html
@@ -9,24 +9,6 @@
-
Data protection
@@ -109,16 +91,6 @@
-
-
-
diff --git a/web/wwwroot/legal/privacy-ro.html b/web/wwwroot/legal/privacy-ro.html
index 785e88e..334dcd7 100644
--- a/web/wwwroot/legal/privacy-ro.html
+++ b/web/wwwroot/legal/privacy-ro.html
@@ -9,24 +9,6 @@
-
Protecția datelor
@@ -109,16 +91,6 @@
-
-
-
diff --git a/web/wwwroot/legal/terms-en.html b/web/wwwroot/legal/terms-en.html
index 5352b4f..9678e9c 100644
--- a/web/wwwroot/legal/terms-en.html
+++ b/web/wwwroot/legal/terms-en.html
@@ -9,24 +9,6 @@
-
Terms of use
@@ -69,16 +51,6 @@
-
-
-
diff --git a/web/wwwroot/legal/terms-ro.html b/web/wwwroot/legal/terms-ro.html
index c927a0c..a1ab59e 100644
--- a/web/wwwroot/legal/terms-ro.html
+++ b/web/wwwroot/legal/terms-ro.html
@@ -9,24 +9,6 @@
-
Condiții de utilizare
@@ -69,16 +51,6 @@
-
-
-