/* ===================================
   CONTENEDOR PRINCIPAL
   =================================== */

#nuevo-cuestionario-wrap {
  padding: 60px 0;
}

/* Wrapper con border (igual que form-radios) */
#nuevo-cuestionario-wrap .ordenar-opciones-wrapper, .wrap_pregunta {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.wrap_pregunta, .ordenar-opciones-wrapper {
  margin-bottom: 30px;
}

.form-pregunta-info {
  margin: 30px 0;
  font-weight: bold;
}

/* ===================================
   FILA TÍTULO-ÁREA + BOTÓN VER ACCIONES
   =================================== */

.titulo-area-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 4px 0;
}

.titulo-area-row h3.titulo-area {
  margin: 0;
  flex: 1;
}

.ver-acciones-btn {
  flex-shrink: 0;
  background-color: #c1272d;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-family: inherit;
}

.ver-acciones-btn:hover,
.ver-acciones-btn.is-open {
  opacity: 100;
  background-color: white;
  color: #CE0E2D;
  outline: 2px #CE0E2D solid !important;
}

/* ===================================
   PANEL DE ACCIONES — MENÚ FLOTANTE
   =================================== */

/* Oculto por defecto; se activa con .is-open vía JS */
.cuestionario-actions-panel {
  display: none;
  position: absolute;
  z-index: 9990;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13), 0 2px 6px rgba(0, 0, 0, 0.07);
  padding: 6px 0;
  min-width: 280px;
  flex-direction: column;
  gap: 0;
  /* animación acordeón: escala desde arriba */
  transform-origin: top right;
  animation: accionesOpen 0.18s ease forwards;
}

.cuestionario-actions-panel.is-open {
  display: flex;
}

@keyframes accionesOpen {
  from {
    opacity: 0;
    transform: scaleY(0.85) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scaleY(1) translateY(0);
  }
}

.cuestionario-actions-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 6px;
}

.cuestionario-actions-secondary {
  border-top: 1px solid #f3f4f6;
  margin-top: 2px;
  padding-top: 4px;
}

/* Separador visual dentro del menú */
.cuestionario-actions-panel .cuestionario-actions-primary {
  padding-bottom: 0;
}

/* --- Ítems del menú: estilo unificado --- */
.cuestionario-actions-panel a,
.cuestionario-actions-panel button {
  width: 100%;
  padding: 8px 14px;
  font-size: 13px;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 5px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
  font-family: inherit;
  box-sizing: border-box;
}


/* Hover y active unificados para todos los ítems */
.cuestionario-actions-panel a:hover,
.cuestionario-actions-panel a:active,
.cuestionario-actions-panel button:hover,
.cuestionario-actions-panel button:active {
  color: #fff !important;
  background-color: #c1272d !important;
  text-decoration: none;
  opacity: 1;
}

/* ===================================
   ENCABEZADOS Y TÍTULOS
   =================================== */

#nuevo-cuestionario-wrap h2 {
  text-align: center;
  margin-bottom: 50px;
  font-size: 36px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.5px;
}

#nuevo-cuestionario-wrap h3.titulo-area {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 4px 0;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

#nuevo-cuestionario-wrap h4.titulo-competencia {
  font-size: 15px;
  font-weight: 500;
  color: #555;
  margin: 0 0 5px 0;
  line-height: 1.5;
}

#nuevo-cuestionario-wrap .titulo-nivel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px 0;
}

#nuevo-cuestionario-wrap .titulo-nivel-numero {
  display: inline-block;
  background: #0066cc;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 20px;
  line-height: 1.6;
}

#nuevo-cuestionario-wrap .titulo-nivel-nombre {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
}

#nuevo-cuestionario-wrap legend {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 25px;
  border: none;
  padding: 0;
}

/* ===================================
   OPCIONES DE RESPUESTA
   =================================== */

#nuevo-cuestionario-wrap .form-radios {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

#nuevo-cuestionario-wrap .form-radios .form-item {
  margin: 0 0 12px 0;
  padding: 14px 16px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #ffffff;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  min-height: 52px;
}

#nuevo-cuestionario-wrap .form-radios .form-item:last-child {
  margin-bottom: 0;
}

#nuevo-cuestionario-wrap .form-radios .form-item:hover {
  border-color: #c1272d;
  background: #fff5f5;
  box-shadow: 0 2px 6px rgba(193, 39, 45, 0.1);
}

