/* ====== General Reset ====== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:"Lato", sans-serif;
  color: #fff;
  background: #000;
  padding: 40px 100px;
  max-width: 1920px;
  margin: 0 auto;
}

html {
  scroll-behavior: smooth;
}

/* ====== Typography ====== */
h1, h2, h3, h4, h5, h6, .logo, button, .button {
  font-family: 'Libre Baskerville', serif;
  font-weight: bold;
}

.lato-regular, p, a:not(.button a) {
  font-family: "Lato", sans-serif;
  font-weight: 400;
}

a {
  color: #4e95fa;
  text-decoration: none;
}

/* ====== Cookie Banner ====== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  width: 100%;
  background: #222;
  color: #fff;
  padding: 20px;
  text-align: center;
  z-index: 1000;
}
.cookie-buttons button {
  margin: 0 10px;
  padding: 8px 16px;
  background: #fff;
  color: #000;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.cookie-buttons button:hover {
  background: #ddd;
}
.cookie-banner p {
  margin-bottom: 15px;
  width: 100%;
}

/* ====== Logo ====== */
.logo {
  opacity: 0;
  scale: 0.5;
  padding: 0px;
  font-size: 1.5rem;
}
.logo img {
  width: auto;
  height: 60px;
  object-fit: contain;
  margin-right: 10px;
  vertical-align: middle;
}
.logo span {
  display: none;
}

/* ====== Header ====== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 60px;
  border-radius: 5px;
  border: 1px solid #ffffff25;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}
header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(5px);
  background: linear-gradient(114deg, rgba(255, 255, 255, 0.09) 1.13%, rgba(255, 255, 255, 0.01) 120.83%);
  border-radius: 5px;
  z-index: -1;
}

/* ====== Navigation ====== */
nav a {
  margin: 0 15px;
  text-decoration: none;
  color: #fff;
  font-weight: 500;
}

