/* ==========================================================================
   Styles pour la découverte des fonctions affines y = ax + b (p2_l4_t1)
   Écoles Pionnières - 2AC Mathématiques
   ========================================================================== */

.raf-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
}

/* Carte "Je retiens" */
.raf-card-rule {
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
  border: 1.5px solid #99f6e4;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 24px;
}

.raf-rule-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0d9488;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.raf-rule-box {
  background: #ffffff;
  border: 1.5px solid #ccfbf1;
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.05);
}

.raf-rule-core {
  font-size: 16px;
  color: #0f172a;
  line-height: 1.7;
  margin-bottom: 14px;
}

.raf-rule-formula-center {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px 0;
}

.raf-formula-tag {
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 10px;
  padding: 8px 24px;
  font-size: 22px;
  font-weight: 700;
  color: #166534;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.1);
}

.raf-rule-bullets {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  color: #1e293b;
}

.raf-rule-bullets li {
  position: relative;
  padding-left: 20px;
  line-height: 1.6;
}

.raf-rule-bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #0d9488;
  font-size: 20px;
  line-height: 1;
  top: 1px;
}

.raf-highlight-red {
  color: #dc2626;
  font-weight: 700;
}

/* Carte "J'étudie l'exemple" */
.raf-card-example {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 22px;
}

.raf-example-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ea580c;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.raf-problem-text {
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 15.5px;
  color: #1e293b;
  line-height: 1.6;
}

/* Question a) Tableau de valeurs */
.raf-part-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 18px 0 12px;
}

.raf-part-letter {
  color: #ea580c;
  font-weight: 800;
}

.raf-table-container {
  overflow-x: auto;
  margin-bottom: 22px;
}

.raf-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 2px solid #f97316;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  text-align: center;
}

.raf-table td, 
.raf-table th {
  padding: 11px 12px;
  border-bottom: 1px solid #fed7aa;
  border-right: 1.5px solid #fed7aa;
  font-size: 15px;
}

.raf-table tr:last-child td,
.raf-table tr:last-child th {
  border-bottom: none;
}

.raf-table td:last-child {
  border-right: none;
}

.raf-th-label {
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  width: 220px;
  padding-left: 16px !important;
}

.raf-td-val {
  font-size: 17.5px;
  color: #1d4ed8;
  font-weight: 700;
  min-width: 36px;
}

/* Question b) Modélisation par blocs */
.raf-blocks-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
}

.raf-block-wide {
  background: #fef3c7;
  border: 1.5px solid #fde68a;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 15.5px;
  font-weight: 600;
  color: #92400e;
  text-align: center;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.raf-blocks-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 580px;
}

.raf-block-green {
  flex: 1;
  background: #dcfce7;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14.5px;
  font-weight: 600;
  color: #166534;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.raf-plus-bubble,
.raf-minus-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #0284c7;
  color: #ffffff;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.3);
  user-select: none;
}

.raf-minus-bubble {
  background: #0284c7;
}

/* Illustration chandelle */
.raf-candle-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #fffbeb;
  border: 1.5px solid #fef3c7;
  border-radius: 12px;
  padding: 12px 18px;
  margin: 10px 0 16px;
}

.raf-candle-svg {
  max-width: 220px;
  height: auto;
}

.raf-block-purple {
  flex: 1;
  background: #f3e8ff;
  border: 1.5px solid #d8b4fe;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14.5px;
  font-weight: 600;
  color: #6b21a8;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.raf-block-formula {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 10px;
  padding: 10px 32px;
  font-size: 21px;
  font-weight: 700;
  color: #1d4ed8;
  text-align: center;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}

/* Conclusion */
.raf-conclusion-box {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 18px;
  font-size: 15px;
  color: #1e3a8a;
  line-height: 1.6;
}

.raf-conclusion-eq {
  font-size: 18px;
  font-weight: 700;
  color: #1d4ed8;
}

/* Responsive */
@media (max-width: 640px) {
  .raf-section {
    padding: 16px;
  }
  .raf-blocks-row {
    flex-direction: column;
    gap: 8px;
  }
  .raf-plus-bubble {
    margin: 4px 0;
  }
  .raf-th-label {
    width: auto;
    font-size: 13.5px;
  }
}
