@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap");

/* ==========================================================================
   Cluster Lucano Automotive Metaverse — landing di accesso
   Impostazione ripresa dal progetto G. Inglese Metaverse,
   palette e grafica adattate agli asset Cluster Lucano.
   ========================================================================== */

:root {
  --navy-deep: #050927;
  --navy: #101c72;
  --blue: #192576;
  --azure: #29abe2;
  --azure-light: #4294ce;
  /* spazio sopra il lockup: usato sia dal contenuto sia dalle waves,
     che devono allinearsi al bordo alto del logo (vedi img/waves.png) */
  --stage-pad: 3rem;
}

body {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  font-family: Poppins, sans-serif;
  font-size: 1.05em;
  line-height: 1.5em;
  letter-spacing: 0.04em;
  overflow-x: hidden;
}

a, a:hover, a:visited {
  color: inherit;
}

a, a:hover {
  text-decoration: underline;
}

/* --- colori ------------------------------------------------------------- */

.background-primary {
  background: var(--navy-deep);
}

.background-secondary {
  background: var(--navy);
}

.background-azure {
  background: var(--azure);
}

.color-primary {
  color: var(--navy-deep);
}

.color-secondary {
  color: #fff;
}

.color-azure {
  color: var(--azure);
}

/* --- tipografia --------------------------------------------------------- */

.bold {
  font-weight: 600;
}

.title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.15em;
  line-height: 1.5em;
  letter-spacing: 0.07em;
}

.title-big {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.7em;
  line-height: 1.3em;
  letter-spacing: 0.06em;
}

.subtitle {
  font-weight: 600;
}

.paragraph {
  font-weight: 400;
}

.paragraph-big {
  font-weight: 400;
  font-size: 1.25em;
  line-height: 1.6em;
  letter-spacing: 0.05em;
}

.overline {
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.8em;
  letter-spacing: 0.35em;
}

.divider {
  width: 100%;
  height: 2px;
  background: var(--azure);
}

/* --- hero --------------------------------------------------------------- */

.hero {
  position: relative;
  width: 100%;
  height: 46vh;
  min-height: 320px;
  max-height: 560px;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
  display: block;
}

.hero::after {
  /* sfuma l'immagine dentro il fondo scuro della sezione successiva */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(to bottom, rgba(5, 9, 39, 0), var(--navy-deep));
  pointer-events: none;
}

/* --- stage: fondo gradiente showroom (accesso + footer) ----------------- */

.stage {
  position: relative;
  flex: 1 1 auto;
  padding-top: var(--stage-pad);
  /* le onde sono absolute e più alte della sezione: senza questo sborderebbero
     in basso allungando la pagina con una fascia vuota */
  overflow: hidden;
  background: var(--navy) url("../img/bg-showroom.jpg") center bottom / cover no-repeat;
}

.stage::before {
  /* raccordo morbido con la fascia hero */
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  inset: 0 0 auto 0;
  height: 240px;
  background: linear-gradient(to bottom, var(--navy-deep), rgba(5, 9, 39, 0));
  pointer-events: none;
}

/* Il PNG delle waves ha il margine superiore trasparente calcolato sul
   riferimento: allineando il suo bordo alto al bordo alto del lockup, il
   rapporto d'altezza fra waves e logo resta corretto a ogni larghezza. */
.waves {
  position: absolute;
  /* padding di .stage + padding di .stage-inner = bordo alto del lockup */
  top: calc(var(--stage-pad) * 2);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  opacity: 0.75;
  pointer-events: none;
}

.stage-inner {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 1200px;
  padding-top: var(--stage-pad);
}

/* --- logo lockup -------------------------------------------------------- */

.logo-metaverse {
  width: 26%;
  max-width: 250px;
}

.logo-cluster {
  width: 52%;
  max-width: 500px;
  margin-top: 0.6rem;
}

.consenso-row {
  width: 100%;
  max-width: 660px;
}

.consenso {
  min-width: 0;
}

.logo-footer {
  width: 70%;
  max-width: 620px;
}

/* --- selettore di lingua ------------------------------------------------ */

/* il markup è generato da js/i18n.js: qui solo la veste */
.lang-switch {
  position: absolute;
  top: 1.5rem;
  right: 1.75rem;
  z-index: 50;
  display: flex;
  gap: 0.5rem;
}

.lang-switch__btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 40px;
  background: rgba(5, 9, 39, 0.45);
  backdrop-filter: blur(3px);
  color: #fff;
  font-family: Poppins, sans-serif;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.lang-switch__btn:hover,
.lang-switch__btn:focus-visible {
  opacity: 1;
  border-color: var(--azure);
}

.lang-switch__btn.is-active {
  opacity: 1;
  border-color: var(--azure);
  background: rgba(41, 171, 226, 0.22);
}

