/* =========================================================
   STYLE SPÉCIFIQUE - SÉANCE 3 : Structures conditionnelles
   Visualisation d'arbres décisionnels & Simulateur de tarif
   Conforme aux Conventions Officielles 2024-2025
   ========================================================= */

/* SÉLECTEUR RAPIDE DE FORMULES */
.formula-selector-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.formula-btn {
  flex: 1 1 calc(25% - 0.5rem);
  min-width: 120px;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: white;
  color: var(--text-main);
  text-align: center;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.formula-btn:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.formula-btn.active {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(59, 130, 246, 0.15));
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  color: var(--primary-dark);
}

.formula-btn.active.btn-invalid {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.formula-btn .badge-formula {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: #0f172a;
  color: white;
}

/* VISUALISEUR D'ARBRE DÉCISIONNEL CONDITIONNEL */
.decision-flow-container {
  background: #0f172a;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid #334155;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.flow-step-header {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.flow-branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.6rem;
}

.decision-branch-card {
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: #cbd5e1;
  font-size: 0.85rem;
}

.decision-branch-card.is-active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
}

.decision-branch-card.is-active.is-error {
  border-color: #f43f5e;
  background: rgba(244, 63, 94, 0.2);
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.4);
}

.decision-branch-card.is-active.is-success {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.18);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.35);
}

.branch-condition {
  font-family: monospace;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.branch-outcome {
  font-size: 0.8rem;
  color: #94a3b8;
}

.decision-branch-card.is-active .branch-outcome {
  color: #e2e8f0;
}

/* CARTES DE SYNTHÈSE TARIFAIRE */
.metric-summary-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: all 0.2s ease;
  height: 100%;
}

.metric-summary-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.metric-summary-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: monospace;
  margin-top: 0.25rem;
}

/* BADGES DE RÉDUCTION */
.discount-chip {
  display: inline-block;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
