:root{
  --brand:#ec6f04;
  --text:#1f2937;
  --muted:#6b7280;
  --action:#007f3e;
  --bg:#ffffff;
  --bg-section2:#000;
  --bg-callout:#777;
  --bg-footer:#444;
  --menu-color:#000;
  --radius:40px;
  --shadow:0 6px 8px rgba(0,0,0,.28);
  --shadow2:0 6px 10px rgba(0,0,0,.18);
  --shadow3:0 6px 10px rgba(0,0,0,.38);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  padding:0;
  font-family:'Quicksand',sans-serif;
  color:var(--text);
  background:var(--bg);
  font-size:1.2em;
  text-align:left;
}

h1,h2,h3,h4{
  font-family:'Cal Sans',sans-serif;
  letter-spacing:2px
}
a{
  color:var(--brand);
  text-decoration:none
}
a:hover{text-decoration:underline}
img{max-width:100%;height:auto;display:block}

/* offset per scroll agli anchor */
section,
header.hero{scroll-margin-top:96px;position:relative;box-shadow:var(--shadow2);}

h1{font-size:2.5em}
h2{font-size:2em}

/* ===== BARRA INFORMAZIONI IN ALTO ===== */
.infobar{
  background:#000;
  color:#fff;
  font-size:0.65em;   /* più piccolo */
  padding:8px 0;      /* più sottile e elegante */
}
.infoflex{
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.infobar i{
  margin-right:6px;
}
.infobar a{
  color:#fff;
}
.infobar a:hover{
  text-decoration: none;
   color:var(--brand);
}

/* ===== HEADER STICKY ===== */
.topbar{
  position:sticky;
  width:100%;
  top:0;
  z-index:50;
  background:rgba(255,255,255,1);
  backdrop-filter:blur(8px);
  box-shadow:var(--shadow2);
  transition:all 0.25s ease;
}

.container,.container_100{
margin:0 auto;
position:relative
}
.container{
max-width:1100px;
padding:0 18px;
}

.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:72px;
  padding:5px 0;
  transition:min-height .25s ease, padding .25s ease;
}

.brand img{
  height:90px;
  transition:height .25s ease;
}

/* Stato ridotto quando si scrolla */
.topbar.shrink .brand img{
  height:60px;
}
.topbar.shrink .nav{
  min-height:50px;
  padding:8px 0; 
}

.menu{
  display:flex;
  gap:18px;
  align-items:center;
  padding-right:20px;
    transition:all 0.25s ease;
}

.menu a:not(.cta){
  font-family:'Cal Sans',sans-serif;
  letter-spacing:1px;
  color:var(--menu-color);
  text-decoration:none;
  transition:color 0.4s ease-out;
}
.menu a:not(.cta):hover{
  color:var(--brand);
}

.cta{
  display:inline-block;
  background:var(--action);
  color:#fff;
  padding:14px 24px;
  border-radius:32px;
  font-weight:700;
  box-shadow:var(--shadow);
  font-size:1.1em;
  border:2px solid transparent;
  text-decoration:none;
  transition:background-color 0.4s ease-out, transform 0.3s ease-out;
}
.cta:hover{
  filter:brightness(1.05);
  background-color:var(--brand);
  text-decoration:none;
  transform:scale(1.1);
}
.cta i{margin-right:10px}
.menu .cta{
  margin-left:20px;
  color:#fff;
}

.topbar.shrink .menu{
font-size:16px;
}
.topbar.shrink .cta{
  padding:12px 20px;
  border-radius:28px;
  font-size:1em;
}





.pill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 25px;
  border-radius:50px;
  background:#fff;
  text-transform:uppercase;
  text-decoration:none;
  transition:background-color 0.4s ease-out, color 0.3s ease-out, transform 0.3s ease-out
}
.pill:hover{
  background-color:var(--brand);
  text-decoration:none;
  transform:scale(1.1);
  color:#fff;
}
.pill-container{
    margin-top:30px;
    display:flex;
    gap:12px;
    justify-content:center;
    flex-wrap:wrap;
}
/* ===== HERO ===== */
.hero{
  position:relative;
  width:100%;
  top:0;
  z-index:49;
  padding:120px 0;
  isolation:isolate;
  color:#fff;
    text-align:center;
}

.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background:url('img/domotica1.webp') center/cover no-repeat;
  z-index:-2
}
.hero::after{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.45);
  z-index:-1
}

