/* Formazione AI Act — stili custom */

.module-media {
  flex: 0 0 30%;
  max-width: 30%;
  background: #f8fafc;
  border-radius: 6px;
  padding: 1rem;
}

.module-media img {
  width: 100%;
  max-width: 100%;
  border-radius: 6px;
}

.module-body p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  background: #f8fafc;
  border-radius: 6px;
  padding: 1rem;
}

.audio-play-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--bs-primary);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.audio-play-btn:hover {
  background: var(--bs-primary-border-subtle, #0b5ed7);
}

.audio-slider {
  flex: 1 1 auto;
  width: 100%;
  height: 8px;
  cursor: pointer;
}

.audio-slider::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
}

.audio-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
}

.audio-time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

.quiz-option {
  cursor: pointer;
}

.progress {
  border-radius: 4px;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s;
}

@media (max-width: 768px) {
  .module-layout {
    flex-direction: column;
  }
  .module-media {
    order: -1;
    max-width: 100%;
    flex-basis: auto;
    margin-bottom: 1rem;
  }
}

/* Tema scuro — sfondo nero e testo chiaro */
[data-bs-theme="dark"] {
  --bs-body-bg: #000000;
  --bs-body-color: #e9ecef;
  --bs-tertiary-bg: #0d0d0d;
  --bs-secondary-bg: #121212;
  --bs-border-color: #2a2a2a;
}

[data-bs-theme="dark"] .module-media,
[data-bs-theme="dark"] .audio-player {
  background: #121212;
}

[data-bs-theme="dark"] .card:hover {
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.08);
}

/* Banner ambiente non di produzione (AA_ENV_LABEL) */
.env-banner {
  background: repeating-linear-gradient(45deg, #f59e0b, #f59e0b 12px, #fbbf24 12px, #fbbf24 24px);
  color: #1f2937;
  letter-spacing: .05em;
}

/* Logo aziendale (multi-azienda) */
.brand-logo {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: .35rem;
  padding: 2px 6px;
}
.brand-logo img { max-height: 28px; max-width: 140px; }
.login-logo { max-height: 72px; max-width: 220px; }
.tenant-logo-preview { max-height: 60px; max-width: 200px; background: #fff; padding: 4px; border: 1px solid var(--bs-border-color); border-radius: .35rem; }
.tenant-welcome > :last-child { margin-bottom: 0; }
.tenant-welcome img { max-width: 100%; height: auto; }

/* Overlay di attesa: compare se il back-end non risponde entro 100 ms (vedi main.js) */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(33, 37, 41, 0.45);
  cursor: wait;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease-in-out, visibility 0s linear 0.15s;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s ease-in-out;
}

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  color: #212529;
  border-radius: 12px;
  padding: 1.25rem 1.75rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
}

.loading-text {
  font-weight: 600;
}
