:root {
  --primary: #5c6ac4;
  --accent: #ff7a18;
  --dark: #0f172a;
  --light: #f7f8fc;
  --muted: #5f6c86;
  --radius: 18px;
  --shadow-soft: 0 15px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  padding: 0.5rem 0;
}

.site-header.scrolled {
  background: rgba(247, 248, 252, 0.95);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 0.35rem 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--accent);
  left: 0;
  bottom: 0;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0.4rem;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--dark);
  border-radius: 999px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

main {
  padding-top: 4.5rem;
}

section {
  padding: 4.5rem 1.5rem;
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  max-width: 720px;
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.section-intro {
  color: var(--muted);
  font-size: 1rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  padding: 0.95rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.btn-secondary {
  background: #fff;
  color: var(--dark);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.btn:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
}

.hero {
  min-height: 100vh;
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  font-weight: 700;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 540px;
}

.hero-visual {
  background: linear-gradient(160deg, rgba(92, 106, 196, 0.15), rgba(255, 122, 24, 0.2));
  padding: 2rem;
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.mockup {
  width: min(320px, 90%);
  margin: 0 auto;
  border-radius: 36px;
  padding: 1.5rem 1rem;
  border: 12px solid #fff;
  background: #050c29;
  color: #fff;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
}

.mockup::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 122, 24, 0.9), transparent 70%);
  top: -40px;
  right: -40px;
  opacity: 0.5;
}

.mockup-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mockup-card span {
  font-size: 1.4rem;
}

.hero-decor {
  position: absolute;
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 30% 70% 60% 40%;
  top: -40px;
  left: -30px;
  filter: blur(0.5px);
}

.hero-gallery {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.hero-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: calc(var(--radius) * 0.8);
  box-shadow: var(--shadow-soft);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid.two-columns {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid.three-columns {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

.icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: rgba(92, 106, 196, 0.12);
  color: var(--primary);
  margin-bottom: 1rem;
}

ul.custom-list {
  padding-left: 1.2rem;
  color: var(--muted);
}

ul.custom-list li {
  margin-bottom: 0.6rem;
}

.highlight-box {
  border: 1px solid rgba(92, 106, 196, 0.2);
  border-radius: calc(var(--radius) * 1.2);
  padding: 2rem;
  background: rgba(92, 106, 196, 0.05);
}

.infographic {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}

.infographic-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.image-mosaic {
  display: grid;
  gap: 1rem;
}

.image-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) * 0.9);
  box-shadow: var(--shadow-soft);
}

.users-gallery {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 2.5rem;
}

.territori-gallery {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 2.5rem 0;
}

.visual-panel {
  margin: 2.5rem 0 0;
  background: #fff;
  border-radius: calc(var(--radius) * 1.1);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.visual-panel img {
  display: block;
  width: 100%;
  height: auto;
}

.visual-panel figcaption {
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.contact {
  padding-top: 0;
  padding-bottom: 5rem;
}

.contact-card {
  background: #fff;
  border-radius: calc(var(--radius) * 1.2);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  align-items: start;
}

.contact-info .section-title {
  font-size: clamp(2rem, 3vw, 2.6rem);
}

.contact-highlights {
  margin-top: 1.5rem;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.5;
}

.contact-highlights li {
  margin-bottom: 0.8rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--dark);
  gap: 0.35rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: calc(var(--radius) * 0.6);
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  background: #fdfdff;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.15);
}

.contact-form textarea {
  resize: vertical;
}

.form-status {
  min-height: 1.2em;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

.cta-section {
  background: linear-gradient(120deg, #141e30, #243b55);
  color: #fff;
  text-align: center;
  border-radius: calc(var(--radius) * 1.4);
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(14, 20, 40, 0.35);
}

.cta-section::before,
.cta-section::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.cta-section::before {
  width: 280px;
  height: 280px;
  top: -80px;
  left: -40px;
}

.cta-section::after {
  width: 160px;
  height: 160px;
  bottom: -40px;
  right: 30px;
}

.cta-title {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  margin-bottom: 0.75rem;
}

.cta-text {
  max-width: 640px;
  margin: 0 auto 1.8rem;
}

footer {
  padding: 2.5rem 1.5rem;
  background: #0f172a;
  color: rgba(255, 255, 255, 0.8);
}

.cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 122, 24, 0.65) 0%, rgba(255, 122, 24, 0) 70%);
  border: 1px solid rgba(255, 122, 24, 0.6);
  mix-blend-mode: multiply;
  filter: blur(0.3px);
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.cursor-follower::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffd29c;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 18px rgba(255, 122, 24, 0.7);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.social-links a {
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.social-links a:hover {
  opacity: 1;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .site-header {
    padding: 0.75rem 0;
  }

  .hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-toggle {
    display: none;
  }

  .nav-links {
    position: static;
    flex-direction: row;
    background: transparent;
    width: auto;
    height: auto;
  }
}

@media (max-width: 767px) {
  .hero-slider {
    height: 270px;
  }

  .hero-visual {
    display: none !important;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    right: 1.5rem;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .cursor-follower {
    display: none;
  }
}

@media (min-width: 1024px) {
  .hero {
    min-height: calc(100vh - 60px);
  }
}

/* =========================
   GUALDO SECTION
========================= */
.gualdo-section {
  background: linear-gradient(165deg, rgba(92, 106, 196, 0.08), rgba(255, 122, 24, 0.08));
  position: relative;
}

.gualdo-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.gualdo-subtitle {
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.35rem;
}

.gualdo-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: stretch;
  margin-top: 1.5rem;
}

.gualdo-copy {
  background: rgba(255, 255, 255, 0.95);
  border-radius: calc(var(--radius) * 1.1);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 1.05rem;
  line-height: 1.8;
}

.gualdo-copy p {
  margin: 0;
  color: var(--muted);
}

.gualdo-slider .cslider {
  height: 100%;
}

.cslider--passport {
  background: #0b1022;
}

.cslider--passport .cslider__slide {
  min-height: 420px;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 2rem;
  position: relative;
}

@media (min-width: 768px) {
  .cslider--passport .cslider__slide {
    min-height: 520px;
  }
}

.cslider--passport .cslider__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.35) 55%, rgba(15, 23, 42, 0.2));
  z-index: 0;
}