/* ===== SEZIONI ===== */
section{
  padding:40px 0 50px 0;
  text-align:center;
}

.title-row{
  margin-bottom:10px;
  text-align:center;
}
.title-row img{
  display:block;
  margin:0 auto;
  height:64px;
}
.title-row h2{
margin-top:10px;
line-height:1.1;
padding:0 140px !important;
}
.orange{color:var(--brand)}
.text-row {
  text-align:left;
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
  gap:20px;
  justify-items:center
}
.card{
  background:#fff;
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow);
  max-width:360px
}
.card img{
  width:100%;
  aspect-ratio:16/9;
  object-fit:cover
}
.card-body{
padding:16px
}
.card-body h3{
text-transform: uppercase;
letter-spacing:0;
line-height:1;
margin-top:10px;
margin-bottom:15px;
}

/* Sezione servizi */
#servizi{
background-color:var(--bg-section2);
background-image:url('img/pieffe-logo-gr1.svg');
background-repeat:no-repeat;
background-position: center;
color:#fff
}
#servizi .grid{color:#000}

/* Band con immagine */
.band{
background:url('img/dom1-1920w.jpg') center/cover fixed no-repeat;
color:#fff;
position:relative;
isolation:isolate
}
.band::before{
content:"";
position:absolute;
inset:0;
background:rgba(0,0,0,.75);
z-index:-1
}
/*section-servizi-civili-industriali*/
.section-servizi-civili-industriali{
background-color:var(--bg-section2);
background-image:url('img/pieffe-logo-gr1.svg');
background-repeat:no-repeat;
background-position: center;

color:#fff;
position:relative;
isolation:isolate
}


/* section-servizi-civili-industriali */
.section-servizi-antifurto{
  background:url('img/antifurto2.webp') center/cover fixed no-repeat;
  color:#fff;
  position:relative;
  isolation:isolate
}
.section-servizi-antifurto::before{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.75);
  z-index:-1
}



/* Sezioni domotica / fotovoltaico full width */
.section-domotica,
.section-fotovoltaico{
  padding:0;              /* niente padding esterno */
  margin:0;
}

/* Griglia metà/metà senza riquadro */
.service-split{
  width:100%;
  display:grid;
  grid-template-columns: 1fr 1fr;
  min-height:380px;
  border:0;
  border-radius:0;
  overflow:hidden;
  box-shadow:none;        /* via il riquadro */
  margin:0;
}

/* Inversione delle colonne nella seconda sezione */
.service-split--reverse{
  direction:rtl;
}
.service-split--reverse > *{
  direction:ltr;
}

/* Colonna immagine full-width */
.service-media{
  width:100%;
  height:100%;
  min-height:350px;
  background-size:cover;
  background-position:center;
}

/* Immagini di sfondo */
.service-media--domotica{
  background-image:url('img/antifurto-servizi.webp');
}
.service-media--fotovoltaico{
  background-image:url('img/impianti-fotovoltaici-servizi.webp');
}

/* Colonna testo full-height */
.service-text{
  padding:60px 60px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  text-align:left;
  background:#fff;   /* sfondo bianco come nell’immagine */
}

.title-row--left{
  text-align:left;
}
.title-row--left img{
  margin:0 0 10px 0;
}
.title-row--left h2{
  padding:0 !important;
}

/* Gallery fotovoltaico */
.fv-gallery{
display:grid;
grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));
gap:0px;
padding:10px 0;
width:100%;
}

.fv-item{
position:relative;
overflow:hidden;
border-radius:var(--radius);
background:#000;
}

.fv-item img{
width:100%;
height:100%;
object-fit:cover;
transition:transform .4s ease;
}
.fv-item:hover img{
transform:scale(1.08);
}

.fv-caption{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  padding:12px 14px;
  background:linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
  color:#fff;
  font-size:.9em;
  text-align:center;
}

/* LIGHTBOX FULLSCREEN */
.lightbox{
  position:fixed;
  inset:0;
  display:flex;
  justify-content:center;
  align-items:center;
  background:rgba(0,0,0,.9);
  z-index:9999;

  /* Fade in/out */
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .25s ease, visibility .25s ease;
}

