/* ===================== RESET & VARIABILI ===================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --clr-primary: #701c91;
  --clr-primary-dark: #5a1773;
  --clr-accent: #8b6ee0;
  --shadow-medium: 0 4px 10px rgba(0, 0, 0, .3);
}

/* ===================== FLEX COLUMN PER FOOTER STICKY ===================== */
html, body {
  height: 100%;
  min-height: 100vh;
  width: 100vw;
  font-family: 'Lato', 'Inter', Arial, sans-serif;
  line-height: 1.6;
  color: #242038;
  background: #f5f0fc;
  scroll-behavior: smooth;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

body {
  flex: 1 0 auto;
}

.main-container, .page-content, .section {
  flex: 1 0 auto;
}

.footer, #footer-desktop.footer {
  flex-shrink: 0;
  margin-top: auto;
}

/* ===================== HERO HEADER ===================== */

#header {
  position: relative;
  padding-bottom: 56.25%; /* Aspect ratio 16:9 */
  color: #fff;
  text-align: left;
  background-color: #3e2561;
  background-image: url("../images/hero_rid/hero_1920x1080.webp");
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: center center;
  padding-top: 0; /* Rimuove padding extra sul top */
  border-bottom: 2px solid #a37ddc; /* Bordo inferiore */
  z-index: 5;
}

/* Responsive hero images */
@media (max-width: 768px) {
  #header {
    background-image: url("../images/hero_rid/hero_1125x1090_mobile.webp");
    background-size: 100% auto;
    padding-bottom: 96.88%; /* Aspect ratio 1125x1090 */
  }
}
@media (min-width: 1200px) {
  #header {
    background-image: url("../images/hero_rid/hero_2560x1440.webp");
    background-size: 100% auto;
  }
}
@media (min-width: 1600px) {
  #header {
    background-image: url("../images/hero_rid/hero_3200x1800.webp");
    background-size: 100% auto;
  }
}


/* Overlay */
#header .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 1;
}

/* Container */
#header .container {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 8vw; /* Inizia all'8% dalla sinistra del viewport */
  z-index: 2;
  max-width: 40vw; /* Larghezza massima del 40% del viewport */
  padding: 0 20px 0 0; /* Padding interno, il padding sinistro non è più necessario qui */
  display: flex;
  flex-direction: column;
  justify-content: center; /* Centra verticalmente il contenuto del testo */
  align-items: flex-start; /* Allinea il testo a sinistra all'interno del container */
}

/* Titolo & testo */
.main-title {
  font-size: 2.7rem; /* Dimensione desktop di default */
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 25px;
}

.main-title .line,
.main-text {
  display: block;
  opacity: 1;
  transform: none;
  line-height: 1.08;
}


/* Responsive header */
@media (max-width: 700px) {
  .main-title {
    font-size: 2.2rem; /* Dimensione mobile per il titolo */
    line-height: 1.1;
  }
}

.main-text {
  font-size: 1.25rem; /* Dimensione desktop di default */
  /*max-width: 900px;*/
  margin: 0 auto;
}

.main-text.mobile-text {
  display: none; /* Nascondi il testo mobile per desktop */
}

@media (min-width: 1600px) {
  .main-title {
    font-size: 3.8rem; /* Dimensione extra-large per il titolo */
  }

  .main-text {
    font-size: 1.4rem; /* Dimensione extra-large per il testo */
  }

  /* Nuova regola per il contenitore su schermi grandi */
  #header .container {
    justify-content: flex-start; /* Allinea il contenuto in alto */
    padding-top: 240px; /* Aumentato ulteriormente per abbassare il testo */
  }
}

/* ===================== UTILITY / ACCESSIBILITÀ ===================== */
a {
  color: var(--clr-primary);
  text-decoration: none;
  transition: color 0.18s;
}
a:hover { color: var(--clr-accent); }

.desktop-only { display: block; }
.mobile-only  { display: none; }
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only  { display: block !important; }
}
.hidden { display: none !important; }

body.no-scroll {
  overflow: hidden !important;
  position: fixed !important;
  width: 100vw !important;
  /* Per mobile */
  touch-action: none;
  overscroll-behavior: none;
}

/* ===================== SCROLL TO TOP BUTTON ===================== */
#scrollToTopBtn {
  position: fixed;
  inset: auto 30px 30px auto;
  z-index: 2147483647;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-medium);
  opacity: 0;
  pointer-events: none;
  transform: scale(.8);
  transition: opacity .35s ease, transform .35s ease;
}
#scrollToTopBtn.show,
#scrollToTopBtn.scroll-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
#scrollToTopBtn:hover {
  background: var(--clr-primary-dark);
}

