:root {
  --color-primary: #000;
  --bg-start: #ffffff;
  --bg-end: #c0c7cf;
  --primary-black: #000000;
  --primary-white: #ffffff;
  --light-gray: #f1f2f4;
  --transition-curve: cubic-bezier(0.165, 0.84, 0.44, 1);
  --font-main: "Ferrari Sans", sans-serif;
  --border-radius: 8px;

  /* alert */
  --bg-alert-full-msg: #f1f1f1;
  --color-alert-full-msg: #aaa9a9;
  --bg-alert-success: #00a20f;
  --color-alert-high-contrast-success: #ffffff;
  --bg-alert-error: #db0000;
  --color-alert-high-contrast-error: #ffffff;
  --bg-alert-warning: #e0942a;
  --color-alert-high-contrast-warning: #ffffff;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  -webkit-overflow-scrolling: touch;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%; /* ora body occupa tutta l’altezza della finestra */
}
.body-black::before {
  background: #000;
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
body {
  max-width: 900px;
  margin: 0 auto;
  font-family: "Ferrari Sans";
  height: 100%;
  background: linear-gradient(180deg, var(--bg-start) 60%, var(--bg-end) 100%);
  background-attachment: fixed;
  padding: 0;
  overflow-x: hidden !important;
}
body.bg-custom-dark {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 31%,
    rgba(0, 0, 0, 1) 50%,
    rgba(0, 0, 0, 1) 100%
  );
}
/* body.bg-custom-dark::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 31%,
    rgba(0, 0, 0, 1) 100%
  );
  z-index: -1;
} */
a {
  text-decoration: none;
  color: #000;
}
a:hover {
  color: #000;
}
.flex-grow-1 {
  flex-grow: 1;
}
.flex-grow-2 {
  flex-grow: 2;
}
.text-secondary {
  color: #e5e5e5 !important;
}
.fw-500 {
  font-weight: 500;
}
/******************************
BOTTONI
******************************/
.btn-check:focus + .btn,
.btn:focus {
  outline: 0;
  box-shadow: none;
}
.btn-primary {
  font-family: var(--font-main);
  font-weight: 300;
  background-color: var(--primary-black);
  color: var(--primary-white);
  border: none;
  padding: 12px 0;
  width: 100%;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  transition: var(--transition-curve);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  text-decoration: none;
  margin-bottom: 10px;
  flex-shrink: 0;
  display: block;
  max-width: 300px;
}

.btn-check:active + .btn-primary,
.btn-check:checked + .btn-primary,
.btn-primary.active,
.btn-primary:active,
.show > .btn-primary.dropdown-toggle {
  color: #fff;
  background-color: var(--primary-black) !important;
  border-color: var(--primary-black) !important;
}
.btn-check:focus + .btn-primary,
.btn-primary:focus {
  color: #fff;
  background-color: var(--primary-black) !important;
  border-color: var(--primary-black) !important;
  box-shadow: var(--primary-black) !important;
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  color: var(--primary-white);
  background-color: var(--primary-black);
}

.btn-language {
  font-family: var(--font-main);
  font-weight: 300;
  background-color: var(--light-gray);
  color: var(--primary-black);
  border: none;
  padding: 16px 0;
  width: 100%;
  border-radius: var(--border-radius);
  font-size: 1.2rem;
  letter-spacing: 1px;
  transition: all 0.3s var(--transition-curve);
  box-shadow: none;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-language:hover,
.btn-language:active {
  background-color: var(--primary-black);
  color: var(--primary-white);
  box-shadow: none;
  transform: translateY(-2px);
}

.btn-skip {
  background-color: var(--light-gray);
  color: var(--primary-black);
  border: none;
  padding: 8px 24px;
  border-radius: var(--border-radius);
  font-size: 0.8rem;
  font-weight: 300;
  text-decoration: none;
  transition: var(--transition-curve);
}

.back-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: var(--transition-curve);
  text-decoration: none;
  color: #fff;
}

.back-circle img,
svg {
  vertical-align: middle;
  width: 25px;
}