.lightbox.is-visible{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.lightbox-img{
  max-width:90%;
  max-height:90%;
  border-radius:8px;
  box-shadow:0 0 20px rgba(0,0,0,.5);
}

.lightbox-close{
  position:absolute;
  top:20px;
  right:30px;
  color:#fff;
  font-size:46px;
  cursor:pointer;
  user-select:none;
  transition:.2s;
  font-weight:300;
  z-index:10000;
}

.lightbox-close:hover{
  color:var(--brand);
}

/* Cursor sulle immagini della gallery */
.fv-gallery img{
  cursor:zoom-in;
}
/* Cursor on gallery images */
.fv-gallery img{
  cursor:pointer;
}


.contacts{
  position:relative;
  width:100%;
  top:0;
  z-index:49;
  padding:120px 0;
  isolation:isolate;
  color:#fff;
  text-align:center;
}

.contacts::before{
  content:"";
  position:absolute;
  inset:0;
  background:url('img/domotica_c.webp') center/cover no-repeat;
  z-index:-2
}
.contacts::after{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.65);
  z-index:-1
}

.section-contatti-form{
  position:relative;
  width:100%;
  top:0;
  z-index:49;
  padding:120px 0;
  isolation:isolate;
  color:#fff;
    text-align:center;
}

.section-contatti-form::before{
  content:"";
  position:absolute;
  inset:0;
  background:url('img/smart.webp') center/cover no-repeat;
  z-index:-2
}
.section-contatti-form::after{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.45);
  z-index:-1
}


.section-contatti-form{
  padding:40px 0 60px 0;
}

.contact-form{
  max-width:900px;
  margin:0 auto;
}

/* GRID FORM */
.form-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:20px;
}

.form-field--full{
  grid-column:1 / -1;
}

.contact-form label{
  display:block;
  margin-bottom:6px;
  font-size:.9em;
  font-weight:600;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea{
  width:100%;
  padding:12px 14px;
  border:1px solid #ccc;
  border-radius:4px;
  font:inherit;
  box-sizing:border-box;
    border:1px solid #fff;
}

/* Privacy */
.form-field--privacy label{
  display:flex;
  align-items:flex-start;
  gap:8px;
  font-weight:400;
}
.form-field--privacy input{
  margin-top:4px;
}

/* Honeypot invisibile */
.hp-field{
  display:none;
}

/* Pulsante centrato */
.form-actions{
  grid-column:1 / -1;
  text-align:center;
  position:relative; /* necessario per posizionare popup */
}


/* POPUP SUCCESSO / ERRORE */
#cf-popup-wrap{
  position:relative;
  width:100%;
  height:0;               /* elimina spazio verticale */
  overflow:visible;
  text-align:center;
  margin-top:0;
}

/* Popup */
.cf-popup{
   display:none;
  position:relative;
  margin:20px auto;
  width:100%;
  background:#007f3e;
  color:#fff;
  padding:12px 20px;
  border-radius:6px;
  font-size:.95em;
  opacity:0;
  pointer-events:none;
  transform:translateY(10px);  /* effetto slide */
  transition:opacity .25s ease, transform .25s ease;
}

/* Popup errore */
.cf-popup--error{
  background:#d43535;
}

/* Attivo */
.cf-popup.show{
  opacity:1;
  transform:translateY(0);
    displayt:block;
}

/* LOADER CENTRALE */
.cf-loader{
  position:fixed;
  top:50%;
  left:50%;
  width:48px;
  height:48px;
  margin:-24px 0 0 -24px;
  border:5px solid #f3f3f3;
  border-top:5px solid #007f3e;
  border-radius:50%;
  animation:spin 0.8s linear infinite;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
  z-index:99999;
}
.cf-loader.show{
  opacity:1;
}

@keyframes spin{
  0%{ transform:rotate(0deg); }
  100%{ transform:rotate(360deg); }
}

/* Animazione bottone durante invio */
.cta_c.is-loading{
  position:relative;
  pointer-events:none;
  opacity:0.8;
}

/* (opzionale: se vuoi un piccolo spinner integrato nel bottone)
.cta_c.is-loading::after{
  content:"";
  position:absolute;
  right:12px;
  top:50%;
  width:16px;
  height:16px;
  margin-top:-8px;
  border:2px solid rgba(255,255,255,.6);
  border-top-color:#fff;
  border-radius:50%;
  animation:spin 0.8s linear infinite;
}
*/

/* Mobile */
@media(max-width:768px){
  .form-grid{
    grid-template-columns:1fr;
  }
  .form-actions{
    text-align:center;
  }
}
/* -------------------- */
/* LOADER */
/* -------------------- */