/* Estilo para opción seleccionada */
#nuevo-cuestionario-wrap .form-radios .form-item:has(input[type="radio"]:checked) {
  border-color: #c1272d;
  background: #fff5f5;
  box-shadow: 0 2px 8px rgba(193, 39, 45, 0.15);
}

/* Fallback para navegadores que no soportan :has() */
#nuevo-cuestionario-wrap .form-radios .form-item.selected {
  border-color: #c1272d;
  background: #fff5f5;
  box-shadow: 0 2px 8px rgba(193, 39, 45, 0.15);
}

/* Ocultar radiobutton nativo */
#nuevo-cuestionario-wrap .form-radios input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 18px;
  width: 18px;
  margin: 2px 14px 0 0;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid #dee2e6;
  border-radius: 50%;
  background-color: #ffffff;
  position: relative;
  transition: all 0.3s ease;
}

/* Radiobutton en hover */
#nuevo-cuestionario-wrap .form-radios input[type="radio"]:hover {
  border-color: #c1272d;
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.1);
}

/* Radiobutton seleccionado */
#nuevo-cuestionario-wrap .form-radios input[type="radio"]:checked {
  border-color: #c1272d;
  background-color: #c1272d;
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.15);
}

/* Punto interior del radiobutton seleccionado */
#nuevo-cuestionario-wrap .form-radios input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ffffff;
}

#nuevo-cuestionario-wrap .form-radios label {
  display: flex;
  align-items: flex-start;
  margin: 0;
  cursor: pointer;
  width: 100%;
  line-height: 1.4;
}

#nuevo-cuestionario-wrap .form-radios .form-type-radio .option {
  font-weight: 400;
  font-size: 15px;
  color: #212529;
  line-height: 1.5;
  flex: 1;
  margin: 0;
  word-wrap: break-word;
  padding-bottom: 0;
}

/* ===================================
   CHECKBOXES (mismo diseño que radios,
   casillas cuadradas con checkmark)
   =================================== */

#nuevo-cuestionario-wrap .form-checkboxes {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

#nuevo-cuestionario-wrap .form-checkboxes .form-item {
  margin: 0 0 12px 0;
  padding: 14px 16px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #ffffff;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  min-height: 52px;
}

#nuevo-cuestionario-wrap .form-checkboxes .form-item:last-child {
  margin-bottom: 0;
}

#nuevo-cuestionario-wrap .form-checkboxes .form-item:hover {
  border-color: #c1272d;
  background: #fff5f5;
  box-shadow: 0 2px 6px rgba(193, 39, 45, 0.1);
}

/* Estilo para opción seleccionada */
#nuevo-cuestionario-wrap .form-checkboxes .form-item:has(input[type="checkbox"]:checked) {
  border-color: #c1272d;
  background: #fff5f5;
  box-shadow: 0 2px 8px rgba(193, 39, 45, 0.15);
}

/* Ocultar checkbox nativo */
#nuevo-cuestionario-wrap .form-checkboxes input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 18px;
  width: 18px;
  margin: 2px 14px 0 0;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  background-color: #ffffff;
  position: relative;
  transition: all 0.3s ease;
}

/* Checkbox en hover */
#nuevo-cuestionario-wrap .form-checkboxes input[type="checkbox"]:hover {
  border-color: #c1272d;
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.1);
}

/* Checkbox marcado */
#nuevo-cuestionario-wrap .form-checkboxes input[type="checkbox"]:checked {
  border-color: #c1272d;
  background-color: #c1272d;
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.15);
}

/* Checkmark interior */
#nuevo-cuestionario-wrap .form-checkboxes input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 6px;
  height: 10px;
  border: 2px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

#nuevo-cuestionario-wrap .form-checkboxes label {
  display: flex;
  align-items: flex-start;
  margin: 0;
  cursor: pointer;
  width: 100%;
  line-height: 1.4;
}

#nuevo-cuestionario-wrap .form-checkboxes .form-type-checkbox .option {
  font-weight: 400;
  font-size: 15px;
  color: #212529;
  line-height: 1.5;
  flex: 1;
  margin: 0;
  word-wrap: break-word;
  padding-bottom: 0;
}

/* ===================================
   BOTONES
   =================================== */

.form-actions-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 35px;
  padding-top: 25px;
  border-top: 1px solid #e9ecef;
}