.back-text {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}
.artista-nome {
  font-size: calc(1.7rem + 0.3vw);
}
.album-vettura {
  font-size: 80%;
}
.scanner-overlay-text {
  position: absolute;
  color: white;
  z-index: 999999;
  text-align: center;
}
.scanner-overlay-top {
  top: 5%;
}
.scanner-overlay-bottom {
  bottom: 5%;
}
.logo-footer-qrcode {
  display: block;
  max-width: 100px;
  width: 100px;
  margin-bottom: 10px;
}
/******************************
LISTA EPISODI
******************************/
.episodes-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 2px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.episode-row {
  display: flex;
  align-items: center;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s var(--transition-curve);
  background: var(--primary-white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.thumb-container {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--light-gray);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}
.thumb-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  /*backdrop-filter: blur(1px);*/
}
.episode-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-left: 18px;
  flex-grow: 1;
}
.artist-name {
  font-weight: 400;
  font-size: 0.8rem;
  margin-bottom: 2px;
  color: var(--primary-black);
}
.car-model {
  font-weight: 300;
  font-size: 0.8rem;
  color: #727272;
}
/******************************
WIZARD
******************************/
.linea-wizard {
  height: 4px;
  flex: 1;
  background-color: var(--light-gray);
  border-radius: 2px;
  transition: background-color 0.4s ease;
}
.linea-wizard.active {
  background-color: var(--primary-black);
}
.min-width-115 {
  min-width: 115px;
}
.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tutorial-title {
  font-size: clamp(1.4rem, 5vh, 1.8rem);
  font-weight: 400;
  margin-bottom: 5px;
  line-height: 1.2;
  letter-spacing: 3px;
  margin-top: 20px;
  font-size: 20px;
  letter-spacing: 1px;
}

.tutorial-subtitle {
  font-size: clamp(0.75rem, 2vh, 0.85rem);
  font-weight: 300;
  color: #7f7f7f;
  margin-bottom: 10px;
  line-height: 1.5;
}
.fs-500 {
  font-weight: 500 !important;
}
.text-subtitle {
  color: #7f7f7f;
  font-weight: 400;
}
.main-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - env(safe-area-inset-bottom));
  padding: 20px 10px;
}
.main-wrapper.no-padding {
  padding: 0;
}
.wizard-step-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 5px;
  min-height: 0;
  margin-top: 18px;
}

.tutorial-image {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
}

.tutorial-image img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}
@media (max-width: 350px) {
  .tutorial-title {
    font-size: 20px;
  }
  .card-subtitle {
    font-size: 0.5rem !important;
  }
  .tutorial-subtitle {
    font-size: 12px;
  }
}
.cards-container {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
  min-height: 0;
}
.img-wizard-full {
  width: 100vw;
  max-width: 100vw !important;
  display: block;
  position: relative;
}
.img-wizard-full-2 {
  width: 100vw;
  max-width: 100% !important;
  display: block;
  position: relative;
  margin: 0 auto;
}
@media (min-width: 600px) {
  .img-wizard-full-2 {
    max-width: 70% !important;
  }
}
.btn-wizard {
  flex-shrink: 0;
  margin-bottom: 30px;
  font-weight: 400;
}
.tutorial-card {
  background-color: var(--primary-white);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  padding: 18px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition-curve);
  max-width: 500px;
  margin: 0 auto;
}
.tutorial-card-box {
  background-color: var(--primary-white);
  border-radius: var(--border-radius);
  border: 1px solid var(--light-gray);
  padding: 18px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition-curve);
  max-width: 500px;
  margin: 0 auto;
}

.card-icon {
  margin-bottom: 12px;
}
.icon-small {
  width: 17px !important;
}
.card-title {
  font-size: 0.8rem;
  font-weight: 400;
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.6rem;
  font-weight: 300;
  color: #7f7f7f;
  margin: 0;
}

.card-icon img {
  width: 24px;
}

.tutorial-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  padding-bottom: 20px;
}

/******************************
SIDEMENU
******************************/
.menu-item {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  justify-content: space-between;
}
.full-page {
  width: 100% !important; /* copre tutta la larghezza */
  max-width: 100% !important; /* assicura che non ci siano limiti */
  height: 100% !important; /* copre tutta l’altezza */
}

.full-page .offcanvas-body {
  height: calc(100% - 56px); /* se vuoi considerare l’altezza header */
  overflow-y: auto; /* scroll interno se serve */
}

.menu-dots-btn {
  background: none;
  border: none;
  padding: 10px;
  color: var(--primary-black);
  cursor: pointer;
  transition: var(--transition-curve);
  text-align: end;
}
/******************************
MODE SELECTION
******************************/
.card-mode-selection {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background-color: #fff;
  padding: 15px 10px;
  margin-bottom: 20px;
  cursor: pointer;
}
.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  padding-bottom: 10px;
}
.site-footer img {
  display: block;
  max-width: 100px;
  width: 100%;
  margin-bottom: 10px;
}
.hero-image-container {
  width: 150px;
  margin: 0 auto 10px auto;
}