.cf-loader{
  position:fixed;
  top:50%;
  left:50%;
  width:48px;
  height:48px;
  margin:-24px 0 0 -24px;
  border:5px solid #f3f3f3;
  border-top:5px solid #007f3e;
  border-radius:50%;
  animation:spin 0.8s linear infinite;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
  z-index:99999;
}

.cf-loader.show{
  opacity:1;
}

@keyframes spin{
  0%{ transform:rotate(0deg); }
  100%{ transform:rotate(360deg); }
}

/* MOBILE */
@media(max-width:768px){
  .form-grid{
    grid-template-columns:1fr;
  }
  .form-actions{ text-align:center; }
}










/* Mobile */
@media (max-width:768px){
  .service-split{
    grid-template-columns:1fr;
  }
  .service-text{
    padding:30px 20px;
  }
  .service-media{
    min-height:240px;
  }
}








/* Callout */
section.callout_bg{
background:var(--bg-callout);
}
.callout{
border-radius:var(--radius);
box-shadow:var(--shadow3);
background-color:#fff;
padding:24px;
display:grid;
gap:10px;
text-align:center;
max-width:600px;
}
.callout .title-row {
  text-transform: uppercase;
}
.callout h3 {
  margin-bottom:0 !important;
}
.callout p {
  margin-top:0 !important;
}

.callout .cta_c, .contact-form .cta_c{
  display:inline-block;
  background:var(--brand);
  color:#fff;
  padding:14px 24px;
  border-radius:32px;
  font-weight:700;
  box-shadow:var(--shadow);
  font-size:1.1em;
  border:none;
  text-decoration:none;
  text-transform: uppercase;
  transition:background-color 0.4s ease-out, transform 0.3s ease-out;
}
.callout .cta_c:hover, .contact-form .cta_c:hover{
  text-decoration:none;
  background-color:var(--action);
}
/* Footer principale */
footer.main{
position:relative;
color:#fff;
background-color:var(--bg-footer);
}

footer h4 {text-transform: uppercase}
footer a {color: #fff}
footer a:hover {color: var(--brand) !important}
.footer-flex{
display:flex;
flex-wrap:wrap;
align-items:center;
justify-content:space-between;
gap:20px;
text-align:left;
font-size:16px;
padding-bottom:10px;
}
.footer-flex > div:first-child{
flex:0 0 35%;
align-self:flex-start;
}
.footer-flex .footer-logo{
flex:1;
text-align:center;
}
.footer-flex > div:last-child{
flex:0 0 35%;
text-align:right;
align-self:flex-start;        
}
.footer-logo img{
height:80px;
margin:10px auto 0 auto;
}

.legal{
background:#000;
color:#ccc;
padding:14px 0;
text-align:center;
font-size:14px;
}
.legal a{
  color:#ccc;
  margin:0 10px
}






/* Floating WhatsApp */
.wa-float{
  position:fixed;
  bottom:18px;
  right:18px;
  z-index:99;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:64px;
  height:64px;
  border-radius:50%;
  /*background:#fff;*/
  box-shadow:0 10px 24px rgba(0,0,0,.18);
  transition:transform .15s ease, box-shadow .15s ease
}
.wa-float:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 28px rgba(0,0,0,.22)
}
.wa-float img{
  width:64px;
  height:64px
}











@media (max-width:560px){
  .wa-float{
    width:56px;
    height:56px;
    bottom:14px;
    right:14px
  }
}

/* Mappa */
.map{margin:0;padding:0;}
.map-embed{
  position:relative;
  width:100%;
  margin:0 auto;
  overflow:hidden;
    background:var(--bg-callout);
}
.map-embed iframe{
  width:100%;
  height:520px;
  border:0
}

/* Responsive: meglio un po' di centratura su mobile dove serve */
@media (max-width:768px){
  .infoflex{
    flex-direction:column;
    align-items:flex-start;
    gap:4px;
  }
  .nav{
    flex-wrap:wrap;
  }
  .footer-flex{
    flex-direction:column;
    align-items:center;
    text-align:center;
  }
.title-row h2{
    padding:0 20px !important;
}

  .footer-flex > div:first-child,
  .footer-flex .footer-logo,
  .footer-flex > div:last-child{
    flex:0 0 100%;
    width:100%;
    align-self:center;
      text-align: center;
  }
    .footer-flex a{
    display:block;
    }
}