.cslider--passport .cslider__slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
}

.passport-card {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 360px;
  padding: 1.75rem;
  border-radius: calc(var(--radius) * 1.15);
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.passport-card h3 {
  margin: 0;
  font-size: 1.35rem;
}

.passport-card p {
  margin: 0.9rem 0 1.6rem;
  color: rgba(247, 248, 252, 0.88);
}

.passport-cta {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.6rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.95), rgba(92, 106, 196, 0.95));
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.35);
}

.passport-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.4);
}

.passport-meta {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: rgba(247, 248, 252, 0.74);
}

@media (max-width: 700px) {
  .gualdo-header {
    text-align: left;
  }

  .gualdo-subtitle {
    font-size: 1.05rem;
  }
}

@media (max-width: 640px) {
  .cslider--passport .cslider__slide {
    min-height: auto;
    display: block;
    padding: 0 0 1.5rem;
  }

  .cslider--passport .cslider__slide::after {
    display: none;
  }

  .cslider--passport .cslider__slide img {
    position: static;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .cslider--passport .passport-card {
    margin: 1.25rem 1.25rem 0;
    padding: 1.35rem;
    box-shadow: var(--shadow-soft);
    background: rgba(15, 23, 42, 0.92);
  }

  .cslider__dots {
    position: static;
    transform: none;
    margin: 0.75rem auto 0;
    background: rgba(255, 255, 255, 0.95);
  }
}

/* =========================
   SMART SLIDER (CSS)
========================= */
.hero-slider {
  padding-top: 0;
  padding-bottom: 4.5rem;
}

.cslider {
  position: relative;
  background: #fff;
  border-radius: calc(var(--radius) * 1.2);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  height: auto;
}

.cslider__viewport {
  overflow: hidden;
  width: 100%;
}

/* Track */
.cslider__track {
  display: flex;
  will-change: transform;
  transition: transform 500ms ease;
  transform: translate3d(0, 0, 0);
}

/* Slide */
.cslider__slide {
  flex: 0 0 100%;
  position: relative;

  /* FIX: centra l'immagine */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* MOBILE (come prima): crop ok */
.cslider__slide img {
  width: 100%;
  height: 270px;      /* mobile */
  object-fit: cover;  /* mobile: riempie */
  display: block;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

/* DESKTOP/TABLET: NO CROP, immagini leggibili */
@media (min-width: 768px) {
  .cslider__slide img {
    height: clamp(380px, 55vh, 640px);
    object-fit: contain;     /* IMPORTANTISSIMO: niente tagli */
    background: #0b1022;     /* “riempie” le bande laterali */
  }
}

/* Arrows */
.cslider__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  line-height: 1;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 2;
}

.cslider__btn:hover {
  transform: translateY(-50%) scale(1.05);
}

.cslider__btn--prev {
  left: 14px;
}
.cslider__btn--next {
  right: 14px;
}

/* Dots */
.cslider__dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  z-index: 2;
}

.cslider__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.22);
  transition: transform 0.2s ease, background 0.2s ease, width 0.2s ease;
}

.cslider__dot[aria-current="true"] {
  background: var(--accent);
  width: 22px;
}

.cslider__dot:focus-visible,
.cslider__btn:focus-visible,
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 122, 24, 0.18);
}

/* Hide arrows on very small screens (optional) */
@media (max-width: 520px) {
  .cslider__btn {
    display: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cslider__track {
    transition: none;
  }
}

/* =========================
   LIGHTBOX (CSS)
========================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}

.lightbox.is-open {
  display: block;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
}

.lightbox__panel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
}

.lightbox__figure {
  margin: 0;
  width: min(980px, 100%);
  max-height: 86vh;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.lightbox__img {
  width: 100%;
  height: min(72vh, 760px);
  object-fit: contain;
  display: block;
  background: rgba(0, 0, 0, 0.15);
  touch-action: none;
  transform: translate(0, 0) scale(1);
}

.lightbox__caption {
  padding: 10px 14px 12px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.lightbox__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  backdrop-filter: blur(8px);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.lightbox__nav--prev {
  left: 14px;
}
.lightbox__nav--next {
  right: 14px;
}

@media (max-width: 520px) {
  .lightbox__nav {
    display: none;
  }
  .lightbox__img {
    height: 76vh;
  }
}