/* ====== Hero Section ====== */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  height: auto;
  padding: 100px 40px;
  margin-bottom: 50px;
}
.hero-text {
  flex: 1;
  padding-right: 20px;
}
.hero-media {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}
.hero p {
  font-size: 1.2rem;
}
.hero button {
  padding: 15px 30px;
  font-size: 1rem;
  border: none;
  background-color: #fff;
  color: #111;
  cursor: pointer;
}
.hero .button a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #111;
}
@media (min-width: 768px) {
  .hero {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
  .hero-media {
    height: 300px;
    background-color: #444;
  }
}

/* ====== Buttons ====== */
button, .button {
  background-color: white;
  border: 1px solid white;
  color: black;
  padding: 12px 24px;
  cursor: pointer;
  transition: transform 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 2px;
}
button:hover, .button:hover {
  transform: scale(1.2);
}
.button a {
  text-decoration: none;
  color: black;
}
.button a:visited {
  color: black;
}
.button {
  margin-top: 30px;
}

/* ====== Form Styles ====== */
.form-wrapper {
  margin-bottom: 40px;
  border-radius: 5px;
  border: 1px solid #ffffff25;
  background: linear-gradient(114deg, rgba(255, 255, 255, 0.09) 1.13%, rgba(255, 255, 255, 0.01) 120.83%);
  box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(5px);
  padding: 30px;
  text-align: left;
}

.form-wrapper input,
.form-wrapper select,
.form-wrapper textarea {
  width: 100%;
  padding: 18px;
  border: 1px solid #2c2c2e;
  border-radius: 4px;
  background-color: #2c2c2e;
  color: white;
  font-size: 1rem;
  transition: border 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.form-wrapper input:focus,
.form-wrapper select:focus,
.form-wrapper textarea:focus {
  outline: none;
  border: 2px solid #4e95fa;
  box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.5);
  background-color: #333;
}

.form-wrapper input:hover,
.form-wrapper select:hover,
.form-wrapper textarea:hover {
  background-color: #3a3a3c;
}

/* Disabled State */
.form-wrapper input:disabled,
.form-wrapper select:disabled,
.form-wrapper textarea:disabled {
  background-color: #1a1a1a;
  color: #666;
  border: 1px solid #444;
  cursor: not-allowed;
}

/* Read-Only State */
.form-wrapper input[readonly],
.form-wrapper textarea[readonly] {
  background-color: #1a1a1a;
  color: #999;
  border: 1px solid #444;
}

/* Error State */
.form-wrapper input.invalid,
.form-wrapper select.invalid,
.form-wrapper textarea.invalid {
  border: 2px solid red;
  box-shadow: 0 0 8px 2px rgba(255, 0, 0, 0.5);
}

/* Success State */
.form-wrapper input.success,
.form-wrapper select.success,
.form-wrapper textarea.success {
  border: 2px solid green;
  box-shadow: 0 0 8px 2px rgba(0, 255, 0, 0.5);
}

/* Warning State */
.form-wrapper input.warning,
.form-wrapper select.warning,
.form-wrapper textarea.warning {
  border: 2px solid orange;
  box-shadow: 0 0 8px 2px rgba(255, 165, 0, 0.5);
}

/* Loading State */
.form-wrapper input.loading,
.form-wrapper select.loading,
.form-wrapper textarea.loading {
  border: 2px solid #4e95fa;
  background-image: linear-gradient(90deg, #4e95fa 25%, #2c2c2e 50%, #4e95fa 75%);
  background-size: 200% 100%;
  animation: loadingAnimation 1.5s infinite;
}

@keyframes loadingAnimation {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.input-fields input[type="email"] {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 4px;
  background-color: #2c2c2e;
  color: white;
  font-size: 1rem;
  transition: border 0.3s ease, background-color 0.3s ease;
}

.input-fields input[type="email"]:focus {
  outline: none;
  border: 1px solid #4e95fa;
  background-color: #333;
}

.input-fields input[type="email"]:hover {
  background-color: #3a3a3c;
}

.dropdown-form {
  margin-bottom: 30px;
}

.radio-group {
  display: flex;
  gap: 15px;
  align-items: center;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.datipersonali {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.form-submit {
  text-align: center;
  margin-top: 30px;
}

.input-fields {
  margin-bottom: 30px;
}

.input-fields textarea{
  font-family: "Lato", sans-serif;
}


.cliente-question {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0px;
  margin-bottom: 30px;
}
.cliente-question .radio-group {
  display: flex;
  gap: 0.5rem;
}

.radio-option {
  display: flex;
  align-items: center;
}

.radio-option input {
  margin-right: 5px;
  margin-bottom: 0px;
}

/*.radio-group input[type="radio"] {
  margin-bottom: 0px;
}*/

input[type="radio"] {
  width: 16px;
  height: 16px;
  margin-bottom: 0px;
}


.check {
  width: 16px !important;
  height: 16px;
}

/* ====== Modal Popup Styles ====== */
.formspree-modal-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black background */
  align-items: center;
  justify-content: center;
}

.formspree-modal-overlay.show {
  display: flex;
  animation: fadeIn 0.4s ease-out forwards;
}

.formspree-modal-overlay.fade-out {
  animation: fadeOut 0.3s ease-in forwards;
}

.formspree-modal-box {
  background-color: #fff; /* White background for the modal box */
  color: #000; /* Black text color */
  padding: 20px;
  border-radius: 0px 0px 8px 8px;
  max-width: 100%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  text-align: center;
}

.formspree-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}


  /* Modal background and text styling */
  .formspree-modal-overlay {
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black background */
  }


/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ====== Footer ====== */
.footer {
  background-color: #1a1a1a;
  padding: 30px 40px;
  text-align: center;
  font-size: 0.9rem;
}

.footer-icons a img{
  margin-top: 15px;
  width: 24px;
  height: auto;
}


/* ====== Mobile Navigation ====== */
.hamburger {
  display: none;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
  position: relative;
  z-index: 1000;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  align-items: start;
  position: fixed;
  top: 0;
  right: -100%;
  width: 35%;
  height: 100%;
  padding: 120px 20px 20px 20px;
  transition: right 0.5s ease;
  z-index: 2000;
  background: linear-gradient(114deg, rgba(255, 255, 255, 0.09) 1.13%, rgba(255, 255, 255, 0.01) 120.83%);
  box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(5px);
  border-left: 1px solid #ffffff25;
}

.mobile-nav.open {
  right: 0;
}
.mobile-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
}

.mobile-nav .menu-item {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 15px 0;
  transition: background-color 0.5s ease;
}

.mobile-nav .menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-nav .menu-item a {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
}

@media (max-width: 1024px) {
  .hamburger {
    display: block;
  }
}

.mobile-nav .close-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
  z-index: 1001;
}

.mobile-nav .mobile-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
}

div .mobile-logo {
  width: 100%;
}
.mobile-nav .mobile-logo img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

/* Animations */
.fade-in, .slide-left, .slide-right {
  opacity: 0;
  transition: all 0.8s ease-out;
  transition-delay: 0.2s;
}
.fade-in {
  transform: translateY(40px);
}
.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}
.slide-left {
  transform: translateX(-40px);
}
.slide-left.show {
  opacity: 1;
  transform: translateX(0);
}
.slide-right {
  transform: translateX(40px);
}
.slide-right.show {
  opacity: 1;
  transform: translateX(0);
}

/* ====== Miscellaneous ====== */
.section {
  padding: 100px 40px;
  text-align: center;
  margin-bottom: 100px;
}
.section h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}
.hero:last-of-type {
  margin-bottom: 0;
}

