/*
Theme Name: Ecolex
Theme URI: https://ecolex.it
Author: Ecolex
Author URI: https://ecolex.it
Description: Tema personalizzato per Ecolex — Consulenza normativa rifiuti, RENTRI, RAEE, End of Waste
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: ecolex
*/

/* ============================
   VARIABILI
   ============================ */
:root {
  --blue: #0047cc;
  --blue-mid: #1a5fff;
  --blue-light: #e8f0ff;
  --blue-accent: #3d8bff;
  --dark: #080f1f;
  --text: #0f1c36;
  --muted: #5a6a88;
  --border: #c2cfea;
  --white: #f5f7fc;
  --yellow: #f0c04a;
}

/* ============================
   RESET E BASE
   ============================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: 'DM Sans', sans-serif;
  background: var(--white);
  color: var(--text);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }

/* ============================
   NAVIGAZIONE
   ============================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 4rem;
  background: rgba(245,247,252,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  color: var(--blue);
  letter-spacing: -0.02em;
}

.site-logo span { color: var(--blue-accent); }

.site-nav ul {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.site-nav a:hover { color: var(--blue); }

.nav-cta {
  background: var(--blue) !important;
  color: white !important;
  padding: 0.55rem 1.4rem;
  border-radius: 100px;
  font-weight: 600 !important;
  transition: background 0.2s !important;
}

.nav-cta:hover { background: var(--blue-mid) !important; }

/* ============================
   CONTENUTO PRINCIPALE
   ============================ */
.site-main {
  padding-top: 80px;
}

/* ============================
   HERO + CHECKER
   ============================ */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(61,139,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 4rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--blue-light);
  border: 1px solid var(--border);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  width: fit-content;
  margin-bottom: 2rem;
}

.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--blue-accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.6rem, 4vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--dark);
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--blue);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 440px;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 1rem;
}

.stat { display: flex; flex-direction: column; gap: 0.2rem; }

.stat-num {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem;
  color: var(--blue);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ============================
   CHECKER CARD
   ============================ */
.hero-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 4rem 6rem 2rem;
}

.checker-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 80px rgba(0,71,204,0.1), 0 4px 16px rgba(0,0,0,0.04);
  position: relative;
}

.checker-card::before {
  content: '';
  position: absolute;
  top: -1px; left: 40px; right: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-accent));
  border-radius: 0 0 4px 4px;
}

.checker-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
}

.checker-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.input-group { position: relative; margin-bottom: 1rem; }

.input-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.input-group input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  letter-spacing: 0.08em;
}

.input-group input:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(0,71,204,0.1);
}