.hero-image-container img {
  display: block;
  width: 100%;
}

/******************************
VARI MENU
******************************/
.page-title {
  font-size: 1rem;
  font-weight: 400;
  margin: 40px 0px 40px 0px;
  line-height: 1.2;
  letter-spacing: 0.5px;
  text-align: center;
}
.page-title-2 {
  font-size: 1rem;
  font-weight: 500;
  margin: 40px 0px 40px 0px;
  line-height: 1.2;
  letter-spacing: 0.5px;
  text-align: center;
}
.back-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: var(--transition-curve);
  text-decoration: none;
  color: var(--primary-black);
}
.menu-generic {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Il contenitore deve avere dimensioni definite (es. 100% o VH) */
.container-scanner__camera {
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  position: relative;
}
.container-scanner {
  /* 78px è l'altezza del tuo header/footer fisso */
  flex-grow: 1;
}
.container-scanner-2 {
  /* 78px è l'altezza del tuo header/footer fisso */
  flex-grow: 1;
}
/* Forziamo il video generato dalla libreria a coprire l'intera area */
.container-scanner__camera video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important; /* Questo riempie lo spazio ritagliando i bordi */
  object-position: center;
}

/* Assicuriamoci che l'overlay (il quadrato e l'ombra) sia centrato */
.container-scanner__camera canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

/******************************
PLAYER
******************************/
/* --- PLAYER FISSO IN ALTO --- */

.player-ui-container {
  text-align: center;
  transition: all 0.4s ease;
}

.progress-section {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 20px;
}

.time-display {
  font-size: 12px;
  color: #fff;
  min-width: 35px;
}

.seek_bar_container {
  flex-grow: 1;
  height: 4px;
  background: #2d2d2d;
}

.seek_progress {
  height: 100%;
  background: #fff;
  width: 0%;
  position: relative;
}

.seek_progress::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -6px;
  width: 4px;
  height: 15px;
  background: #fff;
}

.seek_progress-2 {
  height: 100%;
  background: #000;
  width: 0%;
  position: relative;
}

.seek_progress-2::after {
  content: "";
  position: absolute;
  right: -10px;
  top: -6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #000;
}

.playback-controls {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 20px 0px;
}

.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.nav-icon {
  width: 38px;
  height: 38px;
  fill: #fff;
}

.play-pause-circle {
  width: 60px;
  height: 60px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}
#start-play {
  width: 40px;
}

/* --- CONTENITORE TESTO CHE SCORRE --- */

/* Effetto sfumatura in alto (opzionale: il testo sembra sparire nel nulla) */
.fade-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: linear-gradient(to bottom, white, transparent);
  z-index: 1500;
  pointer-events: none;
}

.hyperaudio-transcript span {
  display: inline-block;
  line-height: 1.6;
  color: #666666;
  margin-bottom: 5px;
  transition: all 0.4s ease;
  cursor: pointer;
  transition:
    color 0.3s ease,
    transform 0.3s ease,
    filter 0.3s ease;
  font-size: 130%;
}

.hyperaudio-transcript span.active {
  color: #fff;
}
#menuSidebar {
  z-index: 9999999;
}

#transcript-container {
  flex-grow: 1;
  overflow-y: auto;
  background: linear-gradient(
    180deg,
    rgba(45, 45, 45, 1) 0%,
    rgba(18, 18, 18, 1) 100%
  );
  padding: 20px;
  border-radius: 20px 20px 0 0;
  -webkit-overflow-scrolling: touch;
  /* abilita il “momentum scroll” su iOS */
  overscroll-behavior: contain;
  scrollbar-width: none;
  max-height: 100px;
}
.collapsed #transcript-container {
  background: linear-gradient(
    180deg,
    rgba(45, 45, 45, 1) 0%,
    rgba(39, 39, 39, 1) 17%,
    rgba(0, 0, 0, 1) 39%,
    rgba(0, 0, 0, 1) 100%
  );
}
/* #transcript-container.expanded {
  overflow-y: scroll;
  flex-grow: 1;
  max-height: unset;
} */
/* Stato dopo il click (50/50) */
/* #append_brano img {
  display: block;
}
#append_brano.expanded {
  flex-grow: unset !important;
}
.player-ui-container.expanded {
  flex-grow: unset !important;
} */

