/* ============================================= */
/* RESET & BASE                                  */
/* ============================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  background: #f5f0ff;
  color: #2c3e50;
  min-height: 100vh;
}

noscript p {
  background: #fff3cd;
  color: #856404;
  padding: 16px 20px;
  text-align: center;
  font-weight: 600;
  border-bottom: 2px solid #ffc107;
}

/* ============================================= */
/* LAYOUT                                        */
/* ============================================= */

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ============================================= */
/* NAVIGATION BAR                                */
/* ============================================= */

.nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  background: #ffffff;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-btn {
  font-size: 16px;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  background: #8e44ad;
  color: #fff;
  transition: background 0.2s, transform 0.15s;
}

.nav-btn:hover {
  background: #7d3c98;
  transform: scale(1.05);
}

.nav-btn:focus-visible {
  outline: 3px solid #f39c12;
  outline-offset: 2px;
}

#btn-nav-guia {
  background: #34495e;
}

#btn-nav-guia:hover {
  background: #2c3e50;
}

/* ============================================= */
/* SECTIONS (shared)                             */
/* ============================================= */

.seccion {
  display: none;
}

#seccion-guia {
  display: block;
}

.seccion h1 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 8px;
}

.subtitulo {
  text-align: center;
  font-size: 1.1rem;
  color: #7f8c8d;
  margin-bottom: 28px;
}

/* ============================================= */
/* STUDY GUIDE SECTION                           */
/* ============================================= */

.guia-seccion {
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.guia-seccion h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  border-bottom: 3px solid #8e44ad;
  padding-bottom: 8px;
}

.guia-seccion h3 {
  font-size: 1.15rem;
  margin-top: 20px;
  margin-bottom: 8px;
}

.guia-seccion p {
  margin-bottom: 10px;
}

.guia-seccion ul,
.guia-seccion ol {
  margin: 10px 0 14px 24px;
}

.guia-seccion li {
  margin-bottom: 6px;
}

/* Word-type colored headings */
.tipo-verbo {
  color: #e74c3c;
}

.tipo-sustantivo {
  color: #3498db;
}

.tipo-adjetivo {
  color: #2ecc71;
}

.tipo-adverbio {
  color: #e67e22;
}

/* Tip callout */
.tip {
  background: #fef9e7;
  border-left: 5px solid #f1c40f;
  padding: 12px 16px;
  border-radius: 0 10px 10px 0;
  margin: 12px 0;
  font-size: 0.95rem;
}

/* Example text */
.ejemplo {
  background: #eaf2f8;
  padding: 10px 14px;
  border-radius: 8px;
  font-style: italic;
  margin: 10px 0;
}