#nuevo-cuestionario-wrap .button {
  padding: 12px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#nuevo-cuestionario-wrap .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Botón Siguiente */
#nuevo-cuestionario-wrap .button.form-submit {
  background-color: #c1272d;
  color: white;
}

#nuevo-cuestionario-wrap .button.form-submit:hover {
  opacity: 100;
  background-color: white;
  color: #CE0E2D !important;
  outline: 2px #CE0E2D solid;
}

/* Botón Guardar */
.guardar-btn {
  background-color: #c1272d;
  color: white;
  border-color: #c1272d;
}

.guardar-btn:hover {
  background-color: #a01f24;
  border-color: #a01f24;
  color: white;
}

/* Botón Continuar Cuestionario (usado fuera del panel también) */
.continuar-cuestionario-btn {
  background-color: #c1272d;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 8px;
  padding: 14px 22px;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}


/* ===================================
   PÁGINA DE CUESTIONARIO GUARDADO
   =================================== */

.cuestionario-guardado-container {
  text-align: center;
  padding: 100px 20px;
  max-width: 600px;
  margin: 0 auto;
}

.guardado-icon {
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
}

.guardado-icon svg {
  animation: checkmarkPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkmarkPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.guardado-title {
  font-size: 32px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 20px;
  line-height: 1.3;
}

.guardado-message {
  font-size: 16px;
  color: #666;
  line-height: 1.8;
  margin-bottom: 50px;
}

.guardado-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.guardado-btn-continuar,
.guardado-btn-inicio {
  display: inline-block;
  padding: 14px 35px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  min-width: 300px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
}

.guardado-btn-continuar:hover,
.guardado-btn-inicio:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.guardado-btn-continuar {
  background-color: #007bff;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.guardado-btn-continuar:hover {
  background-color: #0056b3;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.35);
}

.guardado-btn-inicio {
  background-color: transparent;
  color: #6c757d;
  border: 2px solid #6c757d;
}

.guardado-btn-inicio:hover {
  background-color: #6c757d;
  color: #fff;
  border-color: #6c757d;
}


/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 1280px) {
  #nuevo-cuestionario-wrap {
    padding: 60px 1.5rem;
  }
}



@media (max-width: 768px) {
  #nuevo-cuestionario-wrap h2 {
    font-size: 28px;
    margin-bottom: 35px;
    line-height: normal;
  }

  .titulo-area-row {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .titulo-area-row h3.titulo-area {
    flex: unset;
  }

  .ver-acciones-btn {
    width: 100%;
  }

  .cuestionario-actions-panel {
    padding: 12px 14px;
    min-width: unset;
    width: calc(100vw - 16px);
    left: 8px !important;
    box-sizing: border-box;
  }

  .cuestionario-actions-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .continuar-cuestionario-btn,
  .guardar-panel-btn,
  .reiniciar-btn {
    width: 100%;
    justify-content: center;
  }

  .form-actions-wrapper {
    flex-direction: column;
    gap: 12px;
  }

  .form-actions-wrapper .button {
    width: 100%;
  }

  .form-pregunta-descripcion img {
    width: 100%;
  }
}

@media (max-width: 480px) {
  #nuevo-cuestionario-wrap {
    padding: 40px 1.5rem;
  }

  #nuevo-cuestionario-wrap h2 {
    font-size: 24px;
    margin-bottom: 30px;
  }

  #nuevo-cuestionario-wrap h3.titulo-area {
    font-size: 15px;
  }

  #nuevo-cuestionario-wrap .titulo-nivel-nombre {
    font-size: 18px;
  }

  #nuevo-cuestionario-wrap .form-radios {
    padding: 15px;
  }

  #nuevo-cuestionario-wrap .form-radios .form-item {
    padding: 12px;
    margin-bottom: 10px;
    min-height: 48px;
  }

  #nuevo-cuestionario-wrap .form-radios input[type="radio"] {
    margin: 1px 12px 0 0;
  }

  .cuestionario-guardado-container {
    padding: 60px 15px;
  }

  .guardado-title {
    font-size: 26px;
  }

  .guardado-btn-continuar,
  .guardado-btn-inicio {
    min-width: 100%;
    padding: 12px 20px;
  }

  .form-actions-wrapper {
    margin-top: 25px;
  }

  #nuevo-cuestionario-wrap .button {
    padding: 10px 20px;
    font-size: 14px;
  }
}
