/* ============================================================
   TUNNELIA — style.css
   Calqué sur CashSniffer style.css — mêmes conventions
   ============================================================ */

/* Style général */
body {
  background-color: #f0f2f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Titre sidebar */
#app-title-sidebar {
  margin-bottom: .25rem;
  line-height: 1.1;
}

/* Sous-titre sidebar */
#app-subtitle {
  font-size: .95rem;
  line-height: 1.25;
  margin-top: .2rem;
  margin-bottom: 1rem;
  opacity: .9;
  display: block;
}

/* ============================================================
   SIDEBAR (identique CS)
   ============================================================ */
.sidebar {
  background-color: #ffffff;
  padding: 1.5rem;
  border-right: 1px solid #e6e6e6;
}

/* Desktop : sidebar fixe */
@media (min-width: 768px) {
  .sidebar {
    height: 100vh;
    position: fixed;
    overflow-y: auto;
  }
  .main-content {
    margin-left: 25%;
  }
}

/* Mobile : sidebar + main empilés */
@media (max-width: 767px) {
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e6e6e6;
  }
  .main-content {
    margin-left: 0;
  }
}

/* ============================================================
   CONTENU PRINCIPAL
   ============================================================ */
.main-content {
  padding: 2rem;
}

/* Labels formulaires */
.form-label {
  font-weight: 600;
}
.form-caption {
  font-size: 0.8rem;
  color: #6c757d;
}

.sidebar h4,
.main-content h3 {
  padding-top: 0.5rem;
}

/* ============================================================
   BOUTON FANCY (identique CS — gradient violet)
   ============================================================ */
.fancy-btn {
  padding: 14px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  display: inline-block;
  text-align: center;
}
.fancy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  color: white;
}
.fancy-btn:active {
  transform: translateY(0);
}
.fancy-btn:disabled,
.fancy-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================================
   PAGE DE LOGIN (identique CS)
   ============================================================ */
.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  margin-bottom: 50px;
}

.login-logo {
  font-size: 48px;
  margin-bottom: 4px;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 4px 0;
}

.login-tagline {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 24px 0;
}

/* Messages erreur / succès */
.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 20px;
  font-size: 15px;
  text-align: left;
}
.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 20px;
  font-size: 15px;
  text-align: left;
}

/* Bouton login */
.login-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}
.login-btn:active {
  transform: translateY(0);
}

/* Footer support login */
.support-footer {
  position: fixed;
  bottom: 25px;
  width: 100%;
  text-align: center;
}
.support-footer a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.2s;
  display: inline-block;
}
.support-footer a:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: translateY(-1px);
}

/* Copyright footer login */
.copyright-footer {
  position: fixed;
  bottom: 6px;
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}
.copyright-footer a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
}

/* ============================================================
   COMPOSANTS DASHBOARD TUNNELIA
   ============================================================ */

/* Badges statut compte */
.badge-licence-ok  { background: #22c55e !important; color: white !important; }
.badge-licence-nok { background: #f59e0b !important; color: white !important; }
.badge-apikey-ok   { background: #22c55e !important; color: white !important; }
.badge-apikey-nok  { background: #ef4444 !important; color: white !important; }

/* Étapes de génération */
.generation-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  transition: all 0.3s;
}
.generation-step.done    { background: #f0fdf4; border-color: #86efac; }
.generation-step.active  { background: #eff6ff; border-color: #93c5fd; }
.generation-step.error   { background: #fef2f2; border-color: #fca5a5; }
.generation-step.pending { opacity: 0.5; }
.step-icon { font-size: 18px; min-width: 24px; text-align: center; }

/* Résultats texte tunnel */
.tunnel-result-text {
  white-space: pre-wrap;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  max-height: 500px;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

/* Flash message global */
#flash {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  z-index: 9999;
  min-width: 260px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   UTILITAIRES
   ============================================================ */
.font-monospace { font-family: 'Courier New', Courier, monospace; }


/* ============================================================
   WEBBYFORGE — Styles pages webinaire
   ============================================================ */

/* Formulaire création webinaire — steps numérotés */
.webby-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}
.webby-step-num {
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  flex-shrink: 0;
}
.webby-step-body { flex: 1; }
.webby-step-body label { font-weight: 600; display: block; margin-bottom: 6px; }

/* Sélecteur durée webinaire */
.webby-duration-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.webby-duration-btn {
  padding: 10px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  transition: all 0.2s;
}
.webby-duration-btn:hover,
.webby-duration-btn.active {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea11, #764ba211);
  color: #667eea;
}

/* Sélecteur langue webinaire */
.webby-lang-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.webby-lang-btn {
  padding: 8px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  transition: all 0.2s;
}
.webby-lang-btn:hover,
.webby-lang-btn.active {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea11, #764ba211);
  color: #667eea;
}

/* Estimation coût webinaire */
.webby-cost-estimate {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* Progress bar génération webinaire */
.webby-progress-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}
.webby-progress-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 20px;
}
.webby-step-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  transition: all 0.3s;
}
.webby-step-progress.done    { background: #f0fdf4; border-color: #86efac; }
.webby-step-progress.active  { background: #eff6ff; border-color: #93c5fd; font-weight: 600; }
.webby-step-progress.pending { opacity: 0.45; }
.webby-step-progress.error   { background: #fef2f2; border-color: #fca5a5; }
.webby-step-icon { font-size: 18px; min-width: 24px; text-align: center; }

/* Barre de progression globale */
.webby-global-bar {
  height: 8px;
  border-radius: 4px;
  background: #e5e7eb;
  overflow: hidden;
  margin-bottom: 20px;
}
.webby-global-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.5s ease;
}

/* Page résultats webinaire */
.webby-result-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.webby-result-header {
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.webby-result-body {
  padding: 16px 20px;
}

/* Slides grid dans les résultats */
.webby-slides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.webby-slide-thumb {
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  transition: border-color 0.2s;
  cursor: pointer;
}
.webby-slide-thumb:hover { border-color: #667eea; }
.webby-slide-thumb-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
}
.webby-slide-thumb-preview {
  padding: 8px;
  font-size: 11px;
  color: #6b7280;
  min-height: 60px;
}

/* Download box résultats webinaire */
.webby-download-box {
  background: linear-gradient(135deg, #667eea11, #764ba211);
  border: 2px solid #667eea44;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.webby-download-box-title {
  font-weight: 700;
  font-size: 16px;
  color: #1f2937;
  margin-bottom: 4px;
}
.webby-download-box-desc {
  font-size: 13px;
  color: #6b7280;
}

/* Liste mes webinaires */
.webby-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #fff;
  transition: box-shadow 0.2s;
}
.webby-list-item:hover {
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12);
}
.webby-list-icon {
  font-size: 28px;
  min-width: 40px;
  text-align: center;
}
.webby-list-body { flex: 1; }
.webby-list-title {
  font-weight: 700;
  font-size: 15px;
  color: #1f2937;
  margin-bottom: 2px;
}
.webby-list-meta {
  font-size: 12px;
  color: #9ca3af;
}

/* ============================================================
   OUTILS MARKETING — Pages génération (emails, vsl, lead magnet)
   ============================================================ */

/* Formulaire génération simple (remplace l'ancien mega-formulaire) */
.generate-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
}
.generate-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}
.generate-card-icon {
  font-size: 32px;
}
.generate-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}
.generate-card-desc {
  font-size: 13px;
  color: #6b7280;
  margin: 2px 0 0;
}

/* Résultat génération simple */
.generate-result {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.7;
  max-height: 600px;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}