/* =====================================================================
   📁 /maths/calcul/calcul_mental/les_tables.css
   =====================================================================
   Habillage SC@LPA — onglet « Apprentissage des tables ».
   ===================================================================== */

.scalpa-tables {
  --scalpa-primary: #2563eb;
  --scalpa-primary-dark: #1e40af;
  --scalpa-soft: #eff6ff;
  --scalpa-soft-2: #f8fafc;
  --scalpa-border: #dbeafe;
  --scalpa-text: #172033;
  --scalpa-muted: #64748b;
  --scalpa-success: #15803d;
  --scalpa-danger: #b91c1c;

  color: var(--scalpa-text);
}

.scalpa-tables__hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--scalpa-border);
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .18), transparent 34%),
    linear-gradient(135deg, #ffffff, var(--scalpa-soft));
  box-shadow: 0 16px 35px rgba(15, 23, 42, .08);
}

.scalpa-tables__hero h1 {
  font-weight: 800;
  letter-spacing: -.03em;
}

.scalpa-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--scalpa-primary-dark);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.scalpa-tables__timer {
  min-width: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 1.25rem;
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8);
}

.scalpa-timer-label {
  color: var(--scalpa-muted);
  font-size: .9rem;
  text-align: center;
}

.scalpa-timer-value {
  font-variant-numeric: tabular-nums;
  font-size: 1.65rem;
  color: var(--scalpa-primary-dark);
}

.scalpa-exercise-card {
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--scalpa-border);
  border-radius: 1.5rem;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .07);
}

.scalpa-option-panel {
  height: 100%;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 1.25rem;
  background: var(--scalpa-soft-2);
}

.scalpa-option-panel legend {
  float: none;
  width: auto;
  margin-bottom: .5rem;
  padding: 0 .35rem;
  color: var(--scalpa-primary-dark);
  font-size: 1rem;
  font-weight: 800;
}

.scalpa-choice-group,
.scalpa-table-selector {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.scalpa-pill-check,
.scalpa-table-check {
  position: relative;
  margin: 0;
  padding: 0;
}

.scalpa-pill-check .form-check-input,
.scalpa-table-check .form-check-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scalpa-pill-check .form-check-label,
.scalpa-table-check .form-check-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: .55rem .9rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.scalpa-table-check .form-check-label {
  min-width: 3rem;
  font-size: 1.1rem;
}

.scalpa-pill-check .form-check-input:checked + .form-check-label,
.scalpa-table-check .form-check-input:checked + .form-check-label {
  border-color: var(--scalpa-primary);
  background: var(--scalpa-primary);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .24);
}

.scalpa-pill-check .form-check-input:focus-visible + .form-check-label,
.scalpa-table-check .form-check-input:focus-visible + .form-check-label {
  outline: 3px solid rgba(37, 99, 235, .25);
  outline-offset: 2px;
}

.scalpa-pill-check .form-check-label:hover,
.scalpa-table-check .form-check-label:hover {
  transform: translateY(-1px);
}

.scalpa-switch .form-check-input,
.scalpa-inline-check .form-check-input {
  cursor: pointer;
}

.scalpa-switch .form-check-label,
.scalpa-inline-check .form-check-label {
  font-weight: 650;
  cursor: pointer;
}

.scalpa-range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.scalpa-range-output {
  display: inline-grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 999px;
  background: var(--scalpa-primary-dark);
  color: #ffffff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.scalpa-example,
.scalpa-mini-card {
  display: inline-flex;
  align-items: center;
  margin-left: .35rem;
  padding: .15rem .45rem;
  border-radius: .55rem;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
}

.scalpa-questions {
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.scalpa-question-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 220px);
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.scalpa-question-row:nth-child(even) {
  background: #f8fafc;
}

.scalpa-question-row:last-child {
  border-bottom: 0;
}

.scalpa-question-text {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 800;
}

.scalpa-answer-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .6rem;
}

.scalpa-answer-input {
  max-width: 8rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
  border-radius: .85rem;
}

.scalpa-answer-mark {
  min-width: 4.5rem;
  font-size: 1.2rem;
  font-weight: 800;
}

.scalpa-answer-input.is-valid {
  border-color: var(--scalpa-success);
  box-shadow: 0 0 0 .2rem rgba(21, 128, 61, .12);
}

.scalpa-answer-input.is-invalid {
  border-color: var(--scalpa-danger);
  box-shadow: 0 0 0 .2rem rgba(185, 28, 28, .12);
}

.scalpa-answer-mark.is-valid {
  color: var(--scalpa-success);
}

.scalpa-answer-mark.is-invalid {
  color: var(--scalpa-danger);
}

.scalpa-score {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  background: #dbeafe;
  color: var(--scalpa-primary-dark);
  font-weight: 800;
  text-align: center;
}

.scalpa-actions {
  display: flex;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
}

@media (max-width: 767.98px) {
  .scalpa-tables__hero {
    flex-direction: column;
  }

  .scalpa-tables__timer {
    align-items: flex-start;
  }

  .scalpa-question-row {
    grid-template-columns: 1fr;
  }
}