/* ===================== COOKIE BANNER GDPR ===================== */
#cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #fff;
  padding: 22px 12px 19px 12px;
  box-shadow: 0 -2px 32px rgba(44,20,70,0.14);
  border-top: 2px solid #701c91;
  text-align: center;
  font-size: 1.07rem;
  color: #3c2c4c;
  display: none;
  animation: cookie-pop-in 0.6s;
}
@keyframes cookie-pop-in {
  0% { transform: translateY(120px); opacity: 0;}
  100% { transform: translateY(0); opacity: 1;}
}
#cookie-banner a {
  color: #701c91;
  font-weight: 600;
  text-decoration: underline;
  transition: color 0.14s;
}
#cookie-banner a:hover { color: #8b6ee0; }
#cookie-banner button {
  background: #701c91;
  color: #fff;
  font-weight: 700;
  padding: 8px 22px;
  border: none;
  border-radius: 7px;
  margin: 0 6px;
  font-size: 1em;
  transition: background 0.17s, color 0.17s;
  cursor: pointer;
  box-shadow: 0 2px 18px rgba(108,60,197,0.07);
  outline: none;
}
#cookie-banner button#decline-cookies {
  background: #e0e0e0;
  color: #701c91;
}
#cookie-banner button:hover:not(#decline-cookies) {
  background: #8b6ee0;
  color: #fff;
}
#cookie-banner button#decline-cookies:hover {
  background: #ccc;
  color: #5a1773;
}

@media (max-width: 700px) {
  #cookie-banner {
    font-size: 1rem;
    padding: 16px 4px 14px 4px;
  }
  #cookie-banner button {
    width: 44vw;
    max-width: 180px;
    margin-top: 8px;
    font-size: 0.99em;
    padding: 10px 0;
    display: inline-block;
  }
  #cookie-banner div {
    margin-top: 9px;
  }
}

/* ===================== MODALE SUBMIT ===================== */
.form-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(52, 52, 52, 0.24);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.form-modal-overlay.show {
  pointer-events: auto;
  opacity: 1;
}
.form-modal-box {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 36px rgba(0,0,0,0.13);
  padding: 38px 40px 32px 40px;
  min-width: 260px;
  max-width: 96vw;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: pop-in-modal 0.6s;
}
@keyframes pop-in-modal {
  0% { transform: scale(0.78); opacity: 0;}
  80% { transform: scale(1.07);}
  100% { transform: scale(1); opacity: 1;}
}
#form-modal-icon {
  font-size: 2.6em;
  margin-bottom: 12px;
  animation: icon-pop-modal 0.8s;
}
@keyframes icon-pop-modal {
  0% { transform: scale(0.4); opacity: 0;}
  80% { transform: scale(1.17);}
  100% { transform: scale(1); opacity: 1;}
}
#form-modal-message {
  display: block;
  font-size: 1.18em;
  font-weight: 600;
  color: #222;
}
/* Success/Error colori */
.form-modal-box.success #form-modal-icon,
.form-modal-box.success #form-modal-message {
  color: var(--clr-primary);
}
.form-modal-box.error #form-modal-icon,
.form-modal-box.error #form-modal-message {
  color: #be2959;
}

/* ===================== HEADER STATES ===================== */


#header .content-box {
  padding: 44px 0 36px 0;
  margin: 0;
  transition: padding 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==== MOBILE HEADER HEIGHT ==== */
@media (max-width: 700px) {
  html, body {
    height: auto !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  #header {
    height: 60vh !important;
    min-height: 60vh !important;
  }
}

/* ==== SOTTOLINEATURA TITOLI ==== */
.section-title .title-accent {
  display: block;
  width: 148px;
  height: 3px;
  margin: 4px auto 0 auto;
  background: linear-gradient(90deg, #701c91 70%, #8b6ee0 100%);
  border-radius: 2px;
  opacity: 0.7;
}
@media (max-width: 700px) {
  .section-title .title-accent {
    height: 2.5px;
    margin-top: 3px;
  }
}
.char {
  display: inline-block;
  position: relative;
}

.word {
  display: inline-block;
  white-space: normal;
}

.main-title .line,
.main-text {
  word-break: normal !important;
  overflow-wrap: normal !important;
  white-space: normal !important;
  hyphens: none !important;
  text-align: left;
}
