.mask-custom {
  background-color: rgba(0, 0, 0, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#team img {
  cursor: pointer;
}

/* ===== FIRST PAGE FULL HEIGHT ===== */
#clkFirstPage {
  height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

#clkCarouselSection {
  flex: 1;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#clkFirstPage #chisiamo {
  display: none;
}

/* ===== CAROUSEL ===== */
#carouselMaterialStyle {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

#carouselMaterialStyle .carousel-control-prev,
#carouselMaterialStyle .carousel-control-next,
#carouselMaterialStyle .carousel-indicators {
  display: none !important;
}

/* Responsive - carousel sempre a piena pagina */
@media (max-width: 768px) {
  #clkCarouselSection {
    flex: 1;
  }
}

@media (min-height: 900px) {
  #clkFirstPage {
    height: 100vh;
  }

  #clkCarouselSection {
    flex: 1;
  }
}

.carousel-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 1;
  transition: none;
  display: block !important;
}

.carousel-item.active {
  opacity: 1;
  z-index: 2;
  position: relative;
}

.slide-img-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Ken Burns effect - different directions per slide */
.carousel-item.active img {
  animation: kenBurnsDefault 12s forwards;
}

.carousel-item.active.kb-zoom-in img {
  animation: kenBurnsZoomIn 12s forwards;
}

.carousel-item.active.kb-zoom-out img {
  animation: kenBurnsZoomOut 12s forwards;
}

.carousel-item.active.kb-pan-left img {
  animation: kenBurnsPanLeft 12s forwards;
}

.carousel-item.active.kb-pan-right img {
  animation: kenBurnsPanRight 12s forwards;
}

@keyframes kenBurnsDefault {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

@keyframes kenBurnsZoomIn {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.12) translate(-1%, -1%); }
}