.section-centered {
  text-align: center;
  position: relative;
  background: grey;
}
.section-centered .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}
.section-centered .content, .section-centered .button {
  position: relative;
  z-index: 2;
}
.section-centered .button a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.section-consulenza-personalizzata {
  text-align: center;
  position: relative;
  background: url('images/consulenza.jpg') no-repeat center center;
  background-size: cover;
  margin-bottom: 100px;
}
.section-consulenza-personalizzata .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}
.section-consulenza-personalizzata .content, 
.section-consulenza-personalizzata .button {
  position: relative;
  z-index: 2;
}
.section-consulenza-personalizzata .button a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

/* Cards */
.pilastri-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 30px;
}
@media (min-width: 768px) {
  .pilastri-cards {
    flex-direction: row;
    justify-content: space-between;
  }
}
.pilastro-card {
  border-radius: 5px;
  border: 1px solid #ffffff25;
  background: linear-gradient(114deg, rgba(255, 255, 255, 0.09) 1.13%, rgba(255, 255, 255, 0.01) 120.83%);
  box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(5px);
  text-align: center;
  padding: 20px;
}
.pilastro-card div {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px auto;
}
.pilastro-card h3 {
  margin-bottom: 20px;
}
.pilastro-card:hover {
  transform: scale(1.1);
  transition: all 0.8s ease-out;
}

.icon-pilastro img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.pilastro-card img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.pilastro-card:nth-child(3) .icon-pilastro img {
  content: url('images/icon-indipendenza2x.png');
}

/* ====== Video Hero Section ====== */
.video-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
}

.video-hero .background-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-hero .background-video img {
  display: none; /* Hide fallback image by default */
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-hero .background-video:empty + img,
.video-hero .background-video:not([src]) + img {
  display: block; /* Show fallback image when video is unsupported */
}

.video-hero .video-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  text-align: center;
  z-index: 1;
}

.video-hero .video-overlay h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.video-hero .video-overlay p {
  font-size: 1.5rem;
}

.video-hero-logo {
  display: block;
  margin: 30px auto 0;
  height: 180px;
  width: auto;
}

section.video-hero {
  margin-top: -100px;
  border-radius: 4px;
  margin-bottom: 50px;
}

/* ====== Full-width Section ====== */
.fullwidth-section {
  width: 100%;
  height: 450px;
  margin-bottom: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
}
.fullwidth-section h2 {
  font-size: 2rem;
}

.family.fullwidth-section {
  background: url('images/family.jpg') no-repeat center center;
  background-size: cover;
  background-position: center;
}

/* Fullwidth Section for Servizi */
#servizi.fullwidth-section {
  width: 100%;
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  background: url('images/servizi.jpg');
  background-size: cover;
  background-position: center center;
}

/* ====== Text Left Image Right ====== */
.text-left-image-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-align: left;
}

.text-left-image-right div {
  flex: 1;
}

.text-left-image-right img {
  flex: 1;
  max-width: 50%;
  height: 400px;
  border-radius: 5px;
  object-fit: cover;
}

img {
  border-radius: 5px;
}

.hero-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  background-color: #444;
  border-radius: 5px;
}

section {
  border-radius: 5px;
}

.pilastri-section {
  background-image: url('images/pilastri-bg.jpg');
  background-size: cover;
  background-position: center;
}

/* Fallback Image */
.fallback-image {
  display: none;
  width: 100%;
  height: auto;
}

.background-video:empty + .fallback-image,
.background-video:not([src]) + .fallback-image {
  display: block;
}

  /* ====== Fcontact form section ====== */
.contactform{
  padding: 100px 40px;
  text-align: center;

}

.contactform h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}





/* ====== Responsive Adjustments ====== */
@media (max-width: 1024px) {
  body {
    padding: 40px 80px;
  }
  nav {
    display: none;
  }
  .hero {
    flex-direction: column;
    text-align: center;
  }
  .hero-text {
    order: 1; /* Ensure text content appears first */
    padding-right: 0;
    margin-bottom: 20px;
  }
  .hero-media {
    order: 2; /* Ensure image appears after text */
    width: 100%;
    height: auto;
  }
}

@media (max-width: 768px) {
  body {
    padding: 30px;
  }
  .hero {
    padding: 40px 20px;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .hero-media img {
    height: auto;
    max-width: 100%;
  }
  .text-left-image-right {
    flex-direction: column;
    text-align: center;
  }
  .text-left-image-right img {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .contactform{
    padding: 60px 10px;
  }
  
  .contactform h2 {
    font-size: 1.5rem;
  }

  .section h2{
    font-size: 1.5rem;
  }

  .section{
    padding: 80px 20px;
  }

  .video-hero .video-overlay h1 {
    font-size: 2.3rem;
 
  }

  .mobile-nav .mobile-logo img{
    width: 90px;
    height: 90px;

  }

  .text-left-image-right img {
    max-width: 100%;
    height: auto;
  }


}