/* 🌍 Variabili */
:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #e5e7eb;
  --secondary-hover: #d1d5db;
  --text-color: #1f2937;
  --bg-color: #f9fafb;
  --container-radius: 8px;
  --container-shadow: rgba(0, 0, 0, 0.1);
  --font-family: 'Inter', sans-serif;
  --z-index-topbar: 1002;
  --z-index-menu: 1003;
  --z-index-overlay: 1001;
  --z-index-button: 10010;

    /* Alias o compatibilità */
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --text: #333333;
  --border-radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: auto;
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text);
  padding: 10px;
  max-width: 1200px;
}

body.loading {
  visibility: hidden;
}

h1, h2, h3 {
  color: #1f2937;
  text-align: center;
}

/* 📦 Container */
.container {
  margin: 100px auto 0 auto;
  background-color: #ffffff;
  padding: 30px 20px;
  border-radius: var(--container-radius);
  box-shadow: 0 4px 12px var(--container-shadow);
  max-width: 600px;
  width: 100%;
  font-family: var(--font-family);
  color: var(--text-color);
}

/* 🧭 Topbar */
#topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #ffffff;
  color: #1f2937;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-index-topbar);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
#topbar h1 {
  font-size: 1.25rem;
  margin: 0;
}

/* 🍔 Hamburger & Dark Mode */
#hamburgerBtn,
#theme-toggle,
#langSelect  {
  all: unset;
  position: fixed;
  top: 10px;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-index-button);
  background: none;
  border-radius: 8px;
  cursor: pointer;
}
#hamburgerBtn { left: 10px; }
#theme-toggle { right: 10px; }
#langSelect {  right: 60px; /* spazio a sinistra del dark mode */}

/* ☁️ Overlay */
#menuOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-index-overlay);
  display: none;
}
#menuOverlay.active { display: block; }

/* 📂 Side menu */
#sideMenu {
  position: fixed;
  top: 0;
  left: -280px;
  width: 260px;
  height: 100%;
  background: #fff;
  padding: 70px 20px 20px 20px;
  z-index: var(--z-index-menu);
  transition: left 0.3s ease;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}
#sideMenu.open { left: 0; }

/* 📝 Form */
input, textarea, select, button {
  font-family: var(--font-family);
  font-size: 1rem;
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #d1d5db;
  border-radius: var(--container-radius);
  background-color: #fff;
  color: #1f2937;
  box-sizing: border-box;
}
label {
  margin-top: 15px;
  font-weight: 600;
  display: block;
}

/* 🧩 Bottoni */
button {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--container-radius);
  cursor: pointer;
  transition: background-color 0.2s ease;
  padding: 10px 20px;
  margin-top: 15px;
}
button:hover {
  background-color: var(--primary-hover);
}
.secondary-button {
  background-color: var(--secondary);
  color: var(--text-color);
}
.secondary-button:hover {
  background-color: var(--secondary-hover);
}
button.generate { background-color: var(--primary); }
button.generate:hover { background-color: #095bb5; }
button.download { background-color: #28A745; }
button.download:hover { background-color: #218838; }
button.pdf { background-color: #6C757D; }
button.pdf:hover { background-color: #5a6268; }


/* 🔘 Switch */
.switch-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1em 0;
}
.switch-label {
  font-weight: 600;
  font-size: 14px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 34px;
  transition: 0.3s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}
input:checked + .slider { background-color: #4CAF50; }
input:checked + .slider:before { transform: translateX(18px); }

/* 🦶 Footer */
#customFooter {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #f9fafb;
  color: #1f2937;
  text-align: center;
  padding: 5px 0;
  font-size: 0.9rem;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.1);
  z-index: 9999;
}