.input-group input::placeholder { color: #b0bfd8; }

.btn-check {
  width: 100%;
  padding: 1rem;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

.btn-check:hover { background: var(--blue-mid); transform: translateY(-1px); }
.btn-check:active { transform: translateY(0); }

/* Risultato */
.result-box {
  margin-top: 1.5rem;
  padding: 1.2rem;
  border-radius: 12px;
  display: none;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-box.show { display: block; }
.result-box.green { background: #edfaf4; border: 1px solid #a8dfc0; }
.result-box.yellow { background: #fef9ec; border: 1px solid #f0d88a; }
.result-box.red { background: #fef0f0; border: 1px solid #f5b8b8; }

.result-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.result-icon { font-size: 1.3rem; }

.result-company {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--dark);
}

.result-ateco {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
  font-family: monospace;
  background: rgba(0,0,0,0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  width: fit-content;
}

.result-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 0.5px solid var(--border);
  font-size: 0.82rem;
  gap: 1rem;
}

.result-meta:last-of-type { border-bottom: none; margin-bottom: 0.8rem; }
.meta-label { color: var(--muted); font-weight: 500; flex-shrink: 0; }
.meta-value { color: var(--text); font-weight: 600; text-align: right; }

.result-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.result-items li {
  font-size: 0.85rem;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.4;
}

.result-items li::before {
  content: '→';
  color: var(--blue-accent);
  font-weight: 600;
  flex-shrink: 0;
}

.result-cer {
  display: none;
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--muted);
  background: rgba(0,0,0,0.04);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  margin: 0.8rem 0 0.5rem;
}

.result-sanzioni {
  font-size: 0.8rem;
  color: #c0392b;
  background: #fef0f0;
  border: 1px solid #f5b8b8;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin: 0.6rem 0 1rem;
  line-height: 1.5;
}

.result-fonte {
  font-size: 0.70rem;
  color: var(--muted);
  margin: 0.4rem 0 0.8rem;
  font-style: italic;
}

.result-cta {
  margin-top: 1.2rem;
  padding: 0.8rem 1rem;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.result-cta:hover { background: var(--blue-mid); }

/* Loading */
.loading {
  display: none;
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.loading.show { display: block; }

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--blue-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 0.8rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Approfondimento */
.fup-title {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.fup-question { margin-bottom: 0.9rem; }

.fup-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.fup-options { display: flex; gap: 0.5rem; }

.fup-options button {
  flex: 1;
  padding: 0.45rem 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.fup-options button:hover { border-color: var(--blue-mid); color: var(--blue); }
.fup-options button.selected { background: var(--blue); border-color: var(--blue); color: white; }

.fup-msg {
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ============================
   SEZIONE FEATURES
   ============================ */
.features {
  padding: 7rem 4rem;
  background: var(--dark);
  position: relative;
  overflow: hidden;
}

.features::before {
  content: '';
  position: absolute;
  bottom: -100px; left: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(61,139,255,0.08) 0%, transparent 70%);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-accent);
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  color: white;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 500px;
  margin-bottom: 4rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature-item {
  padding: 2rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  transition: border-color 0.3s, background 0.3s;
}

.feature-item:hover {
  border-color: rgba(61,139,255,0.3);
  background: rgba(61,139,255,0.04);
}

.feature-icon {
  width: 44px; height: 44px;
  background: rgba(61,139,255,0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1.2rem;
}

.feature-item h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  color: white;
  margin-bottom: 0.6rem;
}

.feature-item p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
  font-weight: 300;
}

/* ============================
   SEZIONE SETTORI
   ============================ */
.sectors {
  padding: 7rem 4rem;
  background: var(--white);
}

.sectors-header {
  text-align: center;
  margin-bottom: 4rem;
}

.sectors-header .section-title {
  color: var(--dark);
  margin: 0 auto 1rem;
}

.sectors-header p {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 300;
}

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

.sector-card {
  padding: 1.5rem;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.sector-card:hover {
  border-color: var(--blue-mid);
  box-shadow: 0 8px 32px rgba(0,71,204,0.1);
  transform: translateY(-2px);
}

.sector-emoji { font-size: 1.8rem; margin-bottom: 0.8rem; display: block; }

.sector-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.3rem;
}

.sector-card p {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: monospace;
}

.sector-status {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.status-obbligato { background: #fef0f0; color: #c0392b; }
.status-verifica { background: #fef9ec; color: #d68910; }
.status-esente { background: var(--blue-light); color: var(--blue); }

/* ============================
   CTA SECTION
   ============================ */
.cta-section {
  padding: 7rem 4rem;
  background: linear-gradient(135deg, var(--blue) 0%, #001a66 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: 'RENTRI';
  position: absolute;
  font-family: 'DM Serif Display', serif;
  font-size: 20rem;
  color: rgba(255,255,255,0.03);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  pointer-events: none;
}

.cta-section h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  color: white;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  position: relative;
}

.cta-section p {
  color: rgba(255,255,255,0.65);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  font-weight: 300;
  position: relative;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  position: relative;
}

.btn-primary {
  background: white;
  color: var(--blue);
  padding: 0.9rem 2rem;
  border-radius: 100px;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }

.btn-secondary {
  background: transparent;
  color: white;
  padding: 0.9rem 2rem;
  border-radius: 100px;
  border: 1.5px solid rgba(255,255,255,0.3);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover { border-color: white; background: rgba(255,255,255,0.08); }

/* ============================
   PAGINE INTERNE
   ============================ */
.page-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.page-content h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  color: var(--dark);
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.page-content h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  color: var(--dark);
  margin: 2.5rem 0 1rem;
}

.page-content p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1.2rem;
  font-weight: 300;
}

/* ============================
   FOOTER
   ============================ */
.site-footer {
  padding: 3rem 4rem;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: white;
}

.footer-logo span { color: var(--blue-accent); }

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--blue-accent); }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 900px) {
  .site-header { padding: 1rem 1.5rem; }
  .site-nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-left { padding: 3rem 1.5rem 2rem; }
  .hero-right { padding: 0 1.5rem 3rem; }
  .features { padding: 4rem 1.5rem; }
  .features-grid { grid-template-columns: 1fr; gap: 1rem; }
  .sectors { padding: 4rem 1.5rem; }
  .sectors-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-section { padding: 4rem 1.5rem; }
  .cta-buttons { flex-direction: column; align-items: center; }
  .site-footer { flex-direction: column; gap: 1.5rem; text-align: center; padding: 2rem 1.5rem; }
}

.site-main {
  padding-top: 0 !important;
}

.hero {
  margin-top: 0 !important;
}