@keyframes kenBurnsZoomOut {
  0% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes kenBurnsPanLeft {
  0% { transform: scale(1.05) translateX(2%); }
  100% { transform: scale(1.1) translateX(-2%); }
}

@keyframes kenBurnsPanRight {
  0% { transform: scale(1.05) translateX(-2%); }
  100% { transform: scale(1.1) translateX(2%); }
}

/* Carousel caption base */
.carousel-caption {
  opacity: 0;
  z-index: 3;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  right: 0;
  padding: 0 15px;
}

.carousel-item.active .carousel-caption {
  animation: fadeInCaption 1s forwards 0.3s;
}

@keyframes fadeInCaption {
  0% { opacity: 0; transform: translateY(-40%); }
  100% { opacity: 1; transform: translateY(-50%); }
}

/* Caption positioning variants */
.carousel-caption.caption-center .caption-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.carousel-caption.caption-left .caption-content {
  max-width: 600px;
  margin-left: 5%;
  text-align: left;
}

.carousel-caption.caption-right .caption-content {
  max-width: 600px;
  margin-left: auto;
  margin-right: 5%;
  text-align: right;
}

/* Caption content styling */
.caption-content {
  padding: 2rem 2.5rem;
}

.caption-content .subtitle {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.caption-content .headline {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.caption-content .description {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* CTA Button */
.carousel-cta {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid white;
  color: white;
  background: transparent;
}

.carousel-cta:hover {
  background: white;
  color: #1a1a2e;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.carousel-cta.cta-primary {
  background: var(--mdb-primary);
  border-color: var(--mdb-primary);
}

.carousel-cta.cta-primary:hover {
  background: white;
  color: var(--mdb-primary);
}

/* Custom indicators */
.custom-carousel-controls {
  position: absolute;
  bottom: 25px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.custom-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.custom-indicator:hover {
  background-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.1);
}

.custom-indicator.active {
  background-color: white;
  transform: scale(1.3);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Progress bar on indicator */
.custom-indicator.active::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid white;
  border-top-color: transparent;
  animation: indicatorProgress 8s linear forwards;
}

@keyframes indicatorProgress {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .caption-content {
    padding: 1.5rem;
  }

  .caption-content .headline {
    font-size: 1.75rem;
  }

  .caption-content .description {
    font-size: 0.95rem;
    display: none;
  }

  .carousel-caption.caption-left .caption-content,
  .carousel-caption.caption-right .caption-content {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .carousel-cta {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .caption-content .headline {
    font-size: 1.4rem;
  }

  .caption-content .subtitle {
    font-size: 0.75rem;
  }
}

/* ===== SEZIONE INNOVAZIONE 2026 - Glassmorphism cards ===== */
.innovation-section {
  padding: 4rem 0;
}

.badge-new {
  background: rgba(255, 123, 0, 0.12);
  border: 1px solid rgba(255, 123, 0, 0.4);
  color: #ff7b00;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 50rem;
}

/* Card glassmorphism - mantiene stile fisso */
.card-innovation {
  background: rgba(4, 20, 40, 0.88);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-innovation::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(53, 192, 255, 0.08), transparent 55%);
  pointer-events: none;
}

.card-innovation:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
}

.card-innovation .card-body {
  position: relative;
  z-index: 1;
}

.card-innovation .icon-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #003b73, #051226);
  color: #35c0ff;
  border: 2px solid rgba(53, 192, 255, 0.3);
}

.card-innovation h5 {
  color: #e9edf5;
  font-weight: 600;
}

.card-innovation p {
  color: #b9c4dd;
  font-size: 0.9rem;
}

.card-innovation ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card-innovation ul li {
  color: #c5d2eb;
  font-size: 0.85rem;
  padding: 0.4rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-innovation ul li i {
  color: #35c0ff;
  font-size: 0.75rem;
}

/* ===== SEZIONI THEME-AWARE ===== */

/* Separatore sottile tra sezioni - theme aware */
.section-divider {
  border-top: 1px solid var(--mdb-border-color);
}

/* Hover effect per le icone app */
.apps-section .bg-image {
  transition: transform 0.3s ease;
}

.apps-section .bg-image:hover {
  transform: scale(1.05);
}

/* Glow effect sulle immagini - solo in dark mode */
[data-mdb-theme="dark"] .apps-section .rounded-circle {
  box-shadow: 0 0 20px rgba(53, 192, 255, 0.2);
  transition: box-shadow 0.3s ease;
}

[data-mdb-theme="dark"] .apps-section .bg-image:hover .rounded-circle {
  box-shadow: 0 0 30px rgba(53, 192, 255, 0.4);
}

/* ClkBroker section */
.clkbroker-section {
  min-height: 400px;
  display: flex;
  align-items: center;
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--mdb-body-color);
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* Icona tema */
[data-mdb-theme="light"] .theme-icon-dark { display: inline; }
[data-mdb-theme="light"] .theme-icon-light { display: none; }
[data-mdb-theme="dark"] .theme-icon-dark { display: none; }
[data-mdb-theme="dark"] .theme-icon-light { display: inline; }

/* ===== APP DETAIL DRAWER ===== */
.app-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.app-drawer-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.app-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 520px;
  max-width: 90vw;
  height: 100vh;
  background: var(--mdb-body-bg);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
  z-index: 1050;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-drawer.show {
  transform: translateX(0);
}

/* Header del drawer */
.app-drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--mdb-border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.app-drawer-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.app-drawer-title-group {
  flex: 1;
  min-width: 0;
}

.app-drawer-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  color: var(--mdb-body-color);
}

.app-drawer-subtitle {
  font-size: 0.85rem;
  color: var(--mdb-secondary-color);
  margin: 0;
}

.app-drawer-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--mdb-tertiary-bg);
  color: var(--mdb-body-color);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-drawer-close:hover {
  background: var(--mdb-secondary-bg);
  transform: scale(1.1);
}

/* Body del drawer */
.app-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.app-drawer-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--mdb-body-color);
}

.app-drawer-body h3:first-child {
  margin-top: 0;
}

.app-drawer-body h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--mdb-body-color);
}

.app-drawer-body h5 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.app-drawer-body p {
  color: var(--mdb-secondary-color);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.app-drawer-body ul {
  padding-left: 0;
  list-style: none;
}

.app-drawer-body ul li {
  padding: 0.4rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--mdb-secondary-color);
}

.app-drawer-body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mdb-primary);
}

/* Loading state */
.app-drawer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--mdb-secondary-color);
}

.app-drawer-loading .spinner-border {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
}

/* Gallery nel drawer */
.app-drawer-body .card {
  border: 1px solid var(--mdb-border-color);
  background: var(--mdb-tertiary-bg);
}

.app-drawer-body .card-body {
  padding: 1rem;
}

