:root {
  --estal-bg: #f5f7fb;
  --estal-card-bg: #ffffff;
  --estal-border: #e1e5f0;
  --estal-primary: #7b6cae;
  --estal-primary-soft: #9b8fd1;
  --estal-text-main: #333a4d;
  --estal-text-muted: #4c5670;
}

/* Fondo general */
body.estalmat-fondo-suave {
  background: var(--estal-bg);
}

/* Tarjeta base */
.estalmat-card {
  background: var(--estal-card-bg);
  max-width: 700px;
  width: 95%;
  margin: 24px auto;
  padding: 24px 26px 28px;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--estal-border);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.estalmat-title {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--estal-primary);
  margin-bottom: 4px;
  font-weight: 600;
}

.estalmat-subtitle {
  font-size: 1.05rem;
  font-weight: 600;
  color: #445065;
  margin-bottom: 14px;
}

.statement {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--estal-text-main);
  background: #f7f8ff;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px dashed #dadff4;
}

.statement .pregunta {
  color: #7b3fb8;
  font-weight: 700;
}

/* Entradas */
.input-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.input-row label {
  font-size: 0.95rem;
  color: var(--estal-text-muted);
}

.input-row input[type="number"],
.input-row input[type="text"] {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #cfd5eb;
  font-size: 1rem;
  min-width: 120px;
  outline: none;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.input-row input[type="number"]:focus,
.input-row input[type="text"]:focus {
  border-color: var(--estal-primary);
  box-shadow: 0 0 0 2px rgba(123, 108, 174, 0.18);
}

/* ------------------------------
   BOTONES DEL EJERCICIO
-------------------------------*/

.btn-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

/* Botón morado */
.btn-primary {
  background: #6b5eb8;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-primary:hover {
  background: #5a4ea3;
}

/* Botón amarillo claro */
.btn-secondary {
  background: #ffcc67;
  color: #3f2d00;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-secondary:hover {
  background: #f4b948;
}

/* Botón fantasma */
.btn-ghost {
  background: transparent;
  color: #6b5eb8;
  border: 2px solid #6b5eb8;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-ghost:hover {
  background: #6b5eb8;
  color: white;
}

/* ------------------------------
   BOTONES DE CABECERA (estal-btn)
-------------------------------*/

a.estal-btn,
button.estal-btn {
  background: white;
  color: #333;
  border: 2px solid #ddd;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

a.estal-btn:hover,
button.estal-btn:hover {
  background: #f7f7f7;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* Feedback y cajas extra */
.feedback {
  margin-top: 14px;
  min-height: 1.2em;
  font-size: 0.95rem;
}

.feedback.ok {
  color: #1c8652;
}

.feedback.error {
  color: #c0392b;
}

.extra-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  display: none;
}

.hint-box {
  background: #fdf7ea;
  border: 1px solid #f2dfb3;
  color: #71552b;
}

.solution-box {
  background: #f5f4ff;
  border: 1px solid #d1cdf6;
  color: #403a6e;
}

.solution-box ol {
  padding-left: 20px;
  margin: 6px 0 0;
}

/* Responsive */
@media (max-width: 600px) {
  .estalmat-card {
    padding: 18px 16px 22px;
  }

  .input-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  a.estal-btn,
  button.estal-btn {
    width: 100%;
    text-align: center;
  }
}

/* Cabecera */
.session-wrapper {
  max-width: 1100px;
  margin: 24px auto 40px;
  padding: 0 12px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

header.sesion-header {
  text-align: center;
  margin-bottom: 16px;
}

header.sesion-header h1 {
  font-size: 1.9rem;
  margin: 0 0 4px;
  color: var(--estal-primary, #7b6cae);
}

header.sesion-header p {
  margin: 2px 0;
  color: var(--estal-text-muted, #4c5670);
  font-size: 0.98rem;
}

.emoji-hero {
  font-size: 2.3rem;
  animation: bounce 1.8s infinite;
  display: inline-block;
  margin-bottom: 4px;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* ======================================
   TABLAS DE LÓGICA (B1 y similares)
====================================== */

.tabla-scroll {
  overflow-x: auto;
  margin: 12px 0;
}

/* Tabla base */
.tabla-logica {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto;
  font-size: 0.9rem;
  text-align: center;
}

.tabla-logica th,
.tabla-logica td {
  border: 1px solid #333;
  padding: 6px 8px;
  text-align: center;
  background: #ffffff;
}

/* Encabezado */
.tabla-logica thead th {
  background: #eae6ff;
  font-weight: 700;
}

/* Nombre de la fila (persona) alineado a la izquierda */
.tabla-logica tbody th {
  text-align: left;
  font-weight: 700;
}

/* Destacar la tabla final un poco más */
.tabla-logica.tabla-final {
  border: 2px solid #555;
}

/* Colores para SÍ / NO */
.tabla-logica .si {
  color: #008000;
  font-weight: 700;
}

.tabla-logica .no {
  color: #b00020;
  font-weight: 700;
}