/* L'immagine nello stato normale */
.album-art {
  max-height: 380px;
  /* altezza normale */
  margin: 0 auto 15px;
  opacity: 1;
  transition:
    opacity 0.4s ease,
    max-height 0.4s ease,
    margin 0.4s ease;
  display: block;
}

#append_brano {
  position: relative;
}

.main-wrapper-2.collapsed .album-text {
  position: unset;
  transform: unset;
  margin: 10px 0;
}

.album-text {
  position: absolute;
  bottom: -4%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  width: 100%;
  pointer-events: none; /* opzionale */
}

.main-wrapper-2.collapsed .album-art {
  opacity: 0;
  /* sfuma */
  max-height: 0;
  /* riduce spazio occupato */
  margin: 0 auto 0;
  /* elimina il margine */
  pointer-events: none;
  /* disabilita click */
}

.main-wrapper-2.collapsed #append_brano {
  color: #fff;
  margin-top: 20px;
}
.main-wrapper-2.collapsed .player-ui-container {
  margin-bottom: 30px;
}

.podcast-header.collapsed {
  padding-bottom: 5px;
}

.main-wrapper-2.collapsed .podcast-header {
  flex-grow: 1;
  height: unset;
  z-index: 9999;
  padding-bottom: 5px;
}

.main-wrapper-2.collapsed #transcript-container {
  flex-grow: 3;
  max-height: unset;
}

.player-ui-container {
  margin-bottom: 10px;
}

/* Effetto Parallax quando scompare */
/* #append_brano.expanded img.album-art {
  display: none;
} */

@media (min-width: 768px) {
  .album-art {
    max-height: 350px;
  }
}

/*************************************
INIZIO TOAST CUSTOM
**************************************/
.toast {
  position: fixed;
  top: 20px;
  right: 5px;
  z-index: 99999999999;
}

/*************************************
INIZIO ALERT CUSTOM
**************************************/
.alert {
  margin: 0;
  padding: 6px 16px;
  border: 0;
  font-size: 13px;
  border-radius: 6px;
}
.alert-full-msg {
  background-color: var(--bg-alert-full-msg);
  padding: 40px 20px;
  border-radius: var(--bs-border-radius);
  color: var(--color-alert-full-msg);
}

.alert-success-custom {
  background-color: var(--bg-alert-success);
  color: var(--color-alert-high-contrast-success);
}

.alert-error-custom {
  background-color: var(--bg-alert-error);
  color: var(--color-alert-high-contrast-error);
}

.alert-warning-custom {
  background-color: var(--bg-alert-warning);
  color: var(--color-alert-high-contrast-warning);
}

/*************************************
SOLO PER PAGINA PODCAST RISPORDUZIONE
**************************************/

.main-wrapper-2 {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100dvh - env(safe-area-inset-bottom));
  padding: 0px 0px 0px 0px !important;
  transition: all 1s ease;
  /* background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 31%,
    rgba(0, 0, 0, 1) 50%,
    rgba(0, 0, 0, 1) 100%
  ); */
}

.main-wrapper-2.collapsed {
  background: #000;
}

/* HEADER */
.podcast-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding-bottom: 10px;
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* INFO PODCAST */
.podcast-info {
  text-align: center;
}

/* overlay.css */
#desktop-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 1);
  color: white;
  font-size: 2rem;
  text-align: center;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
  z-index: -1;
}

#desktop-overlay.show {
  display: flex;
  opacity: 1;
  z-index: 9999999999;
}

#desktop-overlay.hide {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/*************************************
PAGINA PER INSERIRE IL PIN
**************************************/
.pin-container {
  max-width: 300px;
  margin: 10px auto;
  text-align: center;
  font-family: sans-serif;
}

/* Le 4 lineette */
.pin-display {
  display: flex;
  justify-content: space-between;
  margin: 0px auto 30px auto;
  max-width: 260px;
}

.pin-digit {
  width: 40px;
  height: 50px;
  border-bottom: 2px solid #000;
  font-size: 24px;
  line-height: 50px;
  font-weight: bold;
}

/* Il tastierino */
.keypad {
  justify-content: center;
  display: flex;
  align-items: center;
}

.key {
  background-color: transparent;
  border: none;
  border-radius: 50%; /* Tasti tondi */
  width: 60px;
  height: 60px;
  font-size: 30px;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.key:active {
  background: #e2e6ea;
}

.special-key {
  background: none;
  border: none;
  color: #666;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.hero-subtitle {
  letter-spacing: 5px;
  font-size: clamp(0.7rem, 0.9vh, 0.7rem);
  font-weight: 400;
}