/* flag-icons, formato 4x3 */
.lang-switch__flag {
  width: 20px;
  height: 15px;
  display: block;
  border-radius: 2px;
  /* le bandiere chiare vanno staccate dal fondo scuro */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

@media (max-width: 767.98px) {
  .lang-switch {
    top: 0.9rem;
    right: 0.9rem;
    gap: 0.35rem;
  }

  .lang-switch__btn {
    padding: 0.3rem 0.55rem;
    font-size: 0.7rem;
  }

  .lang-switch__code {
    display: none;
  }
}

/* --- pagine interne (errore / privacy) ---------------------------------- */

/* Pagina errore: hero più bassa e loghi più stretti per portare in alto il
   contenuto e lasciare spazio al video demo fra il lockup e l'avviso */
.error-page .hero {
  height: 26vh;
  min-height: 180px;
  max-height: 240px;
}

.error-page .hero-img {
  object-position: center 40%;
}

.error-page .logo-cluster {
  margin-bottom: 1.5rem;
}

/* Il video sta in un box a proporzione fissa 16:9 (padding-bottom) e viene
   posizionato in assoluto: Safari iOS sbaglia l'altezza dei <video> messi
   direttamente come figli di un flex in colonna. */
.error-page .demo-video-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  max-width: 720px;
  height: 0;
  padding-bottom: 56.25%;
  margin-bottom: 1.5rem;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

@media (min-width: 800px) {
  /* oltre i 720px di larghezza il box non cresce più: altezza fissa 16:9 */
  .error-page .demo-video-wrap {
    height: 405px;
    padding-bottom: 0;
  }
}

.error-page .demo-video {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 767.98px) {
  .error-page .hero {
    height: 140px;
    min-height: 140px;
  }

  .error-page .demo-video-wrap {
    border-radius: 8px;
  }
}

.page-head {
  position: relative;
  padding-top: var(--stage-pad);
  background: var(--navy-deep);
}

.legal-panel {
  width: 90%;
  max-width: 980px;
  margin: 0 auto;
  padding: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(5, 9, 39, 0.55);
  backdrop-filter: blur(2px);
}

.legal-panel h1 {
  font-size: 1.7em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.legal-panel h3 {
  font-size: 1em;
  font-weight: 500;
  line-height: 1.6em;
  color: var(--azure);
  margin-bottom: 2.5rem;
}

.legal-panel p,
.legal-panel li {
  font-weight: 300;
  font-size: 0.95em;
  line-height: 1.9em;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}

.legal-panel a {
  color: var(--azure);
}

.legal-panel .text-decoration-underline {
  text-decoration-color: rgba(41, 171, 226, 0.6);
}

/* --- call to action ----------------------------------------------------- */

.button-action {
  height: 70px;
  min-width: 350px;
  padding: 0 2.5rem;
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 70px;
  font-family: Poppins, sans-serif;
  font-weight: 600;
  font-size: 1.15em;
  letter-spacing: 0.18em;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.button-action:hover:not(:disabled) {
  background: var(--azure);
  border-color: var(--azure);
  color: #fff;
}

.button-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- checkbox informativa ----------------------------------------------- */

input[type=checkbox] {
  display: none;
}

input[type=checkbox] + label {
  flex: 0 0 auto;
  height: 30px;
  width: 30px;
  border: 2px solid var(--azure);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
}

input[type=checkbox] + label::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 3px;
  width: 7px;
  height: 14px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

input[type=checkbox]:checked + label {
  background: var(--azure);
}

input[type=checkbox]:checked + label::after {
  transform: rotate(45deg) scale(1);
}

/* --- responsive --------------------------------------------------------- */

/* schermi bassi (es. laptop 1366x768): comprime hero e spaziature
   per tenere la CTA il più possibile sopra la piega */
@media (min-width: 768px) and (max-height: 860px) {
  :root {
    --stage-pad: 1.25rem;
  }

  .hero {
    height: 34vh;
    min-height: 190px;
  }

  .logo-cluster {
    margin-bottom: 1.75rem !important;
  }

  .paragraph-big {
    margin-bottom: 1.75rem !important;
  }
}

@media (max-width: 767.98px) {
  body {
    font-size: 0.95em;
  }

  .title-big {
    font-size: 1.35em;
  }

  .paragraph-big {
    font-size: 1.05em;
  }

  .logo-metaverse {
    width: 42%;
  }

  .logo-cluster {
    width: 84%;
  }

  .button-action {
    height: 60px;
    min-width: 0;
    width: 100%;
    font-size: 1em;
    letter-spacing: 0.12em;
  }

  .logo-footer {
    width: 92%;
  }

  .legal-panel {
    width: 94%;
    padding: 1.75rem 1.25rem;
  }

  .legal-panel h1 {
    font-size: 1.35em;
  }
}
