/* =========================================================
   INCOTERMS WIZARD 2020 - GO PLUS EXPRESS
   Style Cargoson : sélection progressive par élimination
   Préfixe: incw-  |  Dark mode professionnel
   ========================================================= */

.incw-module,
#incw-module {
  background: linear-gradient(135deg, #0a1320 0%, #0f1e2e 50%, #1a2438 100%);
  border-radius: var(--radius);
  min-height: 700px;
  position: relative;
}
.incw-module::before,
#incw-module::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--gold) 50%, var(--teal) 100%);
  z-index: 1;
}

/* ===== HEADER ===== */
.incw-header {
  padding: 30px 30px 0;
  text-align: center;
  color: #fff;
  position: relative;
}
.incw-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.incw-header h1 .accent { color: var(--gold); }
.incw-header p {
  color: #94a3b8;
  font-size: 0.95rem;
  margin: 0;
  max-width: 700px;
  margin: 0 auto;
}

/* ===== LAYOUT PRINCIPAL ===== */
.incw-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  padding: 30px;
}
@media (max-width: 900px) {
  .incw-layout { grid-template-columns: 1fr; }
  .incw-results-panel { order: -1; }
}

/* ===== PANNEAU GAUCHE - QUESTIONS ===== */
.incw-questions-panel {
  background: rgba(15, 30, 46, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.incw-section {
  margin-bottom: 24px;
}
.incw-section:last-child { margin-bottom: 0; }
.incw-section-title {
  text-align: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: -0.01em;
}

/* === Toggle Type de transport === */
.incw-transport-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 8px;
}
.incw-transport-btn {
  background: transparent;
  border: 2px solid transparent;
  color: #94a3b8;
  padding: 12px 16px;
  border-radius: 9px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.incw-transport-btn:hover { color: #fff; }
.incw-transport-btn.active {
  background: rgba(245, 197, 24, 0.1);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 0 0 rgba(245, 197, 24, 0.4);
}
.incw-transport-btn i { font-size: 14px; }

/* === Questions de responsabilité === */
.incw-questions-list {
  margin-top: 8px;
}

.incw-question-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  animation: incw-slide-in 0.3s ease;
}
@keyframes incw-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.incw-question-row:last-child { border-bottom: none; }
.incw-question-row.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.incw-question-label {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.incw-question-label .hint {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-weight: 400;
  margin-top: 2px;
}

.incw-answer-buttons {
  display: flex;
  gap: 6px;
}
.incw-ans-btn {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-width: 72px;
  text-align: center;
}
.incw-ans-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.incw-ans-btn.active {
  background: rgba(245, 197, 24, 0.08);
  border-color: var(--gold);
  color: var(--gold);
}
.incw-ans-btn.either {
  background: rgba(100, 116, 139, 0.15);
  border-color: rgba(100, 116, 139, 0.4);
  color: #cbd5e1;
}
.incw-ans-btn.either.active {
  background: rgba(100, 116, 139, 0.25);
  border-color: #94a3b8;
  color: #fff;
}
.incw-ans-btn.disabled {
  opacity: 0.25;
  cursor: not-allowed;
  text-decoration: line-through;
}
.incw-ans-btn.disabled:hover {
  background: transparent;
  color: #94a3b8;
}

/* ===== PANNEAU DROITE - RÉSULTATS ===== */
.incw-results-panel {
  position: sticky;
  top: 20px;
  align-self: start;
  background: rgba(15, 30, 46, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px;
  backdrop-filter: blur(10px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.incw-results-title {
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.incw-results-title i {
  width: 28px; height: 28px;
  background: rgba(245, 197, 24, 0.15);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.incw-counter {
  color: #94a3b8;
  font-size: 12px;
  margin-bottom: 14px;
  text-align: center;
}
.incw-counter strong {
  color: var(--gold);
  font-size: 1.5rem;
  font-family: 'Courier New', monospace;
  display: block;
  margin-bottom: 2px;
}

/* Pills des Incoterms */
.incw-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.incw-pill {
  background: linear-gradient(135deg, var(--teal), #008a80);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: var(--font);
  letter-spacing: 0.02em;
  position: relative;
  animation: incw-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes incw-pop-in {
  0% { opacity: 0; transform: scale(0.5); }
  60% { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}
.incw-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 169, 157, 0.4);
}
.incw-pill.eliminated {
  animation: incw-eliminate 0.4s ease forwards;
}
@keyframes incw-eliminate {
  to { opacity: 0; transform: scale(0.7) translateX(-20px); }
}

.incw-empty-results {
  text-align: center;
  padding: 30px 20px;
  color: #64748b;
}
.incw-empty-results i {
  font-size: 48px;
  color: #334155;
  margin-bottom: 12px;
  display: block;
}
.incw-empty-results p {
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}

/* Recap final - 1 seul Incoterm */
.incw-final {
  background: linear-gradient(135deg, var(--teal), #008a80);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: #fff;
  margin-top: 14px;
  position: relative;
  overflow: hidden;
}
.incw-final::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(245, 197, 24, 0.3), transparent 50%);
  animation: incw-rotate 10s linear infinite;
}
@keyframes incw-rotate {
  to { transform: rotate(360deg); }
}
.incw-final-content { position: relative; z-index: 1; }
.incw-final-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.9;
  margin-bottom: 6px;
}
.incw-final-code {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
}
.incw-final-name {
  font-size: 14px;
  opacity: 0.95;
  margin-bottom: 14px;
}
.incw-final-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.incw-final-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.incw-final-btn:hover { background: rgba(255, 255, 255, 0.25); }
.incw-final-btn.gold {
  background: var(--gold);
  color: var(--dark);
  border-color: var(--gold);
}
.incw-final-btn.gold:hover { background: #fff; }

/* ===== ACTIONS BARRES (RESET) ===== */
.incw-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
  gap: 10px;
}
.incw-progress-text {
  color: #94a3b8;
  font-size: 12px;
}
.incw-progress-text strong { color: #fff; }
.incw-toolbar-actions { display: flex; gap: 8px; }
.incw-tb-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 7px 14px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.incw-tb-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.incw-tb-btn.gold {
  background: var(--gold);
  color: var(--dark);
  border-color: var(--gold);
}
.incw-tb-btn.gold:hover { background: #fff; }
.incw-tb-btn.gold:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== PROGRESS BAR ===== */
.incw-progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}
.incw-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}

/* ===== DETAIL MODAL (réutilise les styles inc- de l'autre module) ===== */
.incw-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.incw-detail-modal.active { display: flex; animation: incw-fade-in 0.3s ease; }
@keyframes incw-fade-in { from { opacity: 0; } to { opacity: 1; } }

.incw-detail-content {
  background: #fff;
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.incw-detail-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  z-index: 2;
}
.incw-detail-close:hover { background: rgba(0, 0, 0, 0.8); }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .incw-layout { padding: 16px; gap: 16px; }
  .incw-questions-panel, .incw-results-panel { padding: 16px; }
  .incw-question-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .incw-answer-buttons { width: 100%; }
  .incw-ans-btn { flex: 1; min-width: 0; padding: 8px 4px; font-size: 11px; }
  .incw-final-code { font-size: 2rem; }
  .incw-header h1 { font-size: 1.4rem; }
}

/* ===== TOAST ===== */
.incw-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: var(--gold);
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 99999;
  font-weight: 600;
  font-size: 13px;
  opacity: 0;
  transition: all 0.3s ease;
  border: 1px solid var(--gold);
}
.incw-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