/* Reference images */
figure {
  margin: 20px 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

figcaption {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-top: 8px;
}

/* ============================================= */
/* SCORE DISPLAY                                 */
/* ============================================= */

.puntuacion {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  background: #ffffff;
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ============================================= */
/* EXERCISE AREA (shared)                        */
/* ============================================= */

.ejercicio-area {
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* ============================================= */
/* SYNTAX TEST                                   */
/* ============================================= */

.oracion-display {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  background: #fdf2e9;
  padding: 18px 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 2px dashed #e67e22;
}

.campos-sintaxis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.campo-grupo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.campo-grupo label {
  font-weight: 600;
  font-size: 0.95rem;
}

.campo-grupo input,
.campo-grupo select {
  font-size: 1rem;
  padding: 10px 12px;
  border: 2px solid #dcdde1;
  border-radius: 10px;
  transition: border-color 0.2s;
}

.campo-grupo input:focus,
.campo-grupo select:focus {
  border-color: #8e44ad;
  outline: none;
  box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.15);
}

/* ============================================= */
/* ACTION & NEXT BUTTONS                         */
/* ============================================= */

.btn-accion {
  display: block;
  width: 100%;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 14px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: #8e44ad;
  color: #fff;
  transition: background 0.2s, transform 0.15s;
}

.btn-accion:hover {
  background: #7d3c98;
  transform: scale(1.02);
}

.btn-accion:focus-visible {
  outline: 3px solid #f39c12;
  outline-offset: 2px;
}

.btn-siguiente {
  display: block;
  margin: 16px auto 0;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 14px 40px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: #2ecc71;
  color: #fff;
  transition: background 0.2s, transform 0.15s;
}

.btn-siguiente:hover {
  background: #27ae60;
  transform: scale(1.04);
}

.btn-siguiente:focus-visible {
  outline: 3px solid #f39c12;
  outline-offset: 2px;
}

/* ============================================= */
/* RESULT / FEEDBACK AREA                        */
/* ============================================= */

.resultado-area {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  font-size: 1.05rem;
}

/* ============================================= */
/* WORD TYPES TEST                               */
/* ============================================= */

.frase-display {
  font-size: 1.3rem;
  font-weight: 500;
  text-align: center;
  background: #ebf5fb;
  padding: 18px 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 2px dashed #3498db;
}

.palabra-resaltada {
  font-weight: 800;
  background: #f9e79f;
  padding: 2px 8px;
  border-radius: 6px;
  border-bottom: 3px solid #f1c40f;
}

.botones-tipo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.btn-tipo {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 16px 12px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.btn-tipo:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-tipo:focus-visible {
  outline: 3px solid #f39c12;
  outline-offset: 2px;
}

.btn-adjetivo {
  background: #2ecc71;
}

.btn-adverbio {
  background: #e67e22;
}

.btn-verbo {
  background: #e74c3c;
}

.btn-sustantivo {
  background: #3498db;
}

/* ============================================= */
/* ACCENTUATION TEST                             */
/* ============================================= */

.selector-subtest {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-subtest {
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 22px;
  border: 2px solid #8e44ad;
  border-radius: 24px;
  cursor: pointer;
  background: #fff;
  color: #8e44ad;
  transition: background 0.2s, color 0.2s;
}

.btn-subtest:hover {
  background: #f3e5f5;
}

.btn-subtest.activo {
  background: #8e44ad;
  color: #fff;
}

.btn-subtest:focus-visible {
  outline: 3px solid #f39c12;
  outline-offset: 2px;
}

.palabra-display {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  background: #fef9e7;
  padding: 20px 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 2px dashed #f1c40f;
  letter-spacing: 2px;
}

.botones-clasificacion {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-clasificacion {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 14px 28px;
  border: 3px solid #8e44ad;
  border-radius: 14px;
  cursor: pointer;
  background: #fff;
  color: #8e44ad;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.btn-clasificacion:hover {
  background: #8e44ad;
  color: #fff;
  transform: scale(1.05);
}

.btn-clasificacion:focus-visible {
  outline: 3px solid #f39c12;
  outline-offset: 2px;
}

/* Syllable buttons */
.botones-silabas {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn-silaba {
  font-size: 1.2rem;
  font-weight: 700;
  padding: 14px 22px;
  border: 3px solid #3498db;
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
  color: #2c3e50;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  min-width: 60px;
  text-align: center;
}

.btn-silaba:hover {
  background: #ebf5fb;
  transform: scale(1.06);
}

.btn-silaba.seleccionada {
  background: #3498db;
  color: #fff;
  border-color: #2980b9;
  transform: scale(1.08);
  box-shadow: 0 3px 10px rgba(52, 152, 219, 0.35);
}

.btn-silaba:focus-visible {
  outline: 3px solid #f39c12;
  outline-offset: 2px;
}

/* Tilde checkbox */
.tilde-check {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.1rem;
  font-weight: 600;
}

.tilde-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
  accent-color: #8e44ad;
}

/* ============================================= */
/* CHALLENGES (RETOS) TEST                       */
/* ============================================= */

.premisa-display {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  background: #f5eef8;
  padding: 18px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 2px dashed #8e44ad;
}

/* Color legend */
.leyenda-colores {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 20px 0;
}

.leyenda-colores h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.leyenda-colores ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.leyenda-colores li {
  font-size: 0.95rem;
}

/* Word-type legend labels */
.leyenda-verbo {
  color: #fff;
  background: #e74c3c;
  padding: 2px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.leyenda-sustantivo {
  color: #fff;
  background: #3498db;
  padding: 2px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.leyenda-adjetivo {
  color: #fff;
  background: #2ecc71;
  padding: 2px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.leyenda-adverbio {
  color: #fff;
  background: #e67e22;
  padding: 2px 10px;
  border-radius: 6px;
  font-weight: 700;
}

/* Accentuation legend markers */
.leyenda-aguda {
  display: inline-block;
  border: 3px solid #555;
  border-radius: 50%;
  padding: 2px 10px;
  font-weight: 700;
}

.leyenda-llana {
  display: inline-block;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
  font-weight: 700;
}

.leyenda-esdrujula {
  display: inline-block;
  border: 3px solid #555;
  border-radius: 4px;
  padding: 2px 10px;
  font-weight: 700;
}

/* Word marking area */
.marcado-area {
  margin-top: 20px;
}

.marcado-area h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  text-align: center;
}

.palabras-marcado {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* ============================================= */
/* FEEDBACK STATES                               */
/* ============================================= */

.correcto {
  background: #d5f5e3 !important;
  border-color: #27ae60 !important;
  color: #1e8449;
}

.incorrecto {
  background: #fadbd8 !important;
  border-color: #e74c3c !important;
  color: #c0392b;
}

.campo-correcto {
  border-color: #27ae60 !important;
  background: #eafaf1 !important;
}

.campo-incorrecto {
  border-color: #e74c3c !important;
  background: #fdedec !important;
}

/* ============================================= */
/* RESPONSIVE — TABLET (≤ 768px)                 */
/* ============================================= */

@media (max-width: 768px) {
  body {
    font-size: 17px;
  }

  .container {
    padding: 18px 14px 40px;
  }

  .nav-bar {
    gap: 8px;
    padding: 10px 12px;
  }

  .nav-btn {
    font-size: 14px;
    padding: 8px 14px;
  }

  .seccion h1 {
    font-size: 1.6rem;
  }

  .campos-sintaxis {
    grid-template-columns: 1fr;
  }

  .botones-tipo {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .btn-tipo {
    font-size: 1rem;
    padding: 14px 10px;
  }

  .leyenda-colores ul {
    flex-direction: column;
    gap: 8px;
  }
}

/* ============================================= */
/* RESPONSIVE — MOBILE (≤ 480px)                 */
/* ============================================= */

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .container {
    padding: 14px 10px 32px;
  }

  .nav-bar {
    gap: 6px;
    padding: 8px 8px;
  }

  .nav-btn {
    font-size: 13px;
    padding: 7px 10px;
    border-radius: 18px;
  }

  .seccion h1 {
    font-size: 1.35rem;
  }

  .guia-seccion {
    padding: 20px 16px;
  }

  .ejercicio-area {
    padding: 20px 14px;
  }

  .oracion-display,
  .frase-display,
  .palabra-display,
  .premisa-display {
    font-size: 1.1rem;
    padding: 14px 12px;
  }

  .botones-tipo {
    grid-template-columns: 1fr;
  }

  .btn-clasificacion {
    padding: 12px 20px;
    font-size: 1rem;
  }

  .btn-silaba {
    font-size: 1rem;
    padding: 12px 16px;
    min-width: 50px;
  }

  .selector-subtest {
    flex-direction: column;
    align-items: center;
  }

  .btn-subtest {
    width: 100%;
    max-width: 280px;
  }
}