.app-drawer-body .card-title {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.app-drawer-body .card-text {
  font-size: 0.85rem;
  color: var(--mdb-secondary-color);
}

/* Responsive */
@media (max-width: 576px) {
  .app-drawer {
    width: 100vw;
    max-width: 100vw;
  }

  .app-drawer-header {
    padding: 1rem;
  }

  .app-drawer-icon {
    width: 50px;
    height: 50px;
  }

  .app-drawer-title {
    font-size: 1.2rem;
  }
}

/* ===== ROI CALCULATOR ===== */
.roi-slider-group {
  position: relative;
}

.roi-input {
  text-align: right;
  font-weight: 500;
}

.roi-input::-webkit-outer-spin-button,
.roi-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.roi-input[type=number] {
  -moz-appearance: textfield;
}

/* Chart container */
.roi-chart-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roi-chart-container canvas {
  max-height: 220px;
}

/* Risultato animato */
#eRisparmio {
  display: inline-block;
  min-width: 120px;
}

#calcola .display-5 {
  transition: transform 0.15s ease-out;
}

/* Animazione numeri */
#eCostoMin, #eCostoMax, #eROI {
  display: inline-block;
  min-width: 50px;
}

/* Card risultati sticky su mobile */
@media (max-width: 991.98px) {
  #calcola .col-lg-5 .card {
    position: sticky;
    top: 70px;
    z-index: 10;
  }
}

/* Miglioramento sliders */
#calcola .form-range::-webkit-slider-thumb {
  cursor: grab;
}

#calcola .form-range::-webkit-slider-thumb:active {
  cursor: grabbing;
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */

/* Stato iniziale: nascosto */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.reveal-left {
  transform: translateX(-40px);
}

.reveal.reveal-right {
  transform: translateX(40px);
}

.reveal.reveal-scale {
  transform: scale(0.95);
}

/* Stato visibile */
.reveal.revealed {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Stagger delay per gruppi di elementi */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 100ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 200ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 300ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 400ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 500ms; }
.reveal-stagger > .reveal:nth-child(7) { transition-delay: 600ms; }
.reveal-stagger > .reveal:nth-child(8) { transition-delay: 700ms; }

/* Stagger per righe (4 colonne) */
.reveal-stagger-row > .reveal:nth-child(1),
.reveal-stagger-row > .reveal:nth-child(2),
.reveal-stagger-row > .reveal:nth-child(3),
.reveal-stagger-row > .reveal:nth-child(4) { transition-delay: 0ms; }

.reveal-stagger-row > .reveal:nth-child(5),
.reveal-stagger-row > .reveal:nth-child(6),
.reveal-stagger-row > .reveal:nth-child(7),
.reveal-stagger-row > .reveal:nth-child(8) { transition-delay: 150ms; }

/* Header sezioni */
.reveal-header {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.reveal-header.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Rispetta preferenze utente per movimento ridotto */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-header {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reveal.revealed,
  .reveal-header.revealed {
    transform: none;
  }
}

/* ===== TEAM CARDS ===== */
.team-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
}

.team-avatar {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  border: 3px solid transparent;
}

.team-avatar:hover {
  transform: scale(1.05);
}

/* Glow effect on avatar hover - dark mode */
[data-mdb-theme="dark"] .team-avatar:hover {
  box-shadow: 0 0 25px rgba(53, 192, 255, 0.4) !important;
  border-color: rgba(53, 192, 255, 0.3);
}

/* Light mode avatar hover */
[data-mdb-theme="light"] .team-avatar:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
  border-color: rgba(0, 0, 0, 0.1);
}

/* Team card link styling */
.team-card a {
  color: var(--mdb-body-color);
  transition: color 0.2s ease;
}

.team-card a:hover {
  color: var(--mdb-primary);
}

/* ===== APP CARDS ===== */
.app-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.app-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18) !important;
}

[data-mdb-theme="dark"] .app-card:hover {
  box-shadow: 0 12px 35px rgba(53, 192, 255, 0.2) !important;
}

.app-avatar {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  border: 3px solid transparent;
}

.app-avatar:hover {
  transform: scale(1.1);
}

[data-mdb-theme="dark"] .app-avatar:hover {
  box-shadow: 0 0 25px rgba(53, 192, 255, 0.4) !important;
  border-color: rgba(53, 192, 255, 0.3);
}

[data-mdb-theme="light"] .app-avatar:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
  border-color: rgba(0, 0, 0, 0.1);
}
