/* ===== ROOT & RESET ===== */
:root {
  --primary: #0f172a;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --text-light: #f8fafc;
  --text-muted: #94a3b8;
  --surface: #1e293b;
  --surface-2: #334155;
  --border: rgba(255,255,255,0.08);
  --radius: 1rem;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--primary);
  color: var(--text-light);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===== NAVBAR ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.2rem 0;
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
}

#navbar.scrolled {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
  padding: 0.8rem 0;
}

.navbar-brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-light) !important;
  letter-spacing: -0.02em;
}

.navbar-brand span {
  color: var(--accent);
}

.navbar-nav .nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 1rem !important;
  transition: color var(--transition);
  position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--text-light) !important;
}

.navbar-toggler {
  border: none;
  outline: none;
  color: var(--text-light);
}

.navbar-toggler:focus { box-shadow: none; }

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 6rem 1.5rem 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(99,102,241,0.12) 0%, transparent 50%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.hero-content { position: relative; z-index: 1; max-width: 800px; width: 100%; }

.hero-image {
  width: 45em;
  max-width: 100%;
  height: auto;
  margin-top: -7em;
  margin-bottom: -9em;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.about-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin-top: 1.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: #a5b4fc;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.8rem;
}

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

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

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.4rem;
}

.hero-title .highlight {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.btn-primary-custom {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.85rem 2.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  display: inline-block;
}

.btn-primary-custom:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(99,102,241,0.4);
  color: #fff;
}

.btn-outline-custom {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
  padding: 0.85rem 2.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  text-decoration: none;
  display: inline-block;
}

.btn-outline-custom:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
  color: var(--text-light);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.stat-item .stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-light);
  letter-spacing: -0.03em;
}

.stat-item .stat-num span { color: var(--accent); }

.stat-item .stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* ===== SECTIONS COMMON ===== */
section { padding: 6rem 0; }

.section-tag {
  display: inline-block;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
}

/* ===== ABOUT ===== */
#about { background: var(--surface); }

.about-card {
  background: var(--primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  height: 100%;
  transition: border-color var(--transition), transform var(--transition);
}

.about-card:hover {
  border-color: rgba(99,102,241,0.4);
  transform: translateY(-4px);
}

.about-icon {
  width: 52px; height: 52px;
  background: rgba(99,102,241,0.15);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
}

.about-card h4 {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

/* ===== SERVICES ===== */
#servizi { background: var(--primary); }

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem;
  height: 100%;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #c084fc);
  opacity: 0;
  transition: opacity var(--transition);
}

.service-card:hover {
  border-color: rgba(99,102,241,0.3);
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.service-card:hover::before { opacity: 1; }

.service-icon {
  font-size: 2.2rem;
  margin-bottom: 1.2rem;
}

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

/* ===== TESTIMONIALS ===== */
#testimonianze { background: var(--surface); }

.testimonial-card {
  background: var(--primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.stars { color: #fbbf24; font-size: 0.9rem; margin-bottom: 1rem; }

.testimonial-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-style: italic;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #c084fc);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.author-name { font-weight: 600; font-size: 0.9rem; }
.author-role { color: var(--text-muted); font-size: 0.8rem; }

/* ===== CONTACT ===== */
#contatti { background: var(--primary); }

.contact-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.contact-wrapper::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.contact-form .form-control,
.contact-form .form-select {
  background: var(--primary);
  border: 1px solid var(--surface-2);
  color: var(--text-light);
  border-radius: 0.75rem;
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-form .form-control::placeholder { color: var(--text-muted); }

.contact-form .form-control:focus,
.contact-form .form-select:focus {
  background: var(--primary);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  color: var(--text-light);
  outline: none;
}

.contact-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-info-icon {
  width: 44px; height: 44px;
  background: rgba(99,102,241,0.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-info-text strong {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}

.contact-info-text span {
  font-size: 0.95rem;
  color: var(--text-light);
}

/* ===== FOOTER ===== */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
}

footer p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }
footer a { color: var(--accent); text-decoration: none; }

/* ===== ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* delay utilities */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* ===== LANGUAGE SWITCHER ===== */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  line-height: 1;
}

.lang-btn:hover { color: var(--text-light); }

.lang-btn.active {
  color: var(--text-light);
  background: rgba(99,102,241,0.2);
}

.lang-sep {
  color: var(--surface-2);
  font-size: 0.7rem;
  user-select: none;
}

@media (max-width: 991px) {
  .lang-switcher {
    margin-top: 0.75rem;
    margin-left: 0 !important;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--primary); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== RESPONSIVE ===== */

/* Tablet e sotto */
@media (max-width: 991.98px) {
  /* Menu navbar collassato: sfondo solido per leggibilità */
  .navbar-collapse {
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
    border: 1px solid var(--border);
  }
  .navbar-nav .nav-link { padding: 0.6rem 0 !important; }
}

/* Smartphone */
@media (max-width: 768px) {
  section { padding: 4rem 0; }

  #hero { padding: 5rem 1rem 3rem; min-height: auto; }

  .hero-image {
    width: 100%;
    margin-top: -2rem;
    margin-bottom: -3rem;
  }

  .hero-badge {
    font-size: 0.72rem;
    padding: 0.35rem 0.85rem;
    margin-bottom: 1.2rem;
  }

  .hero-desc {
    font-size: 1rem;
    margin-bottom: 1.8rem;
  }

  .btn-primary-custom,
  .btn-outline-custom {
    padding: 0.8rem 1.6rem;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
  }

  .hero-stats {
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
  }

  .contact-wrapper { padding: 2rem 1.25rem; }

  .about-card,
  .service-card,
  .testimonial-card {
    padding: 1.5rem;
  }

  .section-desc { font-size: 0.98rem; }

  .testimonial-card ul { padding-left: 1.2rem; }
  .testimonial-card ul li { font-size: 0.92rem; }
}

/* Smartphone piccoli */
@media (max-width: 480px) {
  #hero { padding: 4.5rem 0.75rem 2rem; }

  .hero-image {
    margin-top: -1rem;
    margin-bottom: -2rem;
  }

  .hero-badge {
    font-size: 0.68rem;
    letter-spacing: 0.02em;
  }

  .navbar-brand img {
    width: 60px !important;
    height: 40px !important;
  }

  .container { padding-left: 1rem; padding-right: 1rem; }

  .contact-wrapper { padding: 1.5rem 1rem; border-radius: var(--radius); }

  .contact-form .form-control,
  .contact-form .form-select {
    font-size: 0.9rem;
    padding: 0.75rem 0.95rem;
  }

  .about-icon,
  .service-icon {
    font-size: 1.6rem;
  }

  .testimonial-card .stars { font-size: 0.8rem; word-wrap: break-word; }

  footer { padding: 1.8rem 0; }
  footer p { font-size: 0.8rem; }
